setuptools: setuptools 42.0.0 breaks with allow-hosts set globally

The error message is: distutils.errors.DistutilsError: the allow-hosts option is not supported when using pip to install requirements.

However, it’s not even pip being used: python3 setup.py sdist bdist_wheel --universal (see my next comment for why strikethrough)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

There are also configurations setting allow_hosts = None to prevent automatic download of dependencies altogether. It looks as though this use case is also broken.

There are also configurations setting allow_hosts = None to prevent automatic download of dependencies altogether. It looks as though this use case is also broken.

Indeed, this is our use case as well.

Also note that the pip docs still include this approach for this use case, see https://pip.pypa.io/en/stable/reference/pip_install/#controlling-setup-requires

To have the dependency located from a local directory and not crawl PyPI, add this:

[easy_install]
allow_hosts = ''
find_links = file:///path/to/local/archives/

related: https://github.com/pypa/pip/issues/410


Anyway, for this use case (hard-failing if setuptools tries to access PyPI), this still works:

[easy_install]
index_url = ''
find_links = ''