Skip to content

Commit c29585a

Browse files
committed
chore: Switch to Copier UV template
1 parent e1216aa commit c29585a

23 files changed

+446
-320
lines changed

.copier-answers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 1.2.6
3-
_src_path: gh:pawamoy/copier-pdm
2+
_commit: 1.0.8
3+
_src_path: gh:pawamoy/copier-uv
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli
66
author_username: pawamoy

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PATH_add scripts

.github/workflows/ci.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
LANG: en_US.utf-8
1515
LC_ALL: en_US.utf-8
1616
PYTHONIOENCODING: UTF-8
17+
PYTHON_VERSIONS: ""
1718

1819
jobs:
1920

@@ -28,31 +29,31 @@ jobs:
2829
- name: Fetch all tags
2930
run: git fetch --depth=1 --tags
3031

31-
- name: Set up PDM
32-
uses: pdm-project/setup-pdm@v4
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
3334
with:
34-
python-version: "3.8"
35+
python-version: "3.11"
3536

36-
- name: Resolving dependencies
37-
run: pdm lock -v --no-cross-platform -G ci-quality
37+
- name: Install uv
38+
run: pip install uv
3839

3940
- name: Install dependencies
40-
run: pdm install -G ci-quality
41+
run: make setup
4142

4243
- name: Check if the documentation builds correctly
43-
run: pdm run duty check-docs
44+
run: make check-docs
4445

4546
- name: Check the code quality
46-
run: pdm run duty check-quality
47+
run: make check-quality
4748

4849
- name: Check if the code is correctly typed
49-
run: pdm run duty check-types
50+
run: make check-types
5051

5152
- name: Check for vulnerabilities in dependencies
52-
run: pdm run duty check-dependencies
53+
run: make check-dependencies
5354

5455
- name: Check for breaking changes in the API
55-
run: pdm run duty check-api
56+
run: make check-api
5657

5758
exclude-test-jobs:
5859
runs-on: ubuntu-latest
@@ -78,7 +79,6 @@ jobs:
7879

7980
needs: exclude-test-jobs
8081
strategy:
81-
max-parallel: 4
8282
matrix:
8383
os:
8484
- ubuntu-latest
@@ -101,17 +101,20 @@ jobs:
101101
- name: Fetch all tags
102102
run: git fetch --depth=1 --tags
103103

104-
- name: Set up PDM
105-
uses: pdm-project/setup-pdm@v4
104+
- name: Set up Python
105+
uses: actions/setup-python@v5
106106
with:
107107
python-version: ${{ matrix.python-version }}
108-
allow-python-prereleases: true
108+
allow-prereleases: true
109109

110-
- name: Resolving dependencies
111-
run: pdm lock -v --no-cross-platform -G ci-tests
110+
- name: Install uv
111+
run: pip install uv
112112

113113
- name: Install dependencies
114-
run: pdm install --no-editable -G ci-tests
114+
run: |
115+
uv venv
116+
uv pip install -r devdeps.txt
117+
uv pip install "griffe @ ."
115118
116119
- name: Run the test suite
117-
run: pdm run duty test
120+
run: make test

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ htmlcov/
1010
pip-wheel-metadata/
1111
.pytest_cache/
1212
.mypy_cache/
13+
.ruff_cache/
1314
site/
14-
pdm.lock
15-
pdm.toml
16-
.pdm-plugins/
17-
.pdm-python
18-
__pypackages__/
1915
.venv/
16+
.venvs/
2017
.cache/
2118
profile.pstats
2219
profile.svg

.gitpod.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ FROM gitpod/workspace-full
22
USER gitpod
33
ENV PIP_USER=no
44
RUN pip3 install pipx; \
5-
pipx install pdm; \
5+
pipx install uv; \
66
pipx ensurepath

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@ make setup
1717
> NOTE:
1818
> If it fails for some reason,
1919
> you'll need to install
20-
> [PDM](https://github.com/pdm-project/pdm)
20+
> [uv](https://github.com/astral-sh/uv)
2121
> manually.
2222
>
2323
> You can install it with:
2424
>
2525
> ```bash
2626
> python3 -m pip install --user pipx
27-
> pipx install pdm
27+
> pipx install uv
2828
> ```
2929
>
3030
> Now you can try running `make setup` again,
31-
> or simply `pdm install`.
31+
> or simply `uv install`.
3232
3333
You now have the dependencies installed.
3434
35-
You can run the application with `pdm run griffe [ARGS...]`.
35+
You can run the application with `make run griffe [ARGS...]`.
3636
3737
Run `make help` to see all the available actions!
3838
@@ -41,13 +41,13 @@ Run `make help` to see all the available actions!
4141
This project uses [duty](https://github.com/pawamoy/duty) to run tasks.
4242
A Makefile is also provided. The Makefile will try to run certain tasks
4343
on multiple Python versions. If for some reason you don't want to run the task
44-
on multiple Python versions, you run the task directly with `pdm run duty TASK`.
44+
on multiple Python versions, you run the task directly with `make run duty TASK`.
4545
4646
The Makefile detects if a virtual environment is activated,
4747
so `make` will work the same with the virtualenv activated or not.
4848
4949
If you work in VSCode, we provide
50-
[an action to configure VSCode](https://pawamoy.github.io/copier-pdm/work/#vscode-setup)
50+
[an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup)
5151
for the project.
5252
5353
## Development

Makefile

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,27 @@
1-
.DEFAULT_GOAL := help
2-
SHELL := bash
3-
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty
4-
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11 3.12
5-
export PDM_MULTIRUN_USE_VENVS ?= $(if $(shell pdm config python.use_venv | grep True),1,0)
1+
# If you have `direnv` loaded in your shell, and allow it in the repository,
2+
# the `make` command will point at the `scripts/make` shell script.
3+
# This Makefile is just here to allow auto-completion in the terminal.
64

7-
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
8-
check_quality_args = files
9-
docs_args = host port
10-
release_args = version
11-
test_args = match
12-
fuzz_args = seeds min_seed max_seed size
13-
14-
BASIC_DUTIES = \
5+
actions = \
156
changelog \
7+
check \
168
check-api \
179
check-dependencies \
10+
check-docs \
11+
check-quality \
12+
check-types \
1813
clean \
1914
coverage \
2015
docs \
2116
docs-deploy \
2217
format \
18+
help \
2319
release \
24-
fuzz \
20+
run \
21+
setup \
22+
test \
2523
vscode
2624

27-
QUALITY_DUTIES = \
28-
check-quality \
29-
check-docs \
30-
check-types \
31-
test
32-
33-
.PHONY: help
34-
help:
35-
@$(DUTY) --list
36-
37-
.PHONY: lock
38-
lock:
39-
@pdm lock -G:all
40-
41-
.PHONY: setup
42-
setup:
43-
@bash scripts/setup.sh
44-
45-
.PHONY: check
46-
check:
47-
@pdm multirun duty check-quality check-types check-docs
48-
@$(DUTY) check-dependencies check-api
49-
50-
.PHONY: $(BASIC_DUTIES)
51-
$(BASIC_DUTIES):
52-
@$(DUTY) $@ $(call args,$@)
53-
54-
.PHONY: $(QUALITY_DUTIES)
55-
$(QUALITY_DUTIES):
56-
@pdm multirun duty $@ $(call args,$@)
25+
.PHONY: $(actions)
26+
$(actions):
27+
@bash scripts/make "$@"

config/black.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

config/coverage.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ source =
88
[coverage:paths]
99
equivalent =
1010
src/
11-
__pypackages__/
11+
.venv/lib/*/site-packages/
12+
.venvs/*/lib/*/site-packages/
1213

1314
[coverage:report]
1415
precision = 2

config/pytest.ini

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
[pytest]
2-
norecursedirs =
3-
.git
4-
.tox
5-
.env
6-
dist
7-
build
82
python_files =
93
test_*.py
104
*_test.py

config/ruff.toml

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,27 @@
11
target-version = "py38"
22
line-length = 120
3+
4+
[lint]
35
exclude = [
4-
"fixtures",
6+
"tests/fixtures/*.py",
57
"site",
68
]
79
select = [
8-
"A",
9-
"ANN",
10-
"ARG",
11-
"B",
12-
"BLE",
13-
"C",
14-
"C4",
10+
"A", "ANN", "ARG",
11+
"B", "BLE",
12+
"C", "C4",
1513
"COM",
16-
"D",
17-
"DTZ",
18-
"E",
19-
"ERA",
20-
"EXE",
21-
"F",
22-
"FBT",
14+
"D", "DTZ",
15+
"E", "ERA", "EXE",
16+
"F", "FBT",
2317
"G",
24-
"I",
25-
"ICN",
26-
"INP",
27-
"ISC",
18+
"I", "ICN", "INP", "ISC",
2819
"N",
29-
"PGH",
30-
"PIE",
31-
"PL",
32-
"PLC",
33-
"PLE",
34-
"PLR",
35-
"PLW",
36-
"PT",
37-
"PYI",
20+
"PGH", "PIE", "PL", "PLC", "PLE", "PLR", "PLW", "PT", "PYI",
3821
"Q",
39-
"RUF",
40-
"RSE",
41-
"RET",
42-
"S",
43-
"SIM",
44-
"SLF",
45-
"T",
46-
"T10",
47-
"T20",
48-
"TCH",
49-
"TID",
50-
"TRY",
22+
"RUF", "RSE", "RET",
23+
"S", "SIM", "SLF",
24+
"T", "T10", "T20", "TCH", "TID", "TRY",
5125
"UP",
5226
"W",
5327
"YTT",
@@ -73,7 +47,7 @@ ignore = [
7347
"TRY003", # Avoid specifying long messages outside the exception class
7448
]
7549

76-
[per-file-ignores]
50+
[lint.per-file-ignores]
7751
"src/*/cli.py" = [
7852
"T201", # Print statement
7953
]
@@ -104,16 +78,16 @@ ignore = [
10478
"S101", # Use of assert detected
10579
]
10680

107-
[flake8-quotes]
81+
[lint.flake8-quotes]
10882
docstring-quotes = "double"
10983

110-
[flake8-tidy-imports]
84+
[lint.flake8-tidy-imports]
11185
ban-relative-imports = "all"
11286

113-
[isort]
87+
[lint.isort]
11488
known-first-party = ["griffe"]
11589

116-
[pydocstyle]
90+
[lint.pydocstyle]
11791
convention = "google"
11892

11993
[format]

config/vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@
99
"console": "integratedTerminal",
1010
"justMyCode": false
1111
},
12+
{
13+
"name": "docs",
14+
"type": "debugpy",
15+
"request": "launch",
16+
"module": "mkdocs",
17+
"justMyCode": false,
18+
"args": [
19+
"serve",
20+
"-v"
21+
]
22+
},
1223
{
1324
"name": "test",
1425
"type": "debugpy",

0 commit comments

Comments
 (0)