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

Support setuptools custom discovery #69

Open
zsol opened this issue Sep 3, 2022 · 1 comment
Open

Support setuptools custom discovery #69

zsol opened this issue Sep 3, 2022 · 1 comment

Comments

@zsol
Copy link

zsol commented Sep 3, 2022

Some popular projects (e.g. frozenlist being in the top50 on PyPI) use setuptools' custom package discovery mechanism.

@thatch
Copy link
Member

thatch commented Sep 3, 2022

Could you provide a little more information about how you're using it, and what is incorrect? I suspect you're reading Distribution.packages and seeing ["find:"] which is what the project gave. If you're interested in the more interpreted version of that value, you probably want Distribution.packages_dict or Distribution.source_mapping. (Note: 0.8.0 doesn't print source_mapping from the cli, but 0.9.0b2 or main does.)

The "version mismatch" problem we've noted internally comes from something similar, being tracked in #4 -- depending on your application for the data, you might want to know that it's being read from a file, and if so which file, or you might just want the numeric result.

Related, dowsing currently doesn't emulate anything related to package_data (because it's complex, easy to get wrong, and it's far safer to just include everything under a top-level dir). See comment at https://github.com/python-packaging/dowsing/blob/main/dowsing/types.py#L113 (and your py.wtf might be the "some people" it refers to).

Future work:

See #70 for an overview of where I'd like to spend my time.

I'm mostly lacking test cases for the IDIC of setuptools-isms. If you have more, please send them my way! I've done a near-full analysis of pypi a couple of years ago focused on buildability from source, and may well do another on dowsing accuracy next chance I have good internet.

I also think it would be interesting to produce a package_dir and top-level mapping for all projects as a static json file you could just grab. I was able to fill in some gaps in static extraction by building in a well-stocked VM that has numpy, cffi, etc preinstalled in my last experiment. My various projects are increasinly interdependent (dowsing started out from a need in opine and checkdeps only knows about already-installed projects).

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

2 participants