Skip to content

Commit 2a98b2b

Browse files
committed
Tweaks
1 parent 4a516cf commit 2a98b2b

File tree

4 files changed

+20
-37
lines changed

4 files changed

+20
-37
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
FAST: ${{ startsWith(matrix.python-version, 'pypy') && '1' || '' }}
3333
run: |
34-
just cov ${{ startsWith(matrix.python-version, 'pypy') && matrix.python-version || format('python{0}', matrix.python-version) }}
34+
just --set python ${{ startsWith(matrix.python-version, 'pypy') && matrix.python-version || format('python{0}', matrix.python-version) }} cov
3535
3636
- name: Upload coverage data
3737
uses: actions/upload-artifact@v4
@@ -62,8 +62,8 @@ jobs:
6262
- name: "Combine coverage"
6363
run: |
6464
uv run --group test coverage combine
65-
uv run --group test coverage html
66-
uv run --group test coverage json
65+
uv run --group test coverage html
66+
uv run --group test coverage json
6767
6868
# Report and write to summary.
6969
uv run --group test coverage report --format=markdown >> $GITHUB_STEP_SUMMARY

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,27 @@ Ready to contribute? Here's how to set up _cattrs_ for local development.
5555
$ git clone [email protected]:your_name_here/cattrs.git
5656
```
5757

58-
3. Install your local copy into a virtualenv. Assuming you have [PDM](https://pdm.fming.dev/latest/) installed, this is how you set up your fork for local development::
58+
3. Install your local copy into a virtualenv. Assuming you have [uv](https://docs.astral.sh/uv/) installed, this is how you set up your fork for local development::
5959

6060
```shell
6161
$ cd cattrs/
62-
$ pdm install -d -G :all
62+
$ uv sync --all-groups --all-extras
6363
```
6464

6565
4. Create a branch for local development::
6666

6767
```shell
68-
$ git checkout -b name-of-your-bugfix-or-feature
68+
$ git switch -c name-of-your-bugfix-or-feature
6969
```
7070

7171
Now you can make your changes locally.
7272

73-
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
73+
5. When you're done making changes, check that your changes pass lints and the tests, including testing other Python versions::
7474

7575
```shell
7676
$ make lint
77-
$ make test
78-
$ tox
77+
$ just test
78+
$ just --set python python3.9 test # Test on other versions
7979
```
8080

8181
6. Commit your changes and push your branch to GitHub::
@@ -106,5 +106,5 @@ Before you submit a pull request, check that it meets these guidelines:
106106
To run a subset of tests:
107107

108108
```shell
109-
$ pdm run pytest tests.test_unstructure
109+
$ just test tests/test_unstructure.py
110110
```

Justfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
test python='':
2-
uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test pytest -x --ff -n auto tests/
1+
python := ""
32

4-
cov python='':
3+
lint:
4+
uv run -p python3.13 --group lint ruff check src/ tests bench
5+
uv run -p python3.13 --group lint black --check src tests docs/conf.py
6+
7+
test *args="-x --ff -n auto tests":
8+
uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test pytest {{args}}
9+
10+
cov *args="-x --ff -n auto tests":
511
@uv run {{ if python != '' { '-p ' + python } else { '' } }} python -c 'import pathlib, site; pathlib.Path(f"{site.getsitepackages()[0]}/cov.pth").write_text("import coverage; coverage.process_startup()")'
6-
COVERAGE_PROCESS_START={{justfile_directory()}}/pyproject.toml uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test coverage run -m pytest -x --ff -n auto tests/
12+
COVERAGE_PROCESS_START={{justfile_directory()}}/pyproject.toml uv run {{ if python != '' { '-p ' + python } else { '' } }} --all-extras --group test coverage run -m pytest {{args}}

Makefile

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,6 @@ clean-pyc: ## remove Python file artifacts
4242
find . -name '*~' -exec rm -f {} +
4343
find . -name '__pycache__' -exec rm -fr {} +
4444

45-
clean-test: ## remove test and coverage artifacts
46-
rm -fr .tox/
47-
rm -f .coverage
48-
rm -fr htmlcov/
49-
50-
lint: ## check style with ruff and black
51-
pdm run ruff check src/ tests bench
52-
pdm run black --check src tests docs/conf.py
53-
54-
test: ## run tests quickly with the default Python
55-
pdm run pytest -x --ff -n auto tests
56-
57-
58-
test-all: ## run tests on every Python version with tox
59-
tox
60-
61-
coverage: ## check code coverage quickly with the default Python
62-
pdm run coverage run --source cattrs -m pytest -n auto tests
63-
64-
pdm run coverage report -m
65-
pdm run coverage html
66-
$(BROWSER) htmlcov/index.html
67-
6845
docs: ## generate Sphinx HTML documentation, including API docs
6946
$(MAKE) -C docs clean
7047
$(MAKE) -C docs doctest

0 commit comments

Comments
 (0)