Differences between revisions 68 and 69
Revision 68 as of 2012-05-08 15:20:39
Size: 6059
Editor: techtonik
Comment: add link to Gmane
Revision 69 as of 2012-11-30 09:18:46
Size: 6318
Editor: MarcAndreLemburg
Comment: wiki restore 2013-01-23
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 3: Line 4:
 . http://pypi.python.org
.
http://pypi.python.org

Line 7: Line 12:
CheeseShop page has all information not directly related to PyPI development.
[[
CheeseShop|CheeseShop]] page has all information not directly related to PyPI development.
Line 11: Line 18:
 . The PyPI code hosting is currently undergoing migration
 .
Bug and patch tracker http://sourceforge.net/tracker/?group_id=66150&atid=513503
 . [[http://mail.python.org/mailman/listinfo/catalog-sig|Mailing List]] ([[http://dir.gmane.org/gmane.comp.python.catalog|Gmane]] web interface)
 . API that is used by easy_install http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api

 .
The PyPI code hosting is currently undergoing migration. For the time being, it is hosted here: https://bitbucket.org/loewis/pypi

 .
Bug and patch tracker http://sourceforge.net/tracker/?group_id=66150&atid=513503

 .
[[http://mail.python.org/mailman/listinfo/catalog-sig|Mailing List]] ([[http://dir.gmane.org/gmane.comp.python.catalog|Gmane]] web interface)

 .
API that is used by easy_install http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api

Line 18: Line 35:
PyPI is a WSGI application that can be executed standalone using `python pypi.wsgi` command if all requirements are met. `pypi.wsgi` contains usual WSGI wrapper code and delegates request processing to `WebUI.run()` method from `webui.py`. This method just opens DB and handles exceptions, actual request processing is done in `WebUI.inner_run()`. This method analyzes URL endpoint and executes appropriate handler. As of 2011-04, the rules to match endpoints to handlers are the following:
Line 20: Line 36:
|| /simple || WebUI.run_simple() || dump all package names on single html page ||
|| /simple/(.+)/ || WebUI.run_simple() || dump all links for a package in html list ||
|| /serversig/(.+)/ || .run_simple_sign() || save as above, but signed by server ||
|| /mirrors || .mirrors() || display static page with a list of mirrors ||
|| /daytime || .daytime() || display current server time ||
PyPI is a WSGI application that can be executed standalone using `python pypi.wsgi` command if all requirements are met. `pypi.wsgi` contains usual WSGI wrapper code and delegates request processing to `WebUI.run()` method from `webui.py`. This method just opens DB and handles exceptions, actual request processing is done in `WebUI.inner_run()`. This method analyzes URL endpoint and executes appropriate handler. As of 2011-04, the rules to match endpoints to handlers are the following:



||/simple ||WebUI.run_simple() ||dump all package names on single html page ||
||/simple/(.+)/ ||WebUI.run_simple() ||dump all links for a package in html list ||
||/serversig/(.+)/ ||.run_simple_sign() ||save as above, but signed by server ||
||/mirrors ||.mirrors() ||display static page with a list of mirrors ||
||/daytime ||.daytime() ||display current server time ||




Line 27: Line 52:
XML-RPC requests are detected by CONTENT_TYPE=`text/xml` variable in CGI environment and processed by `rpc.RequestHandler().__call__()`. List of XML-RPC "endpoints" is available on PyPiXmlRpc page.
XML-RPC requests are detected by CONTENT_TYPE=`text/xml` variable in CGI environment and processed by `rpc.RequestHandler().__call__()`. List of XML-RPC "endpoints" is available on [[PyPiXmlRpc|PyPiXmlRpc]] page.
Line 30: Line 57:
Line 35: Line 63:

Line 44: Line 74:
Something that's been requested, but needs much more thought and analysis to see whether it causes any problems: the ability to treat project names and versions as case-insensitive, while removing extraneous characters (as in pkg_resources.safe_name()) for  purposes both of searching and determining name uniqueness when registering.

Something that's been requested, but needs much more thought and analysis to see whether it causes any problems: the ability to treat project names and versions as case-insensitive, while removing extraneous characters (as in pkg_resources.safe_name()) for purposes both of searching and determining name uniqueness when registering.
Line 47: Line 80:

Line 49: Line 84:
Line 50: Line 86:

Line 53: Line 91:
Line 54: Line 93:

Line 56: Line 97:
Line 57: Line 99:
PyPI uses postgresql 8.3 as a database, with a roll it yourself web framework based on different python modules.  It uses apache2 as the web server.

PyPI uses postgresql 8.3 as a database, with a roll it yourself web framework based on different python modules. It uses apache2 as the web server.
Line 61: Line 106:
Line 62: Line 108:



Line 66: Line 116:

Line 67: Line 119:



Line 74: Line 130:
Ask RichardJones if you need a database dump. Note that dumps should not be imported into an existing database that has had the pkdump_schema.sql DDL script run against it. The pg_dump file will create all of the database tables, columns, indexes, foreign keys, etc. that are required.
Line 76: Line 131:
PageTemplates are obtained from: Ask [[RichardJones|RichardJones]] if you need a database dump. Note that dumps should not be imported into an existing database that has had the pkdump_schema.sql DDL script run against it. The pg_dump file will create all of the database tables, columns, indexes, foreign keys, etc. that are required.


[[PageTemplates|PageTemplates]] are obtained from:



Line 85: Line 147:
We also need to install ez_setup, celementtree, docutils, psycopg2, and M2Crypto.

We also need to install ez_setup, celementtree, docutils, psycopg2, and [[M2Crypto|M2Crypto]].
Line 89: Line 154:
Line 90: Line 156:



Line 94: Line 164:
if your config.ini isn't in /tmp/pypi.ini.  You can leave it as 'config.ini' if it's in the same directory as pypi.py.

if your config.ini isn't in /tmp/pypi.ini. You can leave it as 'config.ini' if it's in the same directory as pypi.py.
Line 98: Line 171:
Line 99: Line 173:



Line 107: Line 185:

Line 108: Line 188:
CategoryDevelopmentProcess
[[
CategoryDevelopmentProcess|CategoryDevelopmentProcess]]

This page documents the development of the Python Package Index (formerly known as Cheeseshop):

More about PyPI

CheeseShop page has all information not directly related to PyPI development.

Developing the Package Index

PyPI architecture and endpoints

PyPI is a WSGI application that can be executed standalone using python pypi.wsgi command if all requirements are met. pypi.wsgi contains usual WSGI wrapper code and delegates request processing to WebUI.run() method from webui.py. This method just opens DB and handles exceptions, actual request processing is done in WebUI.inner_run(). This method analyzes URL endpoint and executes appropriate handler. As of 2011-04, the rules to match endpoints to handlers are the following:

/simple

WebUI.run_simple()

dump all package names on single html page

/simple/(.+)/

WebUI.run_simple()

dump all links for a package in html list

/serversig/(.+)/

.run_simple_sign()

save as above, but signed by server

/mirrors

.mirrors()

display static page with a list of mirrors

/daytime

.daytime()

display current server time

...

XML-RPC requests are detected by CONTENT_TYPE=text/xml variable in CGI environment and processed by rpc.RequestHandler().__call__(). List of XML-RPC "endpoints" is available on PyPiXmlRpc page.

Testing Your Stuff Against PyPI

If you need to test stuff against PyPI (registration, uploading, API activities) then please use the alternative server "testpypi.python.org".

TO-DO list

  • A dump of download counts.
  • A big structured dump of all package meta-data.
  • A link from package to RTFD.
  • PEP for metadata 1.2 -- not finished and needs more catalog-sig discussion)

  • documented procedures for "taking over" entries should the original owner of the entry go away (and any required system support)
  • tooltips for field labels
  • change notification emails
  • per-classifier "wiki" content to allow description and discussion around each classifier (perhaps what packages are available and how they relate to one another)
  • screenshot images (with thumbnailing and a "latest screenshot" on the front page?) - or perhaps icons instead of thumbnails for some packages?

Something that's been requested, but needs much more thought and analysis to see whether it causes any problems: the ability to treat project names and versions as case-insensitive, while removing extraneous characters (as in pkg_resources.safe_name()) for purposes both of searching and determining name uniqueness when registering.

Done

  • command-line tool to query pypi and fetch entries: yolk

Not Going TO-DO

  • Edit PEP 243 to reflect reality. The interface is implemented in the distutils register and upload commands. This code is good enough for documentation, especially because it's the only implementation necessary.

  • moderated user reviews and ratings (this would require quite a lot of support from volunteers though)

Proposals

  • EnhancedPyPI Enhance multiple package index servers support in Distutils.

Development Environment Hints

PyPI uses postgresql 8.3 as a database, with a roll it yourself web framework based on different python modules. It uses apache2 as the web server.

It can run using wsgi, cgi, fcgi and mod_python.

Before restoring database, "pypi" role must exists:

  createuser pypi

These are notes so we can remember how to dump / restore the packages database:

  pg_dump -Fc -b packages >packages-20060706.dump
  createdb packages
  pg_restore -O -d packages -Fc packages-20060706.dump

Ask RichardJones if you need a database dump. Note that dumps should not be imported into an existing database that has had the pkdump_schema.sql DDL script run against it. The pg_dump file will create all of the database tables, columns, indexes, foreign keys, etc. that are required.

PageTemplates are obtained from:

  svn co svn://svn.zope.org/repos/main/zope.pagetemplate/trunk zope.pagetemplate
  svn co svn://svn.zope.org/repos/main/zope.tal/trunk zope.tal
  svn co svn://svn.zope.org/repos/main/zope.interface/trunk zope.interface
  svn co svn://svn.zope.org/repos/main/zope.i18nmessageid/trunk zope.i18nmessageid
  svn co svn://svn.zope.org/repos/main/zope.tales/trunk zope.tales

We also need to install ez_setup, celementtree, docutils, psycopg2, and M2Crypto.

# For debian, this should get you most of the dependencies. apt-get install zope3 python-celementtree python-psycopg

Then go ahead and edit pypi.ini and this line in pypi.cgi:

  cfg = config.Config('/tmp/pypi.ini', 'webui')

if your config.ini isn't in /tmp/pypi.ini. You can leave it as 'config.ini' if it's in the same directory as pypi.py.

You will need to add cheesecake_password=yourpasshere into the config.ini in the webui section.

To integrate it with Apache, we recommend to use WSGI through mod_wsgi. Your configuration should look like this:

   WSGIDaemonProcess pypi display-name=wsgi-pypi python-path=/usr/lib/zope2.9/lib/python processes=4 threads=1
   WSGIProcessGroup pypi
   WSGIPassAuthorization On
   WSGIScriptAlias /pypi /data/pypi/src/pypi/pypi.wsgi
   WSGIScriptAlias /simple /data/pypi/src/pypi/pypi.wsgi


CategoryDevelopmentProcess

CheeseShopDev (last edited 2019-08-23 10:57:11 by SumanaHarihareswara)

Unable to edit the page? See the FrontPage for instructions.