Skip to content

Commit 1071b14

Browse files
committed
chore: Switch to Copier UV template
1 parent 4c10609 commit 1071b14

26 files changed

+576
-497
lines changed

.copier-answers.yml

+2-2
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.2.8
3+
_src_path: gh:pawamoy/copier-uv
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli
66
author_username: pawamoy

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PATH_add scripts

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
github: pawamoy
22
ko_fi: pawamoy
3+
polar: pawamoy
34
custom:
45
- https://www.paypal.me/pawamoy

.github/workflows/ci.yml

+30-22
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,36 +29,32 @@ 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-
51-
- name: Check for vulnerabilities in dependencies
52-
run: pdm run duty check-dependencies
50+
run: make check-types
5351

5452
- name: Check for breaking changes in the API
55-
run: pdm run duty check-api
53+
run: make check-api
5654

5755
tests:
5856

5957
strategy:
60-
max-parallel: 4
6158
matrix:
6259
os:
6360
- ubuntu-latest
@@ -69,8 +66,17 @@ jobs:
6966
- "3.10"
7067
- "3.11"
7168
- "3.12"
69+
- "3.13"
70+
resolution:
71+
- highest
72+
- lowest-direct
73+
exclude:
74+
- os: macos-latest
75+
resolution: lowest-direct
76+
- os: windows-latest
77+
resolution: lowest-direct
7278
runs-on: ${{ matrix.os }}
73-
continue-on-error: ${{ matrix.python-version == '3.12' || matrix.os == 'windows-latest' }}
79+
continue-on-error: ${{ matrix.python-version == '3.13' || matrix.os == 'windows-latest' }}
7480

7581
steps:
7682
- name: Install aria2 on Ubuntu
@@ -90,17 +96,19 @@ jobs:
9096
- name: Checkout
9197
uses: actions/checkout@v4
9298

93-
- name: Set up PDM
94-
uses: pdm-project/setup-pdm@v4
99+
- name: Set up Python
100+
uses: actions/setup-python@v5
95101
with:
96102
python-version: ${{ matrix.python-version }}
97-
allow-python-prereleases: true
103+
allow-prereleases: true
98104

99-
- name: Resolving dependencies
100-
run: pdm lock -v --no-cross-platform -G ci-tests -G tui
105+
- name: Install uv
106+
run: pip install uv
101107

102108
- name: Install dependencies
103-
run: pdm install --no-editable -G ci-tests -G tui
109+
env:
110+
UV_RESOLUTION: ${{ matrix.resolution }}
111+
run: make setup
104112

105113
- name: Run the test suite
106-
run: pdm run duty test
114+
run: make test

.gitignore

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1+
# editors
12
.idea/
23
.vscode/
3-
__pycache__/
4-
*.py[cod]
5-
dist/
4+
5+
# python
66
*.egg-info/
7-
build/
8-
htmlcov/
7+
*.py[cod]
8+
.venv/
9+
.venvs/
10+
/build/
11+
/dist/
12+
13+
# tools
914
.coverage*
15+
/.pdm-build/
16+
/htmlcov/
17+
/site/
18+
19+
# cache
20+
.cache/
21+
.pytest_cache/
22+
.mypy_cache/
23+
.ruff_cache/
24+
__pycache__/
25+
26+
# project
1027
tests/tmp/*
1128
tests/logs/
1229
!tests/tmp/.gitkeep
13-
pip-wheel-metadata/
14-
.pytest_cache/
1530
*.spec
16-
.python-version
17-
site/
1831
demo.gif
19-
.mypy_cache/
20-
*.sw[po]
21-
pdm.lock
22-
pdm.toml
23-
.pdm-plugins/
24-
.pdm-python
25-
__pypackages__/
26-
.venv/
2732
.ports.json
28-
.cache/

.gitpod.dockerfile

+1-1
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

+6-6
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 aria2p [ARGS...]`.
35+
You can run the application with `make run aria2p [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

+17-44
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,28 @@
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 cpus cov verbose sugar markers extra_args
12-
13-
BASIC_DUTIES = \
14-
bundle \
5+
actions = \
6+
allrun \
157
changelog \
8+
check \
169
check-api \
17-
check-dependencies \
10+
check-docs \
11+
check-quality \
12+
check-types \
1813
clean \
1914
coverage \
2015
docs \
2116
docs-deploy \
2217
format \
18+
help \
19+
multirun \
2320
release \
21+
run \
22+
setup \
23+
test \
2424
vscode
2525

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

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ IMPORTANT: This file is generated from the template at 'scripts/templates/README
55

66
# aria2p
77
[![ci](https://github.com/pawamoy/aria2p/workflows/ci/badge.svg)](https://github.com/pawamoy/aria2p/actions?query=workflow%3Aci)
8-
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://pawamoy.github.io/aria2p/)
8+
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://pawamoy.github.io/aria2p/)
99
[![pypi version](https://img.shields.io/pypi/v/aria2p.svg)](https://pypi.org/project/aria2p/)
10-
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/aria2p)
10+
[![gitpod](https://img.shields.io/badge/gitpod-workspace-708FCC.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/aria2p)
1111
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#aria2p:gitter.im)
1212

1313
Command-line tool and Python library to interact with an [`aria2c`][1] daemon process through JSON-RPC.

config/black.toml

-3
This file was deleted.

config/coverage.ini

+2-1
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/git-changelog.toml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ parse-refs = false
66
parse-trailers = true
77
sections = ["build", "deps", "feat", "fix", "refactor"]
88
template = "keepachangelog"
9+
versioning = "pep440"

config/pytest.ini

-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
[pytest]
2-
norecursedirs =
3-
.git
4-
.tox
5-
.env
6-
dist
7-
build
82
python_files =
93
test_*.py
10-
*_test.py
11-
tests.py
124
addopts =
135
--cov
146
--cov-append

0 commit comments

Comments
 (0)