You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to publish the created tag on GitHub. Alternatively, it is possible to create a tag through the Github web interface. For more information, see [managing Github releases][]. This will automatically trigger a Github workflow that creates a release on PyPI.
93
103
94
-
### The release Github workflow
95
-
96
-
#### Behind the scenes
97
-
98
-
This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section.
99
-
Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run
100
-
101
-
```bash
102
-
python -m build
103
-
```
104
-
105
-
This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository.
106
-
107
-
Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running:
108
-
109
-
```bash
110
-
twine check dist/*
111
-
```
112
-
113
-
and finally publishing it with:
114
-
115
-
```bash
116
-
twine upload dist/*
117
-
```
118
-
119
-
Provide your username and password when requested and then go check out your package on [PyPI][]!
120
-
121
-
For more information, follow the [Python packaging tutorial][].
122
-
123
-
#### Configuring the Github workflow
124
-
125
-
Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].
126
-
For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token.
127
-
See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token.
128
-
Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][].
Copy file name to clipboardExpand all lines: docs/template_usage.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,49 @@ On the RTD dashboard choose "Import a Project" and follow the instructions to ad
158
158
159
159
If your project is private, there are ways to enable docs rendering on [readthedocs.org][] but it is more cumbersome and requires a different subscription for read the docs. See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-private-repositories.html).
160
160
161
+
### The release Github workflow
162
+
163
+
#### Configuring the Github workflow
164
+
165
+
Tags adhering to `"*.*.*"` that are pushed to the `main` branch will trigger the release Github workflow that automatically builds and uploads the Python package to [PyPI][].
166
+
For this to work, the `PYPI_API_TOKEN` Github secret needs to be set to the value of the [PyPI][] token.
167
+
See [Creating PyPI tokens][] for instructions on how to create a [PyPI][] token.
168
+
Finally, set your `PYPI_API_TOKEN` Github secret equal to the value of the just created [PyPI][] token by following [creating Github secrets][].
169
+
170
+
#### Behind the scenes
171
+
172
+
This section explains how releases can be created manually purely for educational purposes. Experienced developers may skip this section.
173
+
Python packages are not distributed as source code, but as _distributions_. The most common distribution format is the so-called _wheel_. To build a _wheel_, run
174
+
175
+
```bash
176
+
python -m build
177
+
```
178
+
179
+
This command creates a _source archive_ and a _wheel_, which are required for publishing your package to [PyPI][]. These files are created directly in the root of the repository.
180
+
181
+
Before uploading them to [PyPI][] you can check that your _distribution_ is valid by running:
182
+
183
+
```bash
184
+
twine check dist/*
185
+
```
186
+
187
+
and finally publishing it with:
188
+
189
+
```bash
190
+
twine upload dist/*
191
+
```
192
+
193
+
Provide your username and password when requested and then go check out your package on [PyPI][]!
194
+
195
+
For more information, follow the [Python packaging tutorial][].
0 commit comments