Personal tools
You are here: Home Documentation Developers How to use our new PloneSoftwareCenter egg basket

How to use our new PloneSoftwareCenter egg basket

by T. Kim Nguyen last modified Nov 02, 2010 11:32 AM

Really cool automated uploads of your eggs, and how to use those eggs in your buildout.cfg

If you do all the following, when you next create an egg, by running the following command line your egg will get automatically uploaded to your own local PloneSoftwareCenter:

python2.6 setup.py sdist upload -r ourbasket

We send only the source distribution (sdist) because we have recently identified a problem with setuptools that caused an __init__.py file to go missing if you create binary eggs.

You can find related instructions explaining how to upload your egg to plone.org or to PyPi.

Install PloneSoftwareCenter

You can skip this step if you want to upload your eggs to our (UW Oshkosh Plone WebHobo aka Secret Laboratory Number One aka Anything But WebLion) PloneSoftwareCenter.

If you don't already have a PloneSoftwareCenter to upload your eggs to, you'll need to install it.  See http://plone.org/products/plonesoftwarecenter for more info.  Basically, add the line Products.PloneSoftwareCenter to your buildout.cfg and rerun buildout.  This seems to require at least version 1.5.5 of PSC.

Now add a Software Center to your Plone site.

Create your own .pypirc file

This needs to be in your home directory.  In the example below, note the URL to the PSC's "simple" view which makes it look like a pypi mirror.  Your URL will differ!
[distutils]
index-servers =
  ourbasket

[ourbasket]
repository = http://plone2.webcluster.uwosh.edu:9082/sites1/ploneprojects/software/
username: nguyen
password: blabla

The username and password you want to specify in the file are the ones that will let you log into the Plone site.  In the case of UW Oshkosh faculty/staff/students, those would be your @uwosh.edu email username and password (ie. your LDAP credentials).

Permissions in the PloneSoftwareCenter

You will also need to have at least the "can add" role granted to your user in the PloneSoftwareCenter you want to upload to, via its Sharing tab.  If you are uploading to the UW Oshkosh PSC, please contact us so we can grant you that role.

Caveats

In the above .pypirc example, which uses port 9082 to upload to our PSC, you must be connected to the wired campus network or you must connect to the campus network via VPN.  That is because our campus wifi blocks weird ports such as 9082.
 

I ran into some minor issues with either Python 2.6, setuptools, and the exact expected format of the .pypirc file.

You should also beware that the default repository URL for pypi.python.org uses normal HTTP, not HTTPS, so it's possible for someone to intercept your credentials.

If you're working with Plone 3.* or less, you may need to install collective.dist to get it to work with Python 2.4. Your command will change slightly as you'll use "mupload" instead of "upload". Please do not release Python 2.4 eggs with Python 2.6.

 

More details on that setuptools problem

As of March 3, 2010:

"Just a friendly word of warning when distributing and consuming eggs. We had an issue with setuptools and distutils forgetting to include a __init__.py file while creating a binary egg distribution of an egg. Basically, if you create your egg using "bdist_egg" or "bdist", this issue could surprisingly show up. I can reproduce it consistently on my setup, Mac OS 10.6, setuptools 0.6c9 and Python 2.4. I had never seen it previously however.

Regardless, it is advised to only use the source distributions and to distribute your eggs only with the "sdist" parameter. It is better to do this anyway as your eggs will work with any python version and I doubt anyone will be doing anything special in their eggs that would require a binary distribution in the first place."

Kim's sample .pypirc

[distutils]
index-servers =
    ourbasket

[ourbasket]
repository = http://plone2.webcluster.uwosh.edu:9082/sites1/ploneprojects/software/
username: nguyen
password: blabla

[server-login]
repository = http://plone2.webcluster.uwosh.edu:9082/sites1/ploneprojects/software/
username: nguyen
password: blabla

Kim's sample Makefile

all:
    	cat Makefile
	@echo ""
	@echo "Don't forget to change the version number in setup.py and in version.txt"

clean:
      	rm -rf build dist

egg:
    	python2.4 setup.py bdist_egg

dist4:
      	python2.6 setup.py sdist upload -r ourbasket
Document Actions
  • Print this
  • Bookmarks