-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a51265d
commit 7a4415a
Showing
1 changed file
with
17 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,49 +150,35 @@ In a new terminal: | |
# has the state of origin/main branch | ||
cd $(mktemp -d rcx_tk.XXXXXX) | ||
git clone [email protected]:RECETOX/rcx-tk . | ||
``` | ||
|
||
# make sure to have a recent version of pip and the publishing dependencies | ||
python -m pip install --upgrade pip | ||
python -m pip install .[publishing] | ||
|
||
# create the source distribution and the wheel | ||
python -m build | ||
Create and activate a new environment: | ||
|
||
# upload to test pypi instance (requires credentials) | ||
python -m twine upload --repository testpypi dist/* | ||
```console | ||
micromamba create rcx-tk-pypi | ||
micromamba activate rcx-tk-pypi | ||
``` | ||
|
||
Visit | ||
[https://test.pypi.org/project/rcx_tk](https://test.pypi.org/project/rcx_tk) | ||
and verify that your package was uploaded successfully. Keep the terminal open, we'll need it later. | ||
|
||
In a new terminal, without an activated virtual environment or an env directory: | ||
Create an account on PypI. | ||
|
||
```shell | ||
cd $(mktemp -d rcx_tk-test.XXXXXX) | ||
In the Account settings, find the API tokens section and click on "Add API token". Copy your token. | ||
|
||
# prepare a clean virtual environment and activate it | ||
Add your API token to Poetry: | ||
|
||
micromamba create rcx-tk-pypi | ||
micromamba activate rcx-tk-pypi | ||
```console | ||
poetry config pypi-token.pypi your-api-token | ||
``` | ||
|
||
# make sure to have a recent version of pip and setuptools | ||
python -m pip install --upgrade pip | ||
Build your project: | ||
|
||
# install from test pypi instance: | ||
python -m pip -v install --no-cache-dir \ | ||
--index-url https://test.pypi.org/simple/ \ | ||
--extra-index-url https://pypi.org/simple rcx_tk | ||
```console | ||
poetry build | ||
``` | ||
|
||
Check that the package works as it should when installed from pypitest. | ||
Publish your package to PyPI: | ||
|
||
Then upload to pypi.org with: | ||
|
||
```shell | ||
# Back to the first terminal, | ||
# FINAL STEP: upload to PyPI (requires credentials) | ||
python -m twine upload dist/* | ||
```console | ||
poetry publish | ||
``` | ||
|
||
### (3/3) GitHub | ||
|