Skip to content

Commit e5cbaae

Browse files
authored
Merge branch 'main' into fix-issue-1427
2 parents 1cbbe1d + 94caa57 commit e5cbaae

10 files changed

Lines changed: 408 additions & 361 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,23 @@ It's people like *you* who make this project such a great tool for everyone.
4949

5050
First, **fork** the repository on GitHub and **clone** it using one of the alternatives that you can copy-paste by pressing the big green button labeled `<> Code`.
5151

52-
You can (and should) run our test suite using [*tox*](https://tox.wiki/).
52+
You can (and should) run our test suite using [*tox*](https://tox.wiki/) with the [*tox-uv*](https://github.com/tox-dev/tox-uv) plugin.
53+
The easiest way is to [install *uv*] which is needed in any case and then run `uv tool install --with tox-uv tox` to have it globally available or `uvx --with tox-uv tox` to use a temporary environment.
54+
55+
---
56+
5357
However, you'll probably want a more traditional environment as well.
5458

5559
We recommend using the Python version from the `.python-version-default` file in the project's root directory.
5660

57-
We use a fully-locked development environment using [*uv*](https://docs.astral.sh/uv/) so the easiest way to get started is to [install *uv*](https://docs.astral.sh/uv/getting-started/installation/) and you can run `uv run pytest` to run the tests immediately.
61+
We use a fully-locked development environment using [*uv*](https://docs.astral.sh/uv/) so the easiest way to get started is to [install *uv*] and you can run `uv run pytest` to run the tests immediately.
5862

59-
I you'd like a traditional virtual environment, you can run `uv sync` and it will create a virtual environment named `.venv` with the correct Python version and install all the dependencies in the root directory.
63+
I you'd like a traditional virtual environment, you can run `uv sync --python=$(cat .python-version-default)` and it will create a virtual environment named `.venv` with the correct Python version and install all the dependencies in the root directory.
6064

6165
If you're using [*direnv*](https://direnv.net), you can automate the creation and activation of the project's virtual environment with the correct Python version by adding the following `.envrc` to the project root:
6266

6367
```bash
64-
uv sync
68+
uv sync --python=$(cat .python-version-default)
6569
. .venv/bin/activate
6670
```
6771

@@ -264,3 +268,4 @@ By participating in this project you agree to abide by its terms.
264268
Please report any harm to Hynek Schlawack in any way you find appropriate.
265269

266270
[semantic newlines]: https://rhodesmill.org/brandon/2012/one-sentence-per-line/
271+
[install *uv*]: https://docs.astral.sh/uv/getting-started/installation/

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
fetch-depth: 0
2929
persist-credentials: false
3030

31-
- uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2.12.0
31+
- uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 # v2.13.0
3232
id: baipp
3333

3434
outputs:

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
persist-credentials: false
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
32+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
3333
with:
3434
languages: ${{ matrix.language }}
3535

3636
- name: Autobuild
37-
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
37+
uses: github/codeql-action/autobuild@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
40+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2

.github/workflows/pypi-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
fetch-depth: 0
2727
persist-credentials: false
2828

29-
- uses: hynek/build-and-inspect-python-package@b5076c307dc91924a82ad150cdd1533b444d3310 # v2.12.0
29+
- uses: hynek/build-and-inspect-python-package@c52c3a4710070b50470d903818a7b25115dcd076 # v2.13.0
3030
with:
3131
attest-build-provenance-github: 'true'
3232

.github/workflows/zizmor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131

3232
- name: Upload SARIF file
33-
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
33+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
3434
with:
3535
# Path to SARIF file relative to the root of the repository
3636
sarif_file: results.sarif

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: v0.12.0
7+
rev: v0.12.2
88
hooks:
99
- id: ruff-check
1010
args: [--fix, --exit-non-zero-on-fix]

pyproject.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,18 @@ Tidelift = "https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-att
3737

3838

3939
[dependency-groups]
40-
tests-mypy = [
41-
# A transitive dependency of pytest-mypy-plugins doesn't build on 3.14 yet.
42-
'pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10" and python_version < "3.14"',
43-
# Since the mypy error messages keep changing, we have to keep updating this
44-
# pin.
45-
'mypy>=1.11.1; platform_python_implementation == "CPython" and python_version >= "3.10"',
46-
]
40+
tests-mypy = ['pytest-mypy-plugins; platform_python_implementation == "CPython" and python_version >= "3.10"']
4741
tests = [
4842
{ include-group = "tests-mypy" },
4943
# For regression test to ensure cloudpickle compat doesn't break.
5044
'cloudpickle; platform_python_implementation == "CPython"',
5145
"hypothesis",
5246
"pympler",
53-
# 4.3.0 dropped last use of `convert`
54-
"pytest>=4.3.0",
47+
"pytest",
5548
]
5649
cov = [
5750
{ include-group = "tests" },
58-
# Ensure coverage is new enough for `source_pkgs`.
59-
"coverage[toml]>=5.3",
51+
"coverage[toml]",
6052
]
6153
pyright = ["pyright", { include-group = "tests" }]
6254
benchmark = [

tests/test_mypy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@
604604
parent: Optional[A]
605605
606606
reveal_type(A) # N: Revealed type is "def (parent: main.B) -> main.A"
607-
reveal_type(B) # N: Revealed type is "def (parent: Union[main.A, None]) -> main.B"
607+
reveal_type(B) # N: Revealed type is "def (parent: main.A | None) -> main.B"
608608
A(B(None))
609609
610610
- case: testAttrsForwardReferenceInClass
@@ -620,7 +620,7 @@
620620
parent: Optional[A]
621621
622622
reveal_type(A) # N: Revealed type is "def (parent: main.A.B) -> main.A"
623-
reveal_type(A.B) # N: Revealed type is "def (parent: Union[main.A, None]) -> main.A.B"
623+
reveal_type(A.B) # N: Revealed type is "def (parent: main.A | None) -> main.A.B"
624624
A(A.B(None))
625625
626626
- case: testAttrsImporting
@@ -739,7 +739,7 @@
739739
740740
AOrB = Union[A, B]
741741
742-
reveal_type(A) # N: Revealed type is "def (frob: builtins.list[Union[main.A, main.B]]) -> main.A"
742+
reveal_type(A) # N: Revealed type is "def (frob: builtins.list[main.A | main.B]) -> main.A"
743743
reveal_type(B) # N: Revealed type is "def () -> main.B"
744744
745745
A([B()])

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ commands =
3131
dependency_groups = tests
3232
commands = pytest tests/test_functional.py
3333

34-
[testenv:py3{9,10,13}-tests]
34+
[testenv:py3{9,10,14}-tests]
3535
dependency_groups = cov
3636
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
3737
# PYTHONWARNINGS=d makes them visible during the tox run.
3838
set_env =
3939
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
4040
PYTHONWARNINGS=d
41-
commands_pre = python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
4241
commands =
4342
coverage run -m pytest {posargs}
4443

0 commit comments

Comments
 (0)