@@ -17,34 +17,22 @@ cd python-package-template
1717
1818## Install
1919
20- Install [ Python ] ( https://www.python.org / ) :
20+ Install [ uv ] ( https://docs.astral.sh/uv / ) :
2121
2222``` sh
23- brew install python
23+ curl -LsSf https://astral.sh/uv/ install.sh | sh
2424```
2525
26- Create the virtual environment :
26+ Install with development dependencies :
2727
2828``` sh
29- python3 -m venv .venv
30- ```
31-
32- Activate the virtual environment:
33-
34- ``` sh
35- source .venv/bin/activate
36- ```
37-
38- Install the dependencies:
39-
40- ``` sh
41- pip install -e ' .[build,docs,lint,test]'
29+ uv sync --all-extras
4230```
4331
4432Install pre-commit into your git hooks:
4533
4634``` sh
47- pre-commit install
35+ uv run pre-commit install
4836```
4937
5038## Develop
@@ -74,104 +62,80 @@ Things that will improve the chance that your pull request will be accepted:
7462
7563## Test
7664
77- Install the dependencies:
78-
79- ``` sh
80- pip install -e ' .[test]'
81- ```
82-
8365Run the tests:
8466
8567``` sh
86- pytest
68+ uv run pytest
8769```
8870
8971Run the tests with [ coverage] ( https://coverage.readthedocs.io/ ) :
9072
9173``` sh
92- coverage run -m pytest
74+ uv run coverage run -m pytest
9375```
9476
9577Generate a coverage report:
9678
9779``` sh
98- coverage report
80+ uv run coverage report
9981```
10082
10183``` sh
102- coverage html
84+ uv run coverage html
10385```
10486
10587## Lint
10688
107- Install the dependencies:
108-
109- ``` sh
110- pip install -e ' .[lint]'
111- ```
112-
11389Update pre-commit hooks to the latest version:
11490
11591``` sh
116- pre-commit autoupdate
92+ uv run pre-commit autoupdate
11793```
11894
11995Run all pre-commit hooks:
12096
12197``` sh
122- pre-commit run --all-files
98+ uv run pre-commit run --all-files
12399```
124100
125101Lint all files in the current directory:
126102
127103``` sh
128- ruff check
104+ uv run ruff check --fix
129105```
130106
131107Format all files in the current directory:
132108
133109``` sh
134- ruff format
110+ uv run ruff format
135111```
136112
137113## Build
138114
139- Install the dependencies:
140-
141- ``` sh
142- pip install -e ' .[build]'
143- ```
144-
145115Generate distribution packages:
146116
147117``` sh
148- python3 -m build
118+ uv build
149119```
150120
151121Upload all of the archives under ` dist ` :
152122
153123``` sh
154- twine upload --repository testpypi dist/ *
124+ uv publish --publish-url https://test.pypi.org/legacy/
155125```
156126
157127Install the package:
158128
159129``` sh
160- pip install --index-url https://test.pypi.org/simple/ --no-deps python-package-template
130+ uv add --index-url https://test.pypi.org/simple/ --no-deps python-package-template
161131```
162132
163133## Docs
164134
165- Install the dependencies:
166-
167- ``` sh
168- pip install -e ' .[docs]'
169- ```
170-
171135Generate the docs with [ pdoc] ( https://pdoc.dev/ ) :
172136
173137``` sh
174- pdoc src/python_package_template/
138+ uv run pdoc src/python_package_template/
175139```
176140
177141## Release
0 commit comments