Skip to content

Commit f071d5d

Browse files
committed
chore: Switch to Copier UV template
1 parent 1a6955f commit f071d5d

23 files changed

Lines changed: 447 additions & 321 deletions

.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.git
2+
_commit: 1.0.8
3+
_src_path: gh:pawamoy/copier-uv
44
author_email: dev@pawamoy.fr
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
@@ -15,6 +15,7 @@ env:
1515
LC_ALL: en_US.utf-8
1616
PYTHONIOENCODING: UTF-8
1717
PYTHONPATH: docs
18+
PYTHON_VERSIONS: ""
1819

1920
jobs:
2021

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

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

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

4041
- name: Install dependencies
41-
run: pdm install -G ci-quality
42+
run: make setup
4243

4344
- name: Check if the documentation builds correctly
44-
run: pdm run duty check-docs
45+
run: make check-docs
4546

4647
- name: Check the code quality
47-
run: pdm run duty check-quality
48+
run: make check-quality
4849

4950
- name: Check if the code is correctly typed
50-
run: pdm run duty check-types
51+
run: make check-types
5152

5253
- name: Check for vulnerabilities in dependencies
53-
run: pdm run duty check-dependencies
54+
run: make check-dependencies
5455

5556
- name: Check for breaking changes in the API
56-
run: pdm run duty check-api
57+
run: make check-api
5758

5859
exclude-test-jobs:
5960
runs-on: ubuntu-latest
@@ -79,7 +80,6 @@ jobs:
7980

8081
needs: exclude-test-jobs
8182
strategy:
82-
max-parallel: 4
8383
matrix:
8484
os:
8585
- ubuntu-latest
@@ -99,17 +99,20 @@ jobs:
9999
- name: Checkout
100100
uses: actions/checkout@v4
101101

102-
- name: Set up PDM
103-
uses: pdm-project/setup-pdm@v4
102+
- name: Set up Python
103+
uses: actions/setup-python@v5
104104
with:
105105
python-version: ${{ matrix.python-version }}
106-
allow-python-prereleases: true
106+
allow-prereleases: true
107107

108-
- name: Resolving dependencies
109-
run: pdm lock -v --no-cross-platform -G ci-tests
108+
- name: Install uv
109+
run: pip install uv
110110

111111
- name: Install dependencies
112-
run: pdm install --no-editable -G ci-tests
112+
run: |
113+
uv venv
114+
uv pip install -r devdeps.txt
115+
uv pip install "mkdocstrings @ ."
113116
114117
- name: Run the test suite
115-
run: pdm run duty test
118+
run: make test

.gitignore

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ htmlcov/
99
.coverage*
1010
pip-wheel-metadata/
1111
.pytest_cache/
12-
.python-version
13-
site/
14-
pdm.lock
15-
pdm.toml
16-
.pdm-plugins/
17-
.pdm-python
18-
__pypackages__/
1912
.mypy_cache/
13+
.ruff_cache/
14+
site/
2015
.venv/
16+
.venvs/
2117
.cache/

.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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ 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
@@ -39,13 +39,13 @@ Run `make help` to see all the available actions!
3939
This project uses [duty](https://github.com/pawamoy/duty) to run tasks.
4040
A Makefile is also provided. The Makefile will try to run certain tasks
4141
on multiple Python versions. If for some reason you don't want to run the task
42-
on multiple Python versions, you run the task directly with `pdm run duty TASK`.
42+
on multiple Python versions, you run the task directly with `make run duty TASK`.
4343
4444
The Makefile detects if a virtual environment is activated,
4545
so `make` will work the same with the virtualenv activated or not.
4646
4747
If you work in VSCode, we provide
48-
[an action to configure VSCode](https://pawamoy.github.io/copier-pdm/work/#vscode-setup)
48+
[an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup)
4949
for the project.
5050
5151
## Development

Makefile

Lines changed: 15 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +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-
13-
BASIC_DUTIES = \
5+
actions = \
146
changelog \
7+
check \
158
check-api \
169
check-dependencies \
10+
check-docs \
11+
check-quality \
12+
check-types \
1713
clean \
1814
coverage \
1915
docs \
2016
docs-deploy \
2117
format \
18+
help \
2219
release \
20+
run \
21+
setup \
22+
test \
2323
vscode
2424

25-
QUALITY_DUTIES = \
26-
check-quality \
27-
check-docs \
28-
check-types \
29-
test
30-
31-
.PHONY: help
32-
help:
33-
@$(DUTY) --list
34-
35-
.PHONY: lock
36-
lock:
37-
@pdm lock --dev
38-
39-
.PHONY: setup
40-
setup:
41-
@bash scripts/setup.sh
42-
43-
.PHONY: check
44-
check:
45-
@pdm multirun duty check-quality check-types check-docs
46-
@$(DUTY) check-dependencies check-api
47-
48-
.PHONY: $(BASIC_DUTIES)
49-
$(BASIC_DUTIES):
50-
@$(DUTY) $@ $(call args,$@)
51-
52-
.PHONY: $(QUALITY_DUTIES)
53-
$(QUALITY_DUTIES):
54-
@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
ignore_errors = True

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

0 commit comments

Comments
 (0)