Ticket #88 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

Move south package in subdirectory

Reported by: Jannis Leidel <jannis@…> Owned by: andrew
Priority: trivial Milestone: 0.5
Component: commands Version: 0.4
Keywords: Cc:

Description

Please move the south package at http://svn.aeracode.org/svn/south/trunk/ to the http://svn.aeracode.org/svn/south/trunk/south/ subdirectory (except of course the setup.py).

The advantages are:

  • ability to create a svn:externals directly to the south package
  • editable installations with pip (which uses setuptools' develop command to create links from the site-packages directory to a checkout of South)

Change History

comment:1 Changed 6 years ago by andrew

Yes, this came up a while ago in discussions for #25. The only problem is that this would break everyone already using it as a svn external, or even as a checkout.

It's annoying that pip/setup.py develop doesn't support this. I'll have to weigh up temporarily breaking every installation.

comment:2 Changed 6 years ago by andrew

comment:3 Changed 6 years ago by akaihola

After getting an SVN checkout, a dirty trick with some symbolic links seems to do the trick:

(test)/tmp $ svn co http://svn.aeracode.org/svn/south/trunk south

(test)/tmp $ cd south

(test)/tmp/south $ for i in db *.py management tests; do ln -s ../$i south/; done

(test)/tmp/south $ ls -F /tmp/south/south
db@  __init__.py@  management@  migration.py@
modelsparser.py@  models.py@  orm.py@  setup.py@  tests@

(test)/tmp/south $ python setup.py develop
running develop
running egg_info
creating South.egg-info
writing South.egg-info/PKG-INFO
writing top-level names to South.egg-info/top_level.txt
writing dependency_links to South.egg-info/dependency_links.txt
writing manifest file 'South.egg-info/SOURCES.txt'
writing manifest file 'South.egg-info/SOURCES.txt'
running build_ext
Creating /tmp/test/lib/python2.5/site-packages/South.egg-link (link to .)
Adding South 0.4 to easy-install.pth file

Installed /tmp/south
Processing dependencies for South==0.4
Finished processing dependencies for South==0.4

(test)/tmp/south $ cd /tmp/test

(test)/tmp/test $ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import south
>>> 

Is it possible to do this in the SVN repository to serve both svn:externals users and those who need pip -e or setup.py develop?

comment:4 Changed 6 years ago by andrew

  • Status changed from new to accepted

That's reasonably evil, but SVN does support adding symbolic links. It's a possible solution; I also want to try the idea I had of having a special init.py instead so we can _Actually_ move to having it in a subdirectory.

A third alternative, I guess, is to override the 'develop' command in setup.py so it does this first...

comment:5 Changed 5 years ago by andrew

  • Status changed from accepted to closed
  • Version set to 0.4
  • Resolution set to fixed

Fixed in [197] - I included a special init.py that, when loaded as south, adds the real directory to sys.path and then reloads that as South. Hackish-ish, but it's only for migration (heh).

Note: See TracTickets for help on using tickets.