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
Elaborate on how the tutorial differs from the real packaging process (#602)
* Elaborate on how the tutorial differs from the real packaging process
* Reword username instruction for package name
* Revert incorrect change and reword username instructions
* Fix newline in bullet
* Re-flow paragraphs
about your package (such as the name and version) as well as which code files
64
64
to include.
65
65
66
-
Open :file:`setup.py` and enter the following content. You **should** update the package name to include your username (for example, ``example-pkg-theacodes``. You can personalize the other values if you'd like:
66
+
Open :file:`setup.py` and enter the following content. Update the package name to include your username (for example, ``example-pkg-theacodes``), this ensures that you have a unique package name and that your package doesn't conflict with packages uploaded by other people following this tutorial.
67
67
68
68
.. code-block:: python
69
69
@@ -95,7 +95,7 @@ minimal set:
95
95
96
96
- ``name`` is the *distribution name* of your package. This can be any name as long as only
97
97
contains letters, numbers, ``_`` , and ``-``. It also must not already
98
-
taken on pypi.org. **Be sure to update this with your username,** as this ensures you won't run into any name collisions when you upload the package.
98
+
taken on pypi.org. **Be sure to update this with your username,** as this ensures you won't try to upload a package with the same name as one which already exists when you upload the package.
99
99
- ``version`` is the package version see :pep:`440` for more details on
100
100
versions.
101
101
- ``author`` and ``author_email`` are used to identify the author of the
@@ -115,7 +115,7 @@ minimal set:
115
115
Instead of listing each package manually, we can use :func:`find_packages`
116
116
to automatically discover all packages and subpackages. In this case, the
117
117
list of packages will be `example_pkg` as that's the only package present.
118
-
- ``classifiers`` tell the index and :ref:`pip` some additional metadata
118
+
- ``classifiers`` gives the index and :ref:`pip` some additional metadata
119
119
about your package. In this case, the package is only compatible with Python
120
120
3, is licensed under the MIT license, and is OS-independent. You should
121
121
always include at least which version(s) of Python your package works on,
@@ -321,12 +321,20 @@ Next steps
321
321
322
322
Keep in mind that this tutorial showed you how to upload your package to Test
323
323
PyPI, which isn't a permanent storage. The Test system occasionally deletes
324
-
packages and accounts. If you want to upload your package to the real Python
325
-
Package Index you can do it by registering an account on https://pypi.org and
326
-
following the same instructions, however, use ``twine upload dist/*`` to upload
327
-
your package and enter your credentials for the account you registered on the
328
-
real PyPI. You can install your package from the real PyPI using
329
-
``pip install [your-package]``.
324
+
packages and accounts. It is best to use Test PyPI for testing and experiments like this tutorial.
325
+
326
+
When you are ready to upload a real package to the Python Package Index you can
327
+
do much the same as you did in this tutorial, but with these important
328
+
differences:
329
+
330
+
* Choose a memorable and unique name for your package. You don't have to append
331
+
your username as you did in the tutorial.
332
+
* Register an account on https://pypi.org - note that these are two separate
333
+
servers and the login details from the test server are not shared with the
334
+
main server.
335
+
* Use ``twine upload dist/*`` to upload your package and enter your credentials
336
+
for the account you registered on the real PyPI.
337
+
* Install your package from the real PyPI using ``pip install [your-package]``.
330
338
331
339
At this point if you want to read more on packaging Python libraries here are
0 commit comments