From dbb69a52f660a85166eccdd021ba07774e71ea08 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Thu, 27 Aug 2009 16:14:00 -0400 Subject: [PATCH] finished! --- packaging.html | 70 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 22 deletions(-) diff --git a/packaging.html b/packaging.html index 7ad15f9..17b350f 100644 --- a/packaging.html +++ b/packaging.html @@ -320,7 +320,6 @@ warning: check: missing required meta-data: version

Distutils supports building multiple types of release packages. At a minimum, you should build a “source distribution” that contains your source code, your Distutils setup script, your “read me” file, and whatever additional files you want to include. To build a source distribution, pass the sdist command to your Distutils setup script.

-FIXME again
 c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py sdist
 running sdist
 running check
@@ -469,35 +468,62 @@ removing 'build\bdist.win32\wininst' (and everything under it)
 
 

⁂ -

Adding Your Package to The Python Package Index

+

Adding Your Software to The Python Package Index

-

FIXME +

Uploading software to the Python Package Index is a three step process. -

Registering Yourself

+
    +
  1. Register yourself +
  2. Register your software +
  3. Upload the packages you created with setup.py sdist and setup.py bdist_* +
-
-http://pypi.python.org/pypi?:action=register_form
-
+

To register yourself, go to the PyPI user registration page. Enter your desired username and password, provide a valid email address, and click the Register button. (If you have a PGP or GPG key, you can also provide that. If you don’t have one or don’t know what that means, don’t worry about it.) Check your email; within a few minutes, you should receive a message from PyPI with a validation link. Click the link to complete the registration process. -

Enter your desired username and password, provide a valid email address, and click the Register button. (If you have a PGP or GPG key, you can also provide that. If you don’t have one or don’t know what that means, don’t worry about it.) Check your email; within a few minutes, you should receive a message from PyPI with a validation link. Click the link to complete the registration process. +

Now you need to register your software with PyPI and upload it. You can do this all in one step. +

+c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py register sdist bdist_wininst upload  
+running register
+We need to know who you are, so please choose either:
+ 1. use your existing login,
+ 2. register as a new user,
+ 3. have the server generate a new password for you (and email it to you), or
+ 4. quit
+Your selection [default 1]:  1                                                                 
+Username: MarkPilgrim                                                                          
+Password:
+Registering chardet to http://pypi.python.org/pypi                                             
+Server response (200): OK
+running sdist                                                                                  
+... output trimmed for brevity ...
+running bdist_wininst                                                                          
+... output trimmed for brevity ...
+running upload                                                                                 
+Submitting dist\chardet-1.0.2.zip to http://pypi.python.org/pypi
+Server response (200): OK
+Submitting dist\chardet-1.0.2.win32.exe to http://pypi.python.org/pypi
+Server response (200): OK
+I can store your PyPI login so future submissions will be faster.
+(the login will be stored in c:\home\.pypirc)
+Save your login (y/N)?n                                                                        
+
    +
  1. When you release your project for the first time, Distutils will add your software to the Python Package Index and give it its own URL. Every time after that, it will simply update the project metadata with any changes you may have made in your setup.py parameters. Next, it builds a source distribution (sdist) and a Windows installer (bdist_wininst), then uploads them to PyPI (upload). +
  2. Type 1 or just press ENTER to select “use your existing login.” +
  3. Enter the username and password you selected on the the PyPI user registration page. Distuils will not echo your password; it will not even echo asterisks in place of characters. Just type your password and press ENTER. +
  4. Distutils registers your package with the Python Package Index… +
  5. …builds your source distribution… +
  6. …builds your Windows installer… +
  7. …and uploads them both to the Python Package Index. +
  8. If you want to automate the process of releasing new versions, you need to save your PyPI credentials in a local file. This is completely insecure and completely optional. +
+

Congratulations, you now have your own page on the Python Package Index! The address is http://pypi.python.org/pypi/NAME, where NAME is the string you passed in the name parameter in your setup.py file. -

Registering Your Package

+

If you want to release a new version, just update your setup.py with the new version number, then run the same upload command again: -

FIXME - -

Uploading New Versions

- -

FIXME - -

-@jessenoller sez:
- * distutils, how to make a setup.py (and include data files, tests, docs, etc for a project)
- * how to upload it to pypi properly (label it for python 3 for the love of pete)
- * how to build build bdist/RPMs/DEBs.
- * If you can - and I've forgotten how much distutils supports of this, cover dependency management.
- * Oh, I almost forgot - cover the Per-User Site packages stuff, PEP 370
+
+c:\Users\pilgrim\chardet> c:\python31\python.exe setup.py register sdist bdist_wininst upload