[Distutils] Role of setuptools and eggs in "modern" distributing...

Marcus Smith qwcode at gmail.com
Tue Dec 23 20:17:53 CET 2014


> git+https://url_to_the_repo.git#egg=name_of_package
>
> why isn't that "wheel=name_of_package"
>

the "egg" part here has nothing to do with eggs.  just a vestige of another
time.
see  https://github.com/pypa/pip/issues/1265

and will it work if setuptools was not used in the packages setup.py???
>

yes, it would work.

which I can now get with "pip --editable" or  does that give me setuptools
> develop mode anyway
>

"-e" uses setuptools develop mode.


So question one: do I need to use setuptools.setup rather than plain old
> distutils.setup?
>

the main reason for setuptools is for "install_requires", which is
fundamental to pip dependency resolution.
but in general, it offers more features and it's more maintained than pure
distutils.
The standard advice is to use setuptools over distutils.

I generally like the pip requirements.txt approach. It's up to the
> installation tool, not the packaging tool to mange requirements. But then
> again, it does make sense to declare the requirements in setup.py. But the
> issue at hand is that install_requires is doing some odd things with conda:
>

The Packaging User Guide has a breakdown of install_requires vs
requirements files.
https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files

In brief, requirements files are usually for a whole "environment", whereas
install_requires is for a project.

"install_requires" is critical when publishing projects to PyPI.

Even if you're not publishing, install_requires is helpful to safely
attempt an upgrade of your dependencies.
Instead of installing your app from a frozen requirements file, you would
install normally in a clean environment (based on install_requires) and let
any upgrades occur, and then you can re-freeze your requirements.

But if you are doing mostly vcs installs in your requirements file, then
it's true that maintaining install_requires can be somewhat pointless,
although I would still say it's helpful to keep track of each project's
first level abstract dependencies are, even if the install_requires
declarations aren't being used.

Marcus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20141223/0f2169fb/attachment.html>


More information about the Distutils-SIG mailing list