[Insight-developers] [SimpleITK] PyPi distribution

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Sep 15 13:08:49 EDT 2011


Matt,

I just wanted to give a little more explanation of how we need to use Pypi.

Our mammoth build process is shrunk down to only 25MB eggs, however this is too big to upload to pypi. Also we are already uploading things to source forge. However, the layout and "interactive" pages of source forge don't conform to the "Package Index API":
http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api

So we are tacking advantage of the download_url, on pypi to refer to a page in the doxygen. This page contains a list of links to the files which can be downloaded from source forge. 

On Sep 15, 2011, at 12:30 PM, Matt McCormick wrote:

> Hi Brad,
> 
>> I have made some really good progress on this.
> 
> Outstanding!
> 
>> I am looking for documentation on how easy_install determines which binary
>> distribution to use. On my Mac I am getting eggs with the following name
>> format: SimpleITK-0.2.0-Py2.6.egg. I don't know how it is suppose to
>> determine with OS the egg is for. I have the feeling that there is suppose
>> to be some platform string in the name too, but I don't know what
>> easy_install is looking for or which of the many platform strings available
>> in python should be used.
> 
> The egg is just a zip file.  Unpacking it, I don't see any OS
> information.  If users are downloading on their own, it may be up to
> them to make sure they have the right version.

I think the OS information is suppose to be extracted from the file name, the same way as the project, project version, and pyversion ( yes, I pre-prended py to to version ).

> 
> However, if we get PyPi working for binaries, it might be OK.  Then,
> people could hopefully do

In python lingo, these are actually refered to as "built distributions".

> 
> easy_install SimpleITK
> 
> or
> 
> pip install SimpleITK
> 
> (pip is the replacement for easy_install, which has been deprecated).

Good to know.

> 
>> Any ideas on where I can find some more information about this?
> 
> There is a 'platforms' field in the setup.py metadata,
> http://docs.python.org/distutils/setupscript.html#meta-data,
> 
> but I do not know what it does.

It gets upload to pypi, and is just part of the project discription. Other projects with build able eggs, just have a list of supported platforms. This is not an option to set on a per-egg basis.

> 
> We can look at what information PyPi has:
> 
> wget http://pypi.python.org/pypi/SimpleITK/json
> 
> That currently gives:
> 
> {
>    "info": {
>        "maintainer": "",
>        "requires_python": null,
>        "maintainer_email": "",
>        "cheesecake_code_kwalitee_id": null,
>        "keywords": "ITK InsightToolkit segmentation registration image",
>        "package_url": "http://pypi.python.org/pypi/SimpleITK",
>        "author": "Insight Software Consortium",
>        "author_email": "insight-users at itk.org",
>        "download_url":
> "http://erie.nlm.nih.gov/~blowek1/SimpleITK/PyDownload.html",

^^This is the important field I mentioned above.^^

>        "platform": "UNKNOWN",
>        "version": "0.2.0",
>        "cheesecake_documentation_id": null,
>        "_pypi_hidden": false,
>        "description": "Provide an abstraction layer to ITK that
> enables developers    and users to access the powerful features of the
> InsightToolkit in a more     simplified manner.",
>        "release_url": "http://pypi.python.org/pypi/SimpleITK/0.2.0",
>        "_pypi_ordering": 1,
>        "classifiers": [
>            "Development Status :: 4 - Beta",
>            "Intended Audience :: Developers",
>            "License :: OSI Approved :: Apache Software License",
>            "Programming Language :: Python",
>            "Topic :: Scientific/Engineering"
>        ],
>        "name": "SimpleITK",
>        "bugtrack_url": "",
>        "license": "Apache",
>        "summary": "Simplified interface to the Insight Toolkit for
> image registration and segmentation",
>        "home_page": "http://simpleitk.org/",
>        "stable_version": null,
>        "cheesecake_installability_id": null
>    },
>    "urls": []
> }
> 
> Maybe after we start doing some uploads, i.e. python setup.py
> bdist_egg upload, it will have more information?
> 
> Matt
> 
> 
>> Thanks,
>> Brad
>> On Sep 14, 2011, at 3:28 PM, Matt McCormick wrote:
>> 
>> Hi Brad,
>> 
>> I did a little research after the Tcon conversation on the Python
>> distribution this morning:
>> 
>> A quick run down on Python distribution can be found here:
>> 
>> http://packages.python.org/an_example_pypi_project/setuptools.html#putting-it-all-together-with-the-full-windows-script
>> 
>> This shows how to make binary eggs, binary Windows stand alone
>> installers, and upload eggs to PyPi.
>> 
>> Note that source distributions will probably not work because Python
>> has its own C Extension build system that is presumed to be used.
>> 
>> As it mentions, binary eggs are distinguished by Python version and
>> operating system.  On Windows, they use the Visual Studio compiler, so
>> it is good to stick with that.  Python 2.6 and Python 2.7 would be
>> good versions to target.  The Python 3 series would be nice if we have
>> time.
>> 
>> The PyPi website is here:
>> 
>> http://pypi.python.org/pypi
>> 
>> Instructions setting up a project can be found here:
>> 
>> http://wiki.python.org/moin/CheeseShopTutorial
>> 
>> It would be appropriate if one of the primary developers like yourself
>> admin'ed the project instead of myself so credit goes where due.
>> 
>> Let me know if I can help out.
>> 
>> Thanks,
>> Matt
>> 
>> ========================================================
>> 
>> Bradley Lowekamp
>> 
>> Lockheed Martin Contractor for
>> 
>> Office of High Performance Computing and Communications
>> 
>> National Library of Medicine
>> 
>> blowekamp at mail.nih.gov
>> 
>> 

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110915/bf8d131c/attachment.htm>


More information about the Insight-developers mailing list