[Distutils] Package a project
Imran M Yousuf
imran at smitsol.com
Mon Dec 2 16:28:13 CET 2013
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 <p.f.moore at gmail.com> wrote:
> On 2 December 2013 07:53, Imran M Yousuf <imran at smitsol.com> 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 at 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 at smitsol.com
Twitter: @imyousuf - http://twitter.com/imyousuf
Skype: imyousuf
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557
+880-1746119494
More information about the Distutils-SIG
mailing list