20130111

Hosting multiple Lino sites

Before doing an upgrade in Eupen I’d like to do it on lino-framework.org, and before that I’d like to run more tests because recently there were some problems related to certain demo fixtures not working in certain language configurations. And I had some ideas about how to automate these tests. New documentation page https://www.lino-framework.org/admin/lino_local.html. These things are good to solve before a first partner gets started with Lino mass hosting.

  • lino.Lino.__init__() no longer hardcodedly tries to import a sitecustomize_lino module:

    try:
        from sitecustomize_lino import on_init
    except ImportError:
        pass
    else:
        on_init(self)
    
  • In lino.Lino, renamed the site attribute settings_dict to <django_settings> lino.Lino.django_settings.

  • New django-admin command initdb_demo <lino.management.commands.initdb_demo> and new Lino setting demo_fixtures.

Cannot re-upload to PyPI

Here is how I do (or rather would like to do) my releases:

  1. upload a tarball to PyPI

  2. download and install that tarball on a “guinea pig” production site

  3. if the guinea pig installation reveals bugs which don’t require a database migration, fix these bugs, rebuild and re-upload the tarball, return to item 2.

  4. have the pre-released version run at the guinea pig site for some time (usually one workday)

  5. announce the new version on PyPI and increase the version number in the development trunk

Is it possible to use the distutils setup.py upload command several times for the same version?

Until now I always did the following when releasing

python setup.py register sdist --formats=gztar,zip upload

Can I upload a version without previously registering it? Answer: Yes (looks as if upload silently calls register)

$ python setup.py sdist --formats=gztar,zip upload
running sdist
running egg_info
writing lino.egg-info\PKG-INFO
writing top-level names to lino.egg-info\top_level.txt
writing dependency_links to lino.egg-info\dependency_links.txt
reading manifest file 'lino.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
(...)
adding 'lino-1.5.3\tests\misc\choices.py'
adding 'lino-1.5.3\tests\misc\diag.py'
removing 'lino-1.5.3' (and everything under it)
running upload
Submitting dist\lino-1.5.3.tar.gz to http://pypi.python.org/pypi
Server response (200): OK
Submitting dist\lino-1.5.3.zip to http://pypi.python.org/pypi
Server response (200): OK

But can I cannot re-upload a previously uploaded version:

$ python setup.py sdist --formats=gztar,zip upload
running sdist
running egg_info
...
adding 'lino-1.5.3\tests\misc\diag.py'
removing 'lino-1.5.3' (and everything under it)
running upload
Submitting dist\lino-1.5.3.tar.gz to http://pypi.python.org/pypi
Upload failed (400): A file named "lino-1.5.3.tar.gz" already exists for  lino-1.5.3. To fix problems with that file you should create a new
 release.
Submitting dist\lino-1.5.3.zip to http://pypi.python.org/pypi
Upload failed (400): A file named "lino-1.5.3.zip" already exists for  lino-1.5.3. To fix problems with that file you should create a new re
lease.

Of course I could fire up a browser, use PyPI’s web interface and delete the files before somebody else could download them.

The problem is the same when using testpypi.

The only workaround is to

  1. build a tarball (sdist) without upload

  2. upload it to some unofficial download site (currently I use /dl)

  3. download and install that tarball to the guinea pig

  4. use this for testing at the guinea pig

  5. make a last definitive sdist with upload to PyPI when the guinea pig tests passed.

The only problem with this workaround is that I usually forget this last step. But to be honest, that’s only because there are no more Lino production users than the one who serves as guinea pig.