diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 404ff986..3c93f342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,15 +21,17 @@ jobs: python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + + - name: Install uv + uses: astral-sh/setup-uv@v4 with: python-version: ${{ matrix.python }} - cache: 'pip' - cache-dependency-path: | - '../**/requirements*.txt' - '../**/setup.py' - - run: python -m pip install --upgrade setuptools pip tox virtualenv + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt + - run: uv tool install tox --with tox-uv # Run tox only for the installed py version on the runner as outlined in the python matrix # Ensures the correct py version is installed and tested as opposed to 'tox' which attempts to run for all py versions in tox.ini - - run: tox -e py - - run: tox -e mypy + - run: uv run tox -e py + - run: uv run tox -e mypy diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d66744b6..f4e9036c 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -17,18 +17,19 @@ jobs: python: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 with: python-version: ${{ matrix.python }} - cache: 'pip' - cache-dependency-path: | - '../**/requirements*.txt' - '../**/setup.py' - - run: python -m pip install --upgrade setuptools pip tox virtualenv + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt + - run: uv tool install tox --with tox-uv # Run tox only for the installed py version on the runner as outlined in the python matrix # Ensures the correct py version is installed and tested as opposed to 'tox' which attempts to run for all py versions in tox.ini - - run: tox -e py - - run: tox -e mypy + - run: uv run tox -e py + - run: uv run tox -e mypy deploy: # Run tests beforing deploying to pypi @@ -36,18 +37,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: Install uv + uses: astral-sh/setup-uv@v4 with: - python-version: 3.13 - cache: 'pip' - cache-dependency-path: | - '../**/requirements*.txt' - '../**/setup.py' + python-version: '3.13' + enable-cache: true + cache-dependency-glob: | + **/setup.py + **/requirements*.txt - name: Install dependencies - run: pip install wheel + run: uv pip --system --upgrade install wheel - name: Build package - run: python setup.py sdist bdist_wheel + run: uv run python setup.py sdist bdist_wheel - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: