I have a huge problem to create proper python setup script. My folder structure looks like this:
my_project/ my_project/ --__init__.py --file_1.py --file_2.py --file_3.py -AUTHORS -CHANGELOG -INSTALL -LICENSE -README.rst -setup.cfg -setup.py I have created a setup script, but it does not behave like I want to. The setup script:
from ez_setup import use_setuptools use_setuptools() import os import sys from setuptools import setup, find_packages readme_file = os.path.join(os.path.dirname(__file__), 'README.rst') try: long_description = open(readme_file).read() except IOError, err: sys.stderr.write("[ERROR] Cannot find file specified as ""``long_description`` (%s)\n" % readme_file) sys.exit(1) setup( name = 'my_project', version='0.0.1', author = 'AUTHOR', author_email = 'CONTACT', url = 'http://example.com', description= 'Some description', long_description = long_description, packages = find_packages('my_project'), package_dir = {'':'my_project'}, package_data = {'':['*.py']}, include_package_data = True, scripts = [], requires = [], license = 'BSD License', install_requires = [ 'some_packages', ], classifiers = [ 'Development Status :: 2 - Pre-Alpha', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Database', 'Topic :: Internet', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords = 'python, setup, script, the best', ) After this:
sudo python setup.py alias release register sdist bdist_egg upload sudo python setup.py release Everything is fine, up to this point, but when I try:
sudo pip install my_project I only get in /usr/local/lib/python2.7/dist-packages/ a folder called my_project-0.0.1.egg-info/, but there are no my_project with init, file_1, file_2, file_3 python files.
I know that my_project-0.0.1.egg-info/ is required, but where are my files?
Then I tried:
sudo python setup.py install With no effect, but this time I got a folder my_project-0.0.1-py2.7.egg.
I want to get in /usr/local/lib/python2.7/dist-packages/ two directories:
- my_project-0.0.1.egg-info/ - my_project with my files My questions:
- What am I doing wrong?
- How can I resolve it?
- Maybe when I try to use distutils instead of setuptools it can help me?
ez_setupwith modernsetuptools(post-distributemerge). What version do you have? And have you tried it with just the first two lines removed?