linkedin / linkedin/pygradle

pivy-importer doesn't import requirements from .zip sdist

Open Beginner friendly
#273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
603
Forks
142
PR merge metrics
No merged PRs in 30d

Description

When using pivy importer to download the PyPi package networkx-2.2, it doesn't download the `decorator>=4.3.0` dependency declared in networkx.egg-info/requires.txt:

```
$ java -jar pivy-importer-0.9.9-all.jar --debug --repo build/local-ivy-repo networkx:2.2

14:07:22.075 DEBUG c.l.p.importer.pypi.PypiApiCache - Metadata url: https://pypi.org/pypi/networkx/json
14:07:22.920 INFO c.l.p.importer.deps.SdistDownloader - Pulling in networkx:2.2
14:07:22.973 DEBUG c.l.p.i.d.SourceDistPackage - requires:
14:07:23.029 INFO c.l.python.importer.ImporterCLI - Execution Finished!
```

This might be because `explodeZipForRequiresText` (https://github.com/linkedin/pygradle/blob/9152d80467c05fdb419bb8964064d5bd473d9af2/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy#L90) searches for `.egg-info/requires.txt` using only module name unlike `explodeTarForRequiresText` (https://github.com/linkedin/pygradle/blob/9152d80467c05fdb419bb8964064d5bd473d9af2/pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy#L95), and seems to be incorrect. I'm happy to create a PR if you agree.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pivy-importer/src/main/groovy/com/linkedin/python/importer/distribution/SourceDistPackage.groovy, comparing explodeZipForRequiresText with explodeTarForRequiresText. Reproduce with the networkx:2.2 command from the issue, then verify that decorator>=4.3.0 from the zip sdist's networkx.egg-info/requires.txt is imported.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, python
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.