twisted / towncrier

Manage the release notes for your project.

Home Page:https://towncrier.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deprecation from `click-default-group` dependency

WilliamJamieson opened this issue · comments

When installing towncrier in Python 3.11 using pip 23.0.1, I got the warning:

DEPRECATION: click-default-group is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change.
A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

I am making the issue here because click-default-group hasn't really seen much activity recently. I have opened click-contrib/click-default-group#24 there in addition to this issue.

The entirety of click-default-group are 138 lines under BSD-3, so if they're not interested to re-do their packaging, it'd be the easiest to simply vendor the relevant parts of it.

I was trying to generate some constraints files with pip-tools 7 (pip-compile) and got this:

  Collecting click-default-group (from towncrier->-r requirements/doc.in (line 7))
    Using cached click-default-group-1.2.2.tar.gz (3.3 kB)
    Preparing metadata (setup.py) ... error
    error: subprocess-exited-with-error
    
    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [1 lines of output]
        ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 64, in generate_metadata
    call_subprocess(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/utils/subprocess.py", line 224, in call_subprocess
    raise error
pip._internal.exceptions.InstallationSubprocessError: python setup.py egg_info exited with 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/piptools/scripts/compile.py", line 630, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/piptools/resolver.py", line 604, in resolve
    is_resolved = self._do_resolve(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/piptools/resolver.py", line 636, in _do_resolve
    resolver.resolve(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 230, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    if not criterion.candidates:
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
    return bool(self._sequence)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
    return any(self)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
    return (c for c in iterator if id(c) not in self._incompatible_ids)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
    candidate = func()
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
    self._link_candidate_cache[link] = LinkCandidate(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 293, in __init__
    super().__init__(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
    self.dist = self._prepare()
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
    dist = self._prepare_distribution()
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in _prepare_distribution
    return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 538, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 653, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/distributions/sdist.py", line 61, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 568, in prepare_metadata
    self.metadata_directory = generate_metadata_legacy(
  File "~/.pyenv/versions/aiohttp-pyenv-py3.8.6/lib/python3.8/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 71, in generate_metadata
    raise MetadataGenerationFailed(package_details=details) from error
pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed

So I think removal of this dependency is more than justified as it'll may cause installation problems with modern pip (v22+). Doing pip install 'pip < 22' 'pip-tools < 7' helped get through pip-compile but as more people get their pip upgraded (and wheel cache cleaned), there will be more reports like this.

FTR the author repackaged this dependency as I reached out directly.

Apparently, there was a wheel version available for a while, published by another trusted community member 🤷‍♂️
click-contrib/click-default-group#21 (comment)