Skip to content

Handling of find_links in setup.cfg in 42.0.0 #1920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
neuroid opened this issue Nov 26, 2019 · 5 comments · Fixed by #1921
Closed

Handling of find_links in setup.cfg in 42.0.0 #1920

neuroid opened this issue Nov 26, 2019 · 5 comments · Fixed by #1921
Labels

Comments

@neuroid
Copy link

neuroid commented Nov 26, 2019

Hi,

I have a couple of setup_requires dependencies in my setup.py and my setup.cfg looks like this:

[easy_install]
find_links = https://example.com

Looking at:

subprocess.check_call(cmd)

The cmd ends up being:

['python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpWyNzjZ', '--quiet', '--find-links', 'h', '--find-links', 't', '--find-links', 't', '--find-links', 'p', '--find-links', 's', '--find-links', ':', '--find-links', '/', '--find-links', '/', '--find-links', 'e', '--find-links', 'x', '--find-links', 'a', '--find-links', 'm', '--find-links', 'p', '--find-links', 'l', '--find-links', 'e', '--find-links', '.', '--find-links', 'c', '--find-links', 'o', '--find-links', 'm', 'babel; extra == "i18n"']

It seems the assumption was that find_links is a list but it ends up being a string.

Additionally, since pip is unable to build/fetch a wheel, the following line throws an IndexError:

wheel = Wheel(glob.glob(os.path.join(tmpdir, '*.whl'))[0])

Perhaps this could be caught and a more user-friendly error displayed instead.

@benoit-pierre
Copy link
Member

See #1921 for the find_links issue.

As for the IndexError, this should not happen, as the expectation is that the pip command will return with non-zero exit code in case of failure. This is probably related to the extra == "i18n" marker, which I think should have been stripped.

Can you provide the full setup.py?

@neuroid
Copy link
Author

neuroid commented Nov 26, 2019

Here's a relevant excerpt:

from setuptools import find_packages
from setuptools import setup

setup(name='templates',
      version='0.0.1',
      description='Templates',
      packages=find_packages(),
      setup_requires=[
          'setup[i18n]',
      ])

The setup package has a very similar setup.py, but with the following extras definition:

      ...
      extras_require={
          'i18n': ['babel'],
      },
      ...

@benoit-pierre
Copy link
Member

Thanks, but from my tests it's more complicated, and only happen if setup is already installed, but not babel, otherwise, the call to fetch_build_req for babel happen with a requirement with no marker (which works).

Anyway, looking into it.

@neuroid
Copy link
Author

neuroid commented Nov 26, 2019

That sounds about right. I can confirm that setup was already installed, but not with the i18n extra.

@benoit-pierre
Copy link
Member

See #1922.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants