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

Please consider switching the build-system to flit_core or removing hatch-vcs to ease setuptools bootstrap #128

Closed
mgorny opened this issue Jan 16, 2023 · 4 comments

Comments

@mgorny
Copy link

mgorny commented Jan 16, 2023

Could you please consider switching the build system from setuptools to flit_core, or at least removing the hatch-vcs requirement? This would help Linux distributions such as Gentoo avoid cyclic dependencies that cause bootstrapping unbundled setuptools a real pain. If you agree, I can submit a pull request doing one or the other.

The problem is that the most recent release of setuptools (66.0.0) started using platformdirs. Hatchling has a number of dependencies using setuptools themselves, that are effectively creating a dependency cycle for us — we need platformdirs to install setuptools, platformdirs need hatchling but hatchling needs setuptools first (because of its dependencies). On top of that, hatch-vcs needs setuptools_scm which invariably needs setuptools.

flit_core is a "no dependencies [except for tomli, on Python < 3.11]" by design, so it makes bootstrapping packages much easier. Alternatively, I'm also trying to get hatchling's dependencies not to use setuptools (feels like asking a lot of favors just to get things working again…).

Unfortunately, I don't think it's possible to retain setuptools_scm-style logic. Both hatch-vcs and flit_scm packages use setuptools_scm which invariably means a cyclic dependency with setuptools.

@gaborbernat
Copy link
Member

we need platformdirs to install setuptools,

This is likely because you're trying to devendor playformdirs from setup tools that's not supported by setuptools. We don't want to change our build system either.

@gaborbernat gaborbernat closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2023
@gaborbernat
Copy link
Member

Note setuptools has no dependencies https://github.com/pypa/setuptools/blob/main/setup.cfg#L29

@mgorny
Copy link
Author

mgorny commented Jan 16, 2023

we need platformdirs to install setuptools,

This is likely because you're trying to devendor playformdirs from setup tools that's not supported by setuptools. We don't want to change our build system either.

The presence of pkg_resources.extern and setuptools.extern modules whose purpose is to wrap between loading vendored and system dependencies suggests otherwise. Do you have evidence to support that it's "not supported"?

Note setuptools has no dependencies https://github.com/pypa/setuptools/blob/main/setup.cfg#L29

This is not true. Vendoring dependencies does not make them "no dependencies". Plus, it indirectly depends on wheel breaking the PEP517 bootstrap. There's a bug open about it for years but that's not really relevant to the problem at hand.

@ofek
Copy link
Collaborator

ofek commented Jan 16, 2023

To be clear what's happening here:

On top of that, hatch-vcs needs setuptools_scm which invariably needs setuptools.

That is actually the only issue here. setuptools_scm depends on setuptools, but only for legacy backward compatibility reasons, it is now completely uncoupled. When Ronny the maintainer strips the logic into a new reusable package then the Hatchling plug-in will depend on that but nothing can be done until then.

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

3 participants