@@ -138,35 +138,23 @@ This section describes how to make a release in 3 parts:
138138
139139### (2/3) PyPI
140140
141- In a new terminal, without an activated virtual environment or an env directory :
141+ In a new terminal:
142142
143143``` shell
144- # prepare a new directory
144+ # OPTIONAL: prepare a new directory with fresh git clone to ensure the release
145+ # has the state of origin/main branch
145146cd $( mktemp -d {{ cookiecutter.package_name }}.XXXXXX)
146-
147- # fresh git clone ensures the release has the state of origin/main branch
148147git clone {{ cookiecutter.repository }} .
149148
150- # prepare a clean virtual environment and activate it
151- python -m venv env
152- source env/bin/activate
153-
154- # make sure to have a recent version of pip and setuptools
155- python -m pip install --upgrade pip setuptools
156-
157- # install runtime dependencies and publishing dependencies
158- python -m pip install --no-cache-dir .
159- python -m pip install --no-cache-dir .[publishing]
160-
161- # clean up any previously generated artefacts
162- rm -rf {{ cookiecutter.package_name }}.egg-info
163- rm -rf dist
149+ # make sure to have a recent version of pip and the publishing dependencies
150+ python -m pip install --upgrade pip
151+ python -m pip install .[publishing]
164152
165153# create the source distribution and the wheel
166- python setup.py sdist bdist_wheel
154+ python -m build
167155
168156# upload to test pypi instance (requires credentials)
169- twine upload --repository-url https://test.pypi.org/legacy/ dist/*
157+ python -m twine upload --repository testpypi dist/*
170158```
171159
172160Visit
@@ -183,7 +171,7 @@ python -m venv env
183171source env/bin/activate
184172
185173# make sure to have a recent version of pip and setuptools
186- python -m pip install --upgrade pip setuptools
174+ python -m pip install --upgrade pip
187175
188176# install from test pypi instance:
189177python -m pip -v install --no-cache-dir \
@@ -198,7 +186,7 @@ Then upload to pypi.org with:
198186``` shell
199187# Back to the first terminal,
200188# FINAL STEP: upload to PyPI (requires credentials)
201- twine upload dist/*
189+ python -m twine upload dist/*
202190```
203191
204192### (3/3) GitHub
0 commit comments