Hi, I am new to setuptools. I am using it to build and package a project of mine. Currently if I execute `python setup.py bdist` it generates a tarball with all files located in paths './abs/path/to/project/bin/[entry points]' and './abs/path/to/project/lib/python-2.7/site-packages/[rest of the sources]'. This does not seem to be logical :(, I would rather want the binary distribution to be structure - './project-name/bin/' and './project-name/lib/'. Can some please advise me how to achieve it? I am using VirtualEnv for development of this project and its setup.py looks like - from setuptools import setup, find_packages setup(name='project-name', version='1.0', description='Description', author='Imran M Yousuf', author_email='imran@smitsol.com', url='http://www.smitsol.com', install_requires = ['setuptools', 'pycrypto==2.6'], packages=find_packages('src', ["tests"]), package_dir={'': 'src'}, test_suite="tests", entry_points={ 'console_scripts': ['manager=client.manager:main'] } ) Thank you, -- Imran M Yousuf Entrepreneur & CEO Smart IT Solution http://smitsol.com 25/5B, Block F, Haji Chinu Miah Road Bylane Joint Quarter, Mohammadpur Dhaka - 1207, Bangladesh Email: imran@smitsol.com Twitter: @imyousuf - http://twitter.com/imyousuf Skype: imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 +880-1746119494
On 2 December 2013 07:53, Imran M Yousuf
Hi,
I am new to setuptools. I am using it to build and package a project of mine. Currently if I execute `python setup.py bdist` it generates a tarball with all files located in paths './abs/path/to/project/bin/[entry points]' and './abs/path/to/project/lib/python-2.7/site-packages/[rest of the sources]'. This does not seem to be logical :(, I would rather want the binary distribution to be structure - './project-name/bin/' and './project-name/lib/'.
Can some please advise me how to achieve it? I am using VirtualEnv for development of this project and its setup.py looks like -
from setuptools import setup, find_packages
setup(name='project-name', version='1.0', description='Description', author='Imran M Yousuf', author_email='imran@smitsol.com', url='http://www.smitsol.com', install_requires = ['setuptools', 'pycrypto==2.6'], packages=find_packages('src', ["tests"]), package_dir={'': 'src'}, test_suite="tests", entry_points={ 'console_scripts': ['manager=client.manager:main'] } )
From what you provide, I'm not 100% sure if you have C code in your
Install the wheel project and use bdist_wheel instead of a simple bdist. Also, use the sdist (source distribution) command to create a source package (that needs a compiler to build). Binary packages are only compatible with the platform/Python version they are built on, so you may want to make multiple wheels, depending on what platforms you are targeting. project, actually. If you don't, then a sdist is sufficient - although a wheel might be worth uploading as well (pure Python wheels are cross-platform). The plain bdist command produces a "dumb" binary distribution, which is obsolete, and frankly useless. Paul
Thanks for the suggestion Paul. Wheel structures exactly as I want it to be, but I see it does not generate the entry point scripts; any idea how to get them to work? Thank you, Imran On Mon, Dec 2, 2013 at 7:59 PM, Paul Moore
On 2 December 2013 07:53, Imran M Yousuf
wrote: Hi,
I am new to setuptools. I am using it to build and package a project of mine. Currently if I execute `python setup.py bdist` it generates a tarball with all files located in paths './abs/path/to/project/bin/[entry points]' and './abs/path/to/project/lib/python-2.7/site-packages/[rest of the sources]'. This does not seem to be logical :(, I would rather want the binary distribution to be structure - './project-name/bin/' and './project-name/lib/'.
Can some please advise me how to achieve it? I am using VirtualEnv for development of this project and its setup.py looks like -
from setuptools import setup, find_packages
setup(name='project-name', version='1.0', description='Description', author='Imran M Yousuf', author_email='imran@smitsol.com', url='http://www.smitsol.com', install_requires = ['setuptools', 'pycrypto==2.6'], packages=find_packages('src', ["tests"]), package_dir={'': 'src'}, test_suite="tests", entry_points={ 'console_scripts': ['manager=client.manager:main'] } )
Install the wheel project and use bdist_wheel instead of a simple bdist. Also, use the sdist (source distribution) command to create a source package (that needs a compiler to build). Binary packages are only compatible with the platform/Python version they are built on, so you may want to make multiple wheels, depending on what platforms you are targeting.
From what you provide, I'm not 100% sure if you have C code in your project, actually. If you don't, then a sdist is sufficient - although a wheel might be worth uploading as well (pure Python wheels are cross-platform).
The plain bdist command produces a "dumb" binary distribution, which is obsolete, and frankly useless. Paul
-- Imran M Yousuf Entrepreneur & CEO Smart IT Solution http://smitsol.com 25/5B, Block F, Haji Chinu Miah Road Bylane Joint Quarter, Mohammadpur Dhaka - 1207, Bangladesh Email: imran@smitsol.com Twitter: @imyousuf - http://twitter.com/imyousuf Skype: imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 +880-1746119494
On 2 December 2013 15:28, Imran M Yousuf
Thanks for the suggestion Paul. Wheel structures exactly as I want it to be, but I see it does not generate the entry point scripts; any idea how to get them to work?
The scripts should be generated when you install the wheel (with pip 1.5, which will be released soon). OTOH, I thought that wheel put generated scripts into the wheel file by default (except in version 0.20.0 - do you have the latest version?) The scripts should be in <wheel file>/<project>.data/scripts - the wheel install process puts them in the right place (virtualenv/bin or whatever is appropriate). Paul
Damn me! Thanks Paul, yes the script does have it in the data folder. Thank you, Imran On Mon, Dec 2, 2013 at 9:32 PM, Paul Moore
On 2 December 2013 15:28, Imran M Yousuf
wrote: Thanks for the suggestion Paul. Wheel structures exactly as I want it to be, but I see it does not generate the entry point scripts; any idea how to get them to work?
The scripts should be generated when you install the wheel (with pip 1.5, which will be released soon). OTOH, I thought that wheel put generated scripts into the wheel file by default (except in version 0.20.0 - do you have the latest version?)
The scripts should be in <wheel file>/<project>.data/scripts - the wheel install process puts them in the right place (virtualenv/bin or whatever is appropriate).
Paul
-- Imran M Yousuf Entrepreneur & CEO Smart IT Solution http://smitsol.com 25/5B, Block F, Haji Chinu Miah Road Bylane Joint Quarter, Mohammadpur Dhaka - 1207, Bangladesh Email: imran@smitsol.com Twitter: @imyousuf - http://twitter.com/imyousuf Skype: imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 +880-1746119494
On 3 Dec 2013 02:01, "Imran M Yousuf"
Thanks for the suggestion Paul. Wheel structures exactly as I want it to be, but I see it does not generate the entry point scripts; any idea how to get them to work?
Those are platform dependent, so the installer generates them at install time based on the metadata in the wheel. Cheers, Nick.
Thank you,
Imran
On Mon, Dec 2, 2013 at 7:59 PM, Paul Moore
wrote: On 2 December 2013 07:53, Imran M Yousuf
wrote: Hi,
I am new to setuptools. I am using it to build and package a project of mine. Currently if I execute `python setup.py bdist` it generates a tarball with all files located in paths './abs/path/to/project/bin/[entry points]' and './abs/path/to/project/lib/python-2.7/site-packages/[rest of the sources]'. This does not seem to be logical :(, I would rather want the binary distribution to be structure - './project-name/bin/' and './project-name/lib/'.
Can some please advise me how to achieve it? I am using VirtualEnv for development of this project and its setup.py looks like -
from setuptools import setup, find_packages
setup(name='project-name', version='1.0', description='Description', author='Imran M Yousuf', author_email='imran@smitsol.com', url='http://www.smitsol.com', install_requires = ['setuptools', 'pycrypto==2.6'], packages=find_packages('src', ["tests"]), package_dir={'': 'src'}, test_suite="tests", entry_points={ 'console_scripts': ['manager=client.manager:main'] } )
Install the wheel project and use bdist_wheel instead of a simple bdist. Also, use the sdist (source distribution) command to create a source package (that needs a compiler to build). Binary packages are only compatible with the platform/Python version they are built on, so you may want to make multiple wheels, depending on what platforms you are targeting.
From what you provide, I'm not 100% sure if you have C code in your project, actually. If you don't, then a sdist is sufficient - although a wheel might be worth uploading as well (pure Python wheels are cross-platform).
The plain bdist command produces a "dumb" binary distribution, which is obsolete, and frankly useless. Paul
-- Imran M Yousuf Entrepreneur & CEO Smart IT Solution http://smitsol.com 25/5B, Block F, Haji Chinu Miah Road Bylane Joint Quarter, Mohammadpur Dhaka - 1207, Bangladesh Email: imran@smitsol.com Twitter: @imyousuf - http://twitter.com/imyousuf Skype: imyousuf Blog: http://imyousuf-tech.blogs.smartitengineering.com/ Mobile: +880-1711402557 +880-1746119494 _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
participants (3)
-
Imran M Yousuf
-
Nick Coghlan
-
Paul Moore