Can't run setup.py offline due to setup_requires - setup.py calls home

Ben Finney ben+python at benfinney.id.au
Mon Feb 11 10:57:30 EST 2019


Chris Narkiewicz via Python-list <python-list at python.org> writes:

> debian/rules calls this pip to install all requirements from local
> package collection:
>
> pip3 install --log=... --no-cache --no-index --find-links=pypi
> --no-binary=":all:" -r requirements.txt

As you have observed, this fails because Setuptools does not correctly
handle the ‘setup_requires’ option
<URL:https://github.com/pypa/setuptools/issues/457>.

> Directory pypi contains ALL dependencies required for build.

All of the build dependencies, *including* the ones specified in
‘setup_requires’?

> This works ok when build server has connection to network, but fails for
> offline builds. I pinpointed the problem to package Automat, that
> specifies some dependencies via setup_requires=[...]:
>
> setup(
>     ...,
>     setup_requires=[
>         'setuptools-scm',
>         'm2r',
>     ],
>     ...
> )

To avoid the Setuptools bug, the PyPA recommends dropping the
‘setup_requires’ option and instead specifying build dependencies in a
PEP 518 formatted metadata file
<URL:https://github.com/pypa/setuptools/issues/293>.

You could create such a specification (by adding a metadata file),
ensure those dependencies are also present locally, and meanwhile
present the maintainers of this project with your merge request to add
that metadata file.

-- 
 \       “What do religious fundamentalists and big media corporations |
  `\   have in common? They believe that they own culture, they are so |
_o__)                     self-righteous about it …” —Nina Paley, 2011 |
Ben Finney




More information about the Python-list mailing list