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

[BUG] There should not be any direct_url.json file in Python packages. #533

Open
fabcor-maxiv opened this issue Apr 10, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@fabcor-maxiv
Copy link

Describe the bug
The created recipes do not take care of removing the direct_url.json file that ends up being created by pip during the build process.

To Reproduce
Let Grayskull create a recipe for a Python package (grayskull pypi PackageName) and build the package. The resulting package contains a direct_url.json file in site-packages/PackageName-1.2.3.dist-info.

Expected behavior
No direct_url.json file should be present in site-package/PackageName-1.2.3.dist-info (in the package nor once installed on disk).

Outputs
The recipe created looks like this:

build:                                                                          
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation

It probably should look like this:

build:                                                                          
  script:
    - {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
    - find <site-packages-path> -delete -name direct_url.json

Environment

  • grayskull --version
    • 2.5.3

Additional context
I am not too familiar with conda packaging ecosystem, so it might well be that I am misunderstanding a whole bunch of things.

The specification regarding direct_url.json is here: https://packaging.python.org/en/latest/specifications/direct-url/#direct-url

As far as I can tell, there really should not be any direct_url.json file in site-package/PackageName-123.dist-info when installing from repository. This file should be created only "when installing a distribution from a requirement specifying a direct URL reference (including a VCS URL)". I am not sure how well that translates into the conda side of things. But for sure it causes some incompatibilities.

I am honestly not sure what part of the process is at fault here. Is it the recipe creator, the package builder, or the conda installer? Maybe it would help if pip had an option flag to bypass the creation of this file, but as far as I can tell pip is not doing anything wrong, here.

Some references:

@fabcor-maxiv fabcor-maxiv added the bug Something isn't working label Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant