diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a14427f..6d79bda 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,12 +19,20 @@ jobs: - name: Exit if not on master branch if: github.ref_name != 'master' run: exit -1 + + - name: Install uv + uses: astral-sh/setup-uv@v2 + + - name: Set up Python 3.12 + run: uv python install 3.12 - name: Install build dependencies - run: python -m pip install --upgrade build + run: | + uv venv + uv pip install --upgrade build - name: Build source distribution - run: python -m build + run: uv run python -m build - uses: actions/upload-artifact@v4 with: @@ -43,15 +51,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Run PyInstaller with Tox run: | - python -m ensurepip --upgrade - python -m pip install tox tox-uv tox-gh-actions + uv venv + uv pip install tox-uv tox-gh-actions tox - name: Rename binary diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 336043f..cb1de9c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,6 @@ on: [push, pull_request] + name: CI jobs: test: @@ -17,25 +18,16 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 -# - name: Cache pip -# uses: actions/cache@v3 -# with: -# path: ~/.cache/pip -# key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements-*.txt') }} -# restore-keys: | -# v1-pip-${{ runner.os }}-${{ matrix.python-version }} -# v1-pip-${{ runner.os }} -# v1-pip- - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + - name: Install uv + uses: astral-sh/setup-uv@v2 + - name: Set up Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install mreg-cli run: | - python -m ensurepip --upgrade - pip install -e .[dev] + uv venv + uv pip install -e .[dev] - name: Test and compare api calls - run: ci/run_testsuite_and_record.sh + run: uv run ci/run_testsuite_and_record.sh tox: name: tox @@ -49,14 +41,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install dependencies run: | - python -m ensurepip --upgrade - python -m pip install tox tox-uv tox-gh-actions + uv venv + uv pip install tox-uv tox-gh-actions - name: Test with tox - run: tox r + run: uv run tox r \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d2a45f7..7b7f651 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ dependencies = [ dynamic = ["version"] [project.optional-dependencies] -dev = ["ruff", "tox", "rich"] +dev = ["ruff", "tox-uv", "rich", "setuptools", "setuptools-scm", "build"] [project.urls] Repository = 'https://github.com/unioslo/mreg-cli/'