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

requirementslib/pipenv not getting name of requirement from flint_core.buildapi #564

Open
matteius opened this issue Jun 25, 2022 · 1 comment

Comments

@matteius
Copy link
Member

Hi there, I am not super familiar with flit, but I was triaging an issue report on pipenv that brought me here. The issue that was reported (pypa/pipenv#5142) has an example reproduction repository (https://github.com/gitpushdashf/pipenv-flit-monorepo-example) that uses flint_core.buildapi for the package build. At first I thought the failure of resolving the interdependent local editable packages had to do with the existence of a pyprojecct.toml because when I deleted it and had just a setup.py, I saw that the issue was not present. However I then noticed from a diff with the test repository that pipenv/setuptools generated a pyproject.toml file anyway, just a different build_system:

+++ b/packages/foo-cli/pyproject.toml
@@ -1,9 +1,3 @@
 [build-system]
-requires = ["flit_core >=3.2,<4"]
-build-backend = "flit_core.buildapi"
-
-[project]
-name = "foo_cli"
-authors = [{name = "me", email = "me@me"}]
-dynamic = ["version", "description"]
-dependencies = ["fooy"]
+requires = ["setuptools", "wheel"]
+build-backend = "setuptools.build_meta:__legacy__"

So I had done some debugging on the pipenv code enough to realize that what is missing on the parsed Requirement (which is a requirementslib thing) that it is missing the name attribute, and quite a lot is dependent on that being in the Metadata. At this phase of my investigation, I can only assume that flit is generating metadata differently than setuptools.build_meta:__legacy__ and that the data isn't all there. I tried a search of the flit issues reports and I did not quite see one like this, and wanted to see if anyone else could shed some light on this one for me. In an ideal world anyone could use the flit build system with pipenv just fine, and so it would be nice to get to the bottom of what/where actually needs to be fixed.

@gitpushdashf
Copy link

gitpushdashf commented Jun 30, 2022

Where should this metadata come from? I wonder if the name attribute could be read from [project] but not sure if that's the right behavior.

Edit: Looks like it might come from here?

def make_metadata(module, ini_info):

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