Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Version 5.0 causes pkg_resources.DistributionNotFound #49

Closed
dommorin opened this issue May 23, 2019 · 9 comments
Closed

Version 5.0 causes pkg_resources.DistributionNotFound #49

dommorin opened this issue May 23, 2019 · 9 comments

Comments

@dommorin
Copy link

dommorin commented May 23, 2019

Since release of 5.0, when installing our package on build machines, we get DistributionNotFound. I had to pin to "pytest-runner<5". Otherwise, using:

setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-cov', 'coverage', 'requests_mock'],
  • pip install '.[dev]'
    Processing /home/vsts/work/1/s
    Complete output from command python setup.py egg_info:
    /usr/share/miniconda/envs/py34/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'use_scm_version'
    warnings.warn(msg)
    warning: install_lib: 'build/lib' does not exist -- no Python modules to install

    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/pip-k_2kf438-build/.eggs/UNKNOWN-0.0.0-py3.4.egg
    Traceback (most recent call last):
    File "", line 1, in
    File "/tmp/pip-k_2kf438-build/setup.py", line 97, in
    'Documentation': [REDACTED]
    File "/usr/share/miniconda/envs/py34/lib/python3.4/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
    File "/usr/share/miniconda/envs/py34/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg/setuptools/dist.py", line 315, in init
    File "/usr/share/miniconda/envs/py34/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg/setuptools/dist.py", line 361, in fetch_build_eggs
    File "/usr/share/miniconda/envs/py34/lib/python3.4/site-packages/setuptools-27.2.0-py3.4.egg/pkg_resources/init.py", line 854, in resolve
    pkg_resources.DistributionNotFound: The 'pytest-runner' distribution was not found and is required by the application

@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

That's good, and that's what's expected to happen. You have two options - pin to pytest-runner < 5 or upgrade to setuptools >= 30.4. I attempted to warn about this in the pytest-runner 4.4 release.

@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

I shouldn't say "that's good". What I mean to say is, that's expected and unfortunate... but I don't see any other way forward.

@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

Ugh. I do see that the changelog was not at all explicit about this change. I can definitely improve that.

jaraco added a commit that referenced this issue May 23, 2019
@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

I know there are people hurting from this. The more I think about it, the less comfortable I am with this change. Perhaps there's a small shim I could add for compatibility that would allow the rest of these changes to be accepted without breaking all the workflows.

But before I embark on that possibility, can I get some feedback from those this affects - how difficult is it to adapt your work flow to adopt one of the proposed workarounds?

@dommorin
Copy link
Author

Updating setuptools for py34 will not happen any time soon. I would stick to pytest-runner<5 everywhere until I need to update setuptools for py34 (or until devops does the upgrade on ubuntu agents). So the workaround is good for us as long as pytest-runner<5 is supported.

@MightySCollins
Copy link

The problem we faced is that it was one of our dependencies which did not pin the version. (Causing is some nice deployment fails) We can try and get this changed but it might take some time.

@ianling
Copy link

ianling commented May 23, 2019

I am experiencing this during a CI build that attempts to install flake8-print (which requires pytest-runner). It is causing my builds to fail.

@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

I'm thinking that pytest-runner should just buck up and supply enough metadata in setup.py that it works on older setuptools versions.

@jaraco jaraco closed this as completed in 8437c7f May 23, 2019
@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

Okay. I believe 5.1 should surgically address the issue. Please let me know if it does not.

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

No branches or pull requests

4 participants