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

Declarative config breaks installs for old setuptools #43

Closed
brandon-leapyear opened this issue Feb 14, 2019 · 9 comments
Closed

Declarative config breaks installs for old setuptools #43

brandon-leapyear opened this issue Feb 14, 2019 · 9 comments

Comments

@brandon-leapyear
Copy link

Reproduction:

python3 -m venv venv
venv/bin/pip install flake8-mutable

The flake8-mutable project uses pytest-runner in setup_requires (ref), which installs packages via easy_install and not through pip (https://pip.readthedocs.io/en/1.4.1/cookbook.html#controlling-setup-requires), which is probably the reason why our CI is currently crashing:

Collecting flake8-mutable==1.2.0 (from -c python/requirements/constraints.txt (line 43))
  Downloading https://nexus.build-leapyear.com/repository/pypi/packages/97/6a/0fd1d903848fe043c7b6e5283d9def56425754098e69d7683a3ccbbea345/flake8-mutable-1.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    /root/.lybuild/miniconda-4.3.31/lib/python3.6/distutils/dist.py:261: 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-install-hsfxj0l7/flake8-mutable/.eggs/UNKNOWN-0.0.0-py3.6.egg
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-hsfxj0l7/flake8-mutable/setup.py", line 40, in <module>
        'Programming Language :: Python :: 3.6',
      File "/root/.lybuild/miniconda-4.3.31/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/root/src/venv/lib/python3.6/site-packages/setuptools/dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/root/src/venv/lib/python3.6/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "/root/src/venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'pytest-runner' distribution was not found and is required by the application
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-hsfxj0l7/flake8-mutable/
@brandon-leapyear brandon-leapyear changed the title 4.3 breaks installs [URGENT] 4.3 breaks installs Feb 14, 2019
lpsinger added a commit to lpsinger/gwcelery that referenced this issue Feb 14, 2019
@jaraco
Copy link
Contributor

jaraco commented Feb 14, 2019

That's weird to me that pytest-runner installed as "UNKNOWN-0.0.0"... even with easy_install... because not much changed except the shift from imperative to declarative config.

Oh! That could be it... if you have a version of setuptools that doesn't support declarative config (30.4 or later I believe), the package name would not be present. I suspect that's the issue. Can you confirm you have an older version of setuptools?

@jaraco
Copy link
Contributor

jaraco commented Feb 14, 2019

Given that this is flagged as urgent, and given that the 4.3 release wasn't at all an important release, I'd like to pull it from PyPI. I worry if I pull it from PyPI, I won't have a good path to test to avoid this issue. Perhaps I could re-release it as 5.0 some time after packages that rely on it have had a chance to pin against it.

Thoughts?

@brandon-leapyear
Copy link
Author

Yes, I have setuptools 28.8.0. I'm using Python 3.6.3 from Anaconda. Unsure how to upgrade setuptools.

I agree, this is breaking a lot of things, and we are currently going through a release cycle, so we desperately need our CI working. I think you should pull it from PyPI, search for all packages using pytest-runner in setup_requires, make sure they all pin pytest-runner in setup_requires, and re-release with a major release at some point

@brandon-leapyear
Copy link
Author

Alternatively, I just checked that pip install -U setuptools works. This is not URGENT for us anymore, but I would still recommend pulling from PyPI until you give advanced notice to other packages that pytest-runner will soon require setuptools >= 30.4

@brandon-leapyear brandon-leapyear changed the title [URGENT] 4.3 breaks installs 4.3 breaks installs for old setuptools Feb 14, 2019
@jaraco
Copy link
Contributor

jaraco commented Feb 14, 2019

I’ve pulled the 4.3 release .

jaraco added a commit that referenced this issue Feb 14, 2019
@jaraco
Copy link
Contributor

jaraco commented Feb 14, 2019

I've re-released pytest-runner 4.2 as 4.3.1 to ensure it supersedes the 4.3 release. I've furthermore added a change note in that release that 5.x (or later) will drop support. I do worry that even when releasing a 5.x release, projects are unlikely to have seen the advance notice.

@jaraco jaraco closed this as completed Feb 14, 2019
@jaraco jaraco changed the title 4.3 breaks installs for old setuptools Declarative config breaks installs for old setuptools Feb 14, 2019
@jaraco
Copy link
Contributor

jaraco commented Feb 14, 2019

Now that I think about it, pytest-runner can probably warn if it's launched under a setuptools that can't support declarative config.

@jaraco
Copy link
Contributor

jaraco commented May 23, 2019

This issue was addressed in 4.4 with a warning that should be emitted. Projects that can't ensure setuptools 30.4 or later need to pin to pytest-runner < 5.

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

jaraco commented May 23, 2019

Pytest-runner 5 is releasing today also. Please update your projects.

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

No branches or pull requests

2 participants