Skip to content

Commit

Permalink
chore: Faster and better working dependency resolution with uv
Browse files Browse the repository at this point in the history
Switch from pdm to uv for development, since the resolution seems to
work better with uv, with salt and pyzmq versions often breaking.
  • Loading branch information
jgraichen committed Sep 23, 2024
1 parent 20be10f commit 6c353da
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
27 changes: 18 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,37 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- uses: astral-sh/setup-uv@v2
with:
enable-cache: True
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: pdm install --dev --no-self --no-default
- run: pdm run tox -e py3-salt${{ matrix.salt }} -- -vv
- run: uv sync --all-extras --dev
- run: uv run tox -e py3-salt${{ matrix.salt }} -- -vv

ruff-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- uses: astral-sh/setup-uv@v2
with:
enable-cache: True
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pdm install --dev --no-self --no-default
- run: pdm run ruff check --no-fix --diff
- run: uv sync --dev
- run: uv run ruff check --no-fix --diff

ruff-format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- uses: astral-sh/setup-uv@v2
with:
enable-cache: True
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pdm install --dev --no-self --no-default
- run: pdm run ruff format --diff --check
- run: uv sync --dev
- run: uv run ruff format --diff --check
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
25 changes: 11 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pillar_dirs = "salt_tower.loader:pillar_dirs"
render_dirs = "salt_tower.loader:renderers_dirs"

[project.optional-dependencies]
test = ["pylint==3.2.7", "pytest==8.3.3"]
test = ["pylint==3.3.0", "pytest==8.3.3"]
docs = [
"mike==2.1.3",
"mkdocs-awesome-pages-plugin==2.9.3",
Expand All @@ -37,19 +37,6 @@ docs = [
requires = ["pdm-pep517>=1.0"]
build-backend = "pdm.pep517.api"

[tool.pdm.dev-dependencies]
dev = [
"mypy==1.11.2",
"pylint==3.2.7",
"pyright>=1.1.356",
"pytest==8.3.3",
"ruff==0.6.7",
"tox==4.20.0",
]

[tool.pdm.resolution.overrides]
pyzmq = "~=25.1" # 25.0.2 does not compile on 24.04 anymore

[tool.pyright]
include = ["salt_tower", "test"]
exclude = ["test/fixtures"]
Expand All @@ -65,3 +52,13 @@ docstring-code-format = true

[tool.ruff.lint]
extend-select = ["I"]

[tool.uv]
dev-dependencies = [
"mypy==1.11.2",
"pylint==3.3.0",
"pyright>=1.1.356",
"pytest==8.3.3",
"ruff==0.6.5",
"tox==4.18.1",
]
2 changes: 1 addition & 1 deletion salt_tower/pillar/tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _load_file(self, file, base=None):

self.update(data, merge=True)

def _compile( # pylint: disable=too-many-arguments
def _compile( # pylint: disable=too-many-arguments,too-many-positional-arguments
self,
template,
default=None,
Expand Down

0 comments on commit 6c353da

Please sign in to comment.