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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With