-
Notifications
You must be signed in to change notification settings - Fork 41
chore: migrate dependency management to uv #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
992fa8f
4e7cb07
f3afe84
ad0143d
5d3b553
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,56 +10,61 @@ jobs: | |
| linting: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Install dependencies | ||
| run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox | ||
| - name: Git checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note astral-sh current release is v9. Any reason we don't want to pin against latest release of this action? |
||
| - name: Run ruff and mypy checks | ||
| run: tox -e ruff,mypy | ||
| py310: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Install dependencies | ||
| run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox | ||
| - name: Git checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - name: Run tox | ||
| run: tox -e py310 | ||
| py312: | ||
| runs-on: ubuntu-24.04 | ||
| run: uvx --with tox-uv tox -e ruff,mypy | ||
|
|
||
| unit-tests: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - python: "3.10" | ||
| runner: ubuntu-22.04 | ||
| tox-env: py310 | ||
| - python: "3.12" | ||
| runner: ubuntu-24.04 | ||
| tox-env: py312 | ||
| runs-on: ${{ matrix.runner }} | ||
| steps: | ||
| - name: Install dependencies | ||
| run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox | ||
| - name: Git checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again we are reducing our workflow pinning from v7 to v4. Let's keep the recent releases unless there is justification for pinning and older release stream |
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
| - name: Run tox | ||
| run: tox -e py312 | ||
| run: uvx --with tox-uv tox -e ${{ matrix.tox-env }} | ||
|
|
||
| docs: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Install dependencies | ||
| run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox | ||
| - name: Git checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
| - name: Build rtd docs | ||
| run: tox -e docs | ||
| run: uvx --with tox-uv tox -e docs | ||
|
|
||
| integration-tests: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update -q | ||
| sudo apt-get install -qy distro-info tox | ||
| sudo apt-get install -qy distro-info | ||
| sudo snap install lxd | ||
| - name: Git checkout | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3 | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
|
Comment on lines
+58
to
+60
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see v3 instead of the earlier v4 for checkout here. Let's make sure we use the same version for all actions throughout our workflows. |
||
| - name: Setup LXD | ||
| uses: canonical/setup-lxd@8c6a87bfb56aa48f3fb9b830baa18562d8bfd4ee # v1 | ||
| uses: canonical/setup-lxd@54a5806e490d92e207b57183cf111ed54bbdeff4 # v0.1.2 | ||
| - name: Setup pycloudlib config and ssh key | ||
| run: | | ||
| ssh-keygen -P "" -q -f ~/.ssh/id_rsa | ||
| mkdir -p ~/.config | ||
| echo "[lxd]" > ~/.config/pycloudlib.toml | ||
| - name: Run CI integration tests | ||
| run: | | ||
| tox -e integration-tests-ci -- --color=yes tests/integration_tests/ | ||
| uvx --with tox-uv tox -e integration-tests-ci -- --color=yes tests/integration_tests/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,32 @@ | ||
| PYTHON = python3 | ||
| SETUP := $(PYTHON) setup.py | ||
| UV = uv | ||
|
|
||
| .PHONY: build clean install publish source test venv | ||
|
|
||
| build: | ||
| $(SETUP) build | ||
| $(UV) build | ||
|
|
||
| clean: | ||
| $(SETUP) clean | ||
| rm -rf .tox .eggs *.egg-info build dist venv | ||
| rm -rf .tox .eggs *.egg-info build dist .venv | ||
| @find . -regex '.*\(__pycache__\|\.py[co]\)' -delete | ||
| $(MAKE) -C docs clean | ||
|
|
||
| install: | ||
| $(SETUP) install | ||
| $(UV) sync | ||
|
|
||
| publish: | ||
| rm -rf dist/ | ||
| $(SETUP) sdist | ||
| pip install twine | ||
| $(UV) build | ||
| $(UV) run pip install twine | ||
| twine upload dist/* | ||
|
|
||
| source: | ||
| $(SETUP) sdist | ||
| $(UV) build | ||
|
|
||
| test: | ||
| $(SETUP) check -r -s | ||
| tox | ||
| $(UV) run tox | ||
|
|
||
| venv: | ||
| $(PYTHON) -m virtualenv -p /usr/bin/$(PYTHON) venv | ||
| venv/bin/pip install -Ur requirements.txt | ||
| uv sync | ||
| @echo "Now run the following to activate the virtual env:" | ||
| @echo ". venv/bin/activate" | ||
| @echo ". .venv/bin/activate" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 1!11.1.0 | ||
| 1!11.1.1 |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we are pinning an older image stream commit for checkout. Can we either retain v7.0.0 or bump this to v7.0.1?