5

I used to distribute my python programs with setuptools.setup. But now I want to use distutils.core.setup.

With setuptools I used a code similar to this:

setup(
    name = "radish",
    version = "0.01.00",
    description = "Behaviour-Driven-Development tool for python",
    author = "Timo Furrer",
    author_email = "[email protected]",
    url = "http://github.com/timofurrer/radish",
    packages = [ "radish", "radish/Writers" ],
    entry_points = { "console_scripts": [ "radish = radish.main:main", ] },
    package_data = { "radish": [ "*.md" ] }
    ...
)

I want to do the same with distutils - but there is no entry_points available. How can I manage this? How can I specify my new command?

0

2 Answers 2

8

You can't, not with distutils. It does not support entry_points, that's a setuptools-only feature.

Use setuptools instead; it supports Python 3.

Sign up to request clarification or add additional context in comments.

4 Comments

Okay, thank you! So, distutils can only be used to install python modules and not to install "commands"?!
Exactly; distutils is also present in Python 2. setuptools is an extension to distutils.
Since July 2013 setuptools is the way to go.
@guettli: Indeed; distutils and setuptools have merged
2

With distutils, scripts are just files, like this example:

#!/usr/bin/env python
from radish.main import main
main()

In your setup script, you use the scripts parameter to list these files.

This works great on Unix and can work on Windows if people/installers set up file associations properly (no binary wrappers are generated, like what setuptools does). A .py extension will be needed for Windows, and will be okay (unneeded and for many people ugly) on Unix.

Far from perfect, but can work if you audience is developers for example, or doesn’t use Windows.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.