clintecker / django-chunks

Think of it as flatpages for small bits of reusable content you might want to insert into your templates and manage from the admin interface.
http://github.com/clintecker/django-chunks
BSD 3-Clause "New" or "Revised" License
304 stars 101 forks source link

update setup.py for proper `pip freeze` & `pip install -r requirements` behavior #6

Closed thefekete closed 12 years ago

thefekete commented 12 years ago

pip installs the package named 'django-chunks', but freezes it as 'chunks'. So when you try to pip install -r requirements, it fails because it can't find a 'chunks' package. updating the name in setup.py should fix this.

clintecker commented 12 years ago

Looks pretty sound to me. You've seen no issues with this change in any way (installing, removing, freezing)?

thefekete commented 12 years ago

Just tested it... works as expected. If I forgot to test anything let me know, but I think this just about covers most of the relevant issues.

Just a reminder, I didn't presume to update the version numbers. I figured I'd let you handle that if you decide to merge. Anyways, I really dig this app and want to thank you for getting back to me.

-dan

## Cloned my repo and ran setup.py sdist, moved tarbal to /tmp/sdists/
## ran the following in a virtualenv

$ pip install --find-links file://tmp/sdists/ --no-index django-chunks
Ignoring indexes: http://pypi.python.org/simple/
Downloading/unpacking django-chunks
  Running setup.py egg_info for package django-chunks
Installing collected packages: django-chunks
  Running setup.py install for django-chunks
Successfully installed django-chunks
Cleaning up...

$ pip freeze
django-chunks==0.1
wsgiref==0.1.2

$ pip freeze > requirements

## Created new virtualenv

$ pip install --find-links file://tmp/sdists/ --no-index -r requirements 
Ignoring indexes: http://pypi.python.org/simple/
Downloading/unpacking django-chunks==0.1 (from -r requirements (line 1))
  Running setup.py egg_info for package django-chunks
Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /usr/lib/python2.6 (from -r requirements (line 2))
Installing collected packages: django-chunks
  Running setup.py install for django-chunks
Successfully installed django-chunks
Cleaning up...

$ pip freeze
django-chunks==0.1
wsgiref==0.1.2

## Python still sees the module name as just 'chunks' for imports

$ python -c 'import chunks' && echo "success" || echo "FAIL"
success

And here is the old behavior for reference:

$ pip install django-chunks
Downloading/unpacking django-chunks
  Downloading django-chunks-0.2.tar.gz
  Running setup.py egg_info for package django-chunks
Installing collected packages: django-chunks
  Running setup.py install for django-chunks
Successfully installed django-chunks
Cleaning up...

$ pip freeze
chunks==0.1
wsgiref==0.1.2

$ pip uninstall django-chunks
Cannot uninstall requirement django-chunks, not installed
Storing complete log in /home/danno/.pip/pip.log

$ pip uninstall chunks
Uninstalling chunks:
  /home/danno/tmp/chunk_test/lib/python2.6/site-packages/chunks
  /home/danno/tmp/chunk_test/lib/python2.6/site-packages/chunks-0.1-py2.6.egg-info
Proceed (y/n)? y
  Successfully uninstalled chunks

$ pip install chunks==0.1
Downloading/unpacking chunks==0.1
  Could not find any downloads that satisfy the requirement chunks==0.1
No distributions at all found for chunks==0.1
Storing complete log in /home/danno/.pip/pip.log

$ pip install django-chunks==0.1
Downloading/unpacking django-chunks==0.1
  Downloading django-chunks-0.1.tar.gz
  Running setup.py egg_info for package django-chunks
Installing collected packages: django-chunks
  Running setup.py install for django-chunks
Successfully installed django-chunks
Cleaning up...
hni commented 12 years ago

the current behaviour breaks deployment on heroku.com. Please accept the pull request