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

Version 5.0 causes pkg_resources.DistributionNotFound #49

Closed
@dommorin

Description

@dommorin

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

Activity

jaraco

jaraco commented on May 23, 2019

@jaraco
Contributor

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

jaraco commented on May 23, 2019

@jaraco
Contributor

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

jaraco commented on May 23, 2019

@jaraco
Contributor

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

added a commit that references this issue on May 23, 2019
jaraco

jaraco commented on May 23, 2019

@jaraco
Contributor

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

dommorin commented on May 23, 2019

@dommorin
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

MightySCollins commented on May 23, 2019

@MightySCollins

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

ianling commented on May 23, 2019

@ianling

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

jaraco commented on May 23, 2019

@jaraco
Contributor

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 commented on May 23, 2019

@jaraco
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jaraco@ianling@MightySCollins@dommorin

        Issue actions

          Version 5.0 causes pkg_resources.DistributionNotFound · Issue #49 · pytest-dev/pytest-runner