@@ -17,34 +17,22 @@ cd python-cli-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+ brew install uv
2424```
2525
26- Create the virtual environment :
26+ Install 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,38 +62,38 @@ Things that will improve the chance that your pull request will be accepted:
7462
7563## Test
7664
77- Install the dependencies:
65+ Install test dependencies:
7866
7967``` sh
80- pip install -e ' .[ test] '
68+ uv sync --extra test
8169```
8270
8371Run the tests:
8472
8573``` sh
86- pytest
74+ uv run pytest
8775```
8876
8977Run the tests with [ coverage] ( https://coverage.readthedocs.io/ ) :
9078
9179``` sh
92- coverage run -m pytest
80+ uv run coverage run -m pytest
9381```
9482
9583Generate a coverage report:
9684
9785``` sh
98- coverage report
86+ uv run coverage report
9987```
10088
10189``` sh
102- coverage html
90+ uv run coverage html
10391```
10492
105- Install the package with [ pipx ] ( https://pipx.pypa.io / ) :
93+ Install the package with [ uv ] ( https://docs.astral.sh/uv / ) :
10694
10795``` sh
108- pipx install . --force
96+ uv tool install . --force
10997```
11098
11199Test the command:
@@ -116,80 +104,88 @@ python-cli-template --help
116104
117105## Lint
118106
119- Install the dependencies:
107+ Install lint dependencies:
120108
121109``` sh
122- pip install -e ' .[ lint] '
110+ uv sync --extra lint
123111```
124112
125113Update pre-commit hooks to the latest version:
126114
127115``` sh
128- pre-commit autoupdate
116+ uv run pre-commit autoupdate
129117```
130118
131119Run all pre-commit hooks:
132120
133121``` sh
134- pre-commit run --all-files
122+ uv run pre-commit run --all-files
123+ ```
124+
125+ Lint all files:
126+
127+ ``` sh
128+ uv run ruff check # --fix
135129```
136130
137- Lint all files in the current directory :
131+ Format all files:
138132
139133``` sh
140- ruff check
134+ uv run ruff format
141135```
142136
143- Format all files in the current directory:
137+ ## Run
138+
139+ Run the CLI:
144140
145141``` sh
146- ruff format
142+ uv run python-cli-template
147143```
148144
149145## Build
150146
151- Install the dependencies:
147+ Install build dependencies:
152148
153149``` sh
154- pip install -e ' .[ build] '
150+ uv sync --extra build
155151```
156152
157153Generate the distribution packages:
158154
159155``` sh
160- python3 -m build
156+ uv build
161157```
162158
163159Upload all of the archives under ` dist ` :
164160
165161``` sh
166- twine upload --repository testpypi dist/ *
162+ uv publish --repository testpypi
167163```
168164
169165Install the package:
170166
171167``` sh
172- pip install --index-url https://test.pypi.org/simple/ --no-deps python-cli-template
168+ uv tool install --index-url testpypi python-cli-template
173169```
174170
175171Bundle the package with [ PyInstaller] ( https://pyinstaller.org/ ) :
176172
177173``` sh
178- pyinstaller src/python-cli-template/cli.py --name python-cli-template
174+ uv run pyinstaller python_cli_template.cli --name python-cli-template
179175```
180176
181177## Docs
182178
183- Install the dependencies:
179+ Install docs dependencies:
184180
185181``` sh
186- pip install -e ' .[ docs] '
182+ uv sync --extra docs
187183```
188184
189185Generate the docs with [ pdoc] ( https://pdoc.dev/ ) :
190186
191187``` sh
192- pdoc src/python_cli_template/
188+ uv run pdoc src/python_cli_template/
193189```
194190
195191## Release
0 commit comments