diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3456a1..9004bc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build wheel +name: Build wheels on: release: @@ -97,16 +97,16 @@ jobs: git config user.name "Marcelo Duarte" git config user.email marcelotduarte@users.noreply.github.com SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) - VERSION=$(uvx bump-my-version show current_version 2>/dev/null) - VERSION_BASE=$(python -c "print('$VERSION'.rsplit('-',1)[0])") - if [ "${{ github.event_name }}" == "pull_request" ]; then - OPTIONAL=".${{ github.event.number }}" + VERSION=$(uv version --short) + if (echo "$VERSION" | grep -q "\.dev"); then + uv version --no-sync --bump dev=$SOURCE_DATE_EPOCH else - OPTIONAL="" + uv version --no-sync --bump patch --bump dev=$SOURCE_DATE_EPOCH fi - VERSION_NEW=$VERSION_BASE$OPTIONAL-dev.$SOURCE_DATE_EPOCH - uvx bump-my-version bump --no-tag build --new-version=$VERSION_NEW 2>/dev/null - git log -1 + NEW_VERSION=$(uv version --short) + git checkout -b build-$NEW_VERSION + git commit -m "Bump version: ${VERSION} → ${NEW_VERSION} [ci skip]" -a + git log -2 - name: Build sdist and wheels run: ./ci/build-wheel.sh "${{ matrix.tag }}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8d4bb1..6f159ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,9 +100,9 @@ jobs: pattern: python-msilib-wheel-${{ matrix.os }}* path: wheelhouse - - name: Install dependencies to test + - name: Install dependencies run: | - uv pip install --extra tests --upgrade -r pyproject.toml + uv pip install -r pyproject.toml --upgrade --group tests uv pip install python-msilib -f wheelhouse \ --no-build --no-deps --no-index --prerelease=allow --reinstall diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d235d0..89ccb90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -71,3 +71,13 @@ repos: files: ^( src/msilib/include/pythoncapi_compat.h| src/msilib/include/.*.h|src/msilib/.*.c)$ + + - repo: local + hooks: + - id: requirements + name: requirements + language: system + entry: python ci/requirements.py + files: ^(pyproject.toml|requirements.txt|requirements-dev.txt| + tests/requirements.txt + )$ diff --git a/Makefile b/Makefile index 1463766..44b3106 100644 --- a/Makefile +++ b/Makefile @@ -64,20 +64,24 @@ cov: wheel .PHONY: release release: - bump-my-version show-bump 2>/dev/null + uv version @echo "Run:" - @echo " bump-my-version bump