diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index b8bcfafe..65a38086 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -45,6 +45,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Install package run: make install - name: Run tests @@ -70,23 +72,25 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Install -core package run: | - python -m pip install . - python -m pip install "pytest-rerunfailures>=10,<15" + uv pip install --system . + uv pip install --system "pytest-rerunfailures>=10,<15" - name: Verify pytest plugins run: python -m pytest --version - name: Install -us package from PyPI run: | if [[ "${{ matrix.python-version }}" == "3.13" || "${{ matrix.python-version }}" == "3.14" ]]; then # For Python 3.13+, install newer tables first and ignore conflicts - pip install "tables>=3.11.0" - pip install policyengine-us --no-deps + uv pip install --system "tables>=3.11.0" + uv pip install --system policyengine-us --no-deps # Install remaining dependencies manually (skip pytest-dependency which has build issues) - pip install click pathlib synthimpute tabulate - pip install policyengine-us-data --no-deps + uv pip install --system click pathlib synthimpute tabulate + uv pip install --system policyengine-us-data --no-deps else - python -m pip install policyengine-us + uv pip install --system policyengine-us fi shell: bash - name: Run smoke tests only diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index b9422f88..12934ba7 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -28,9 +28,11 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.14" + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Build changelog run: | - pip install towncrier + uv pip install --system towncrier python .github/bump_version.py towncrier build --yes --version $(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))") - name: Preview changelog update @@ -54,6 +56,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.14" + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Install package run: make install - name: Run tests @@ -80,6 +84,8 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.14" + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: Publish a git tag run: ".github/publish-git-tag.sh || true" - name: Install package diff --git a/Makefile b/Makefile index 05e9ccb7..e774214b 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ format: ruff check . install: - pip install -e ".[dev]" --config-settings editable_mode=compat + uv pip install --system -e ".[dev]" --config-settings editable_mode=compat test-country-template: policyengine-core test policyengine_core/country_template/tests -c policyengine_core.country_template diff --git a/changelog.d/migrate-to-uv.changed.md b/changelog.d/migrate-to-uv.changed.md new file mode 100644 index 00000000..ca57a345 --- /dev/null +++ b/changelog.d/migrate-to-uv.changed.md @@ -0,0 +1 @@ +Migrate from pip to uv for dependency management in Makefile and CI workflows.