Skip to content
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

BadDependencyError when assigning an inherited classmethod to a variable #1840

Open
Avasam opened this issue Nov 18, 2024 · 0 comments
Open

Comments

@Avasam
Copy link

Avasam commented Nov 18, 2024

See https://github.com/python/typeshed/pull/12991/files#diff-75dfb84f0ad6ea28f6880f12c95f276b475cd3f908f0efaaee59217a16de05a3L57-R60
Permalink: https://github.com/Avasam/typeshed/blob/063be1660a9589c1c07fb6e96af275c822d42789/stubs/setuptools/setuptools/__init__.pyi#L58-L59

Replacing

from .discovery import _Finder
find_packages = _Finder.find
find_namespace_packages = _Finder.find

With

from .discovery import PackageFinder, PEP420PackageFinder
find_packages = PackageFinder.find
find_namespace_packages = PEP420PackageFinder.find

Where those classes are defined as:

class _Finder:
    ALWAYS_EXCLUDE: ClassVar[tuple[str, ...]]
    DEFAULT_EXCLUDE: ClassVar[tuple[str, ...]]
    @classmethod
    def find(cls, where: StrPath = ".", exclude: Iterable[str] = (), include: Iterable[str] = ("*",)) -> list[str]: ...

class PackageFinder(_Finder):
    ALWAYS_EXCLUDE: ClassVar[tuple[str, ...]]

class PEP420PackageFinder(PackageFinder): ...

Causes the following errors https://github.com/python/typeshed/actions/runs/11769652125/job/32780972631?pr=12991#step:8:1937

stubs/fanstatic/fanstatic/__init__.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/fanstatic/fanstatic/compiler.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/fanstatic/fanstatic/publisher.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/fanstatic/fanstatic/registry.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/fanstatic/fanstatic/wsgi.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/libsass/sassutils/distutils.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/setuptools/setuptools/__init__.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/setuptools/setuptools/build_meta.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/setuptools/setuptools/command/easy_install.pyi (3.12): pytype.load_pytd.BadDependencyError: Unknown module setuptools, referenced from 'setuptools.command.easy_install'

stubs/setuptools/setuptools/command/editable_wheel.pyi (3.12): pytype.load_pytd.BadDependencyError: Unknown module setuptools, referenced from 'setuptools.command.editable_wheel'

stubs/setuptools/setuptools/command/egg_info.pyi (3.12): pytype.load_pytd.BadDependencyError: Unknown module setuptools, referenced from 'setuptools.command.egg_info'

stubs/setuptools/setuptools/command/test.pyi (3.12): pytype.load_pytd.BadDependencyError: No PEP420PackageFinder.find in module setuptools.discovery, referenced from 'setuptools'

stubs/setuptools/setuptools/discovery.pyi (3.12): pytype.load_pytd.BadDependencyError: Unknown module setuptools, referenced from 'setuptools.dist'

stubs/setuptools/setuptools/dist.pyi (3.12): pytype.load_pytd.BadDependencyError: Unknown module setuptools, referenced from 'setuptools.dist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant