Skip to content

Commit e28bd9f

Browse files
dependency groups, uv and pytest-timeout
1 parent 3b34ae2 commit e28bd9f

File tree

4 files changed

+58
-26
lines changed

4 files changed

+58
-26
lines changed

.github/workflows/python-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
with:
5252
python-version: ${{ matrix.python_version }}
5353
architecture: x64
54+
- name: Install the latest version of uv
55+
uses: astral-sh/setup-uv@v6
5456
- name: Setup MSYS2
5557
uses: msys2/setup-msys2@v2
5658
if: matrix.python_version == 'msys2'
@@ -81,13 +83,13 @@ jobs:
8183
echo "C:\Program Files (x86)\gnupg\bin" >> $env:GITHUB_PATH
8284
git config --system gpg.program "C:\Program Files (x86)\gnupg\bin\gpg.exe"
8385
if: runner.os == 'Windows'
84-
- run: pip install -U 'setuptools>=61'
86+
- run: uv sync
8587
- uses: actions/download-artifact@v4
8688
with:
8789
name: Packages
8890
path: dist
8991
- shell: bash
90-
run: pip install "$(echo -n dist/*whl)[toml,test]"
92+
run: uv pip install "$(echo -n dist/*whl)"
9193
- run: |
9294
$(hg debuginstall --template "{pythonexe}") -m pip install hg-git --user
9395
if: matrix.os == 'ubuntu-latest'

pyproject.toml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ dependencies = [
4848
'typing-extensions; python_version < "3.10"',
4949
]
5050
[project.optional-dependencies]
51+
rich = [
52+
"rich",
53+
]
54+
toml = [
55+
]
56+
57+
[dependency-groups]
5158
docs = [
5259
#"entangled-cli~=2.0",
5360
"mkdocs",
@@ -57,21 +64,17 @@ docs = [
5764
"mkdocstrings[python]",
5865
"pygments",
5966
]
60-
rich = [
61-
"rich",
62-
]
6367
test = [
6468
"pip",
6569
"build",
6670
"pytest",
71+
"pytest-timeout", # Timeout protection for CI/CD
6772
"rich",
6873
'typing-extensions; python_version < "3.11"',
6974
"wheel",
7075
"griffe",
7176
"flake8",
7277
]
73-
toml = [
74-
]
7578

7679
[project.urls]
7780
documentation = "https://setuptools-scm.readthedocs.io/"
@@ -152,6 +155,7 @@ ignore = ["PP305", "GH103", "GH212", "MY100", "PC111", "PC160", "PC170", "PC180"
152155
[tool.pytest.ini_options]
153156
minversion = "8"
154157
testpaths = ["testing"]
158+
timeout = 300 # 5 minutes timeout per test for CI protection
155159
filterwarnings = [
156160
"error",
157161
"ignore:.*tool\\.setuptools_scm.*",
@@ -165,3 +169,6 @@ markers = [
165169
"issue(id): reference to github issue",
166170
"skip_commit: allows to skip committing in the helpers",
167171
]
172+
173+
[tool.uv]
174+
default-groups = ["test", "docs"]

testing/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def test_distribution_provides_extras() -> None:
388388

389389
dist = distribution("setuptools_scm")
390390
pe: list[str] = dist.metadata.get_all("Provides-Extra", [])
391-
assert sorted(pe) == ["docs", "rich", "test", "toml"]
391+
assert sorted(pe) == ["rich", "toml"]
392392

393393

394394
@pytest.mark.issue(760)

uv.lock

Lines changed: 41 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)