🐛 Differentiate transitive dependencies from direct third-party deps versus local deps
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Start at parse_requirements and use the provided test_nested_deps example to trace how direct, transitive, third-party, and local-module dependencies are classified. The work is done when the expected requirements and extras_require assertions pass, with PyYaml remaining in common requirements rather than the nested module's extras.
Written by the indexing model from the issue text.
Description
Describe the bug
A clear and concise description of what the bug is.
😆
Ok, this one is gross: With the fix in #49, a direct dependency held on a parent module that was also held on a child module would be correctly placed into the common dependency set because it is needed directly by the parent. This is, unfortunately, only a first-order fix since this same situation can occur when the dependency is needed by a Third Party dependency held directly by the parent rather than a local child sub-module.
This is only a problem if the requirements list given to parse_requirements includes the transitive dependency that is only used by the Third Party dependency and is NOT used anywhere inside of the local library. This is a very unlikely circumstance, but it could conceivably arise if the Third party dependency has an open version range for the transitive dependency, but the local library needs to pin that version for some valid reason (like a security patch)..
Platform
Please provide details about the environment you are using, including the following:
- Interpreter version:
- Library version:
Sample Code
def test_nested_deps():
"""Make sure that direct depencencies show up in requirements
for nested modules
"""
requirements, extras_require = parse_requirements(
["sample_lib", "PyYaml", "alchemy-logging"],
"direct_dep_nested",
["direct_dep_nested.nested", "direct_dep_nested.nested2"]
)
Expected behavior
The PyYaml dependency should be in the common requirements because it's needed transitively by sample_lib which is needed directly by the top-level direct_dep_nested module.
assert requirements == sorted(["alchemy-logging", "sample_lib"])
assert extras_require == {
"all": sorted(["sample_lib", "PyYaml", "alchemy-logging", "PyYaml"]),
"direct_dep_nested.nested": [],
"direct_dep_nested.nested2": [],
}
Observed behavior
The PyYaml dependency is placed into the extras for direct_dep_nested.nested because it's held as an extra set and PyYaml is not allocated as a direct dependency of the top-level direct_dep_nested module.
assert requirements == sorted(["alchemy-logging", "sample_lib"])
assert extras_require == {
"all": sorted(["sample_lib", "PyYaml", "alchemy-logging"]),
"direct_dep_nested.nested": ["PyYaml"],
"direct_dep_nested.nested2": [],
}
Additional context
Discovered when trying to write a test case for https://github.com/IBM/import-tracker/pull/53 with @prashantgupta24
- Dominant language
- Python
- Stars
- 460
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IBM/import-tracker
-
stage/010-actionable stage/stalled
Difficulty 1/5 Under an hour Newbie friendliness 62/100
IBM/import-tracker#68 ·
-
security stage/010-actionable stage/stalled
Difficulty 4/5 3-5 days Newbie friendliness 45/100
IBM/import-tracker#86 ·
-
stage/010-actionable stage/stalled
Difficulty 5/5 Over a week Newbie friendliness 20/100
IBM/import-tracker#70 ·
-
Error when trying to see dependencies of torchMay be free again @AtharvRG claimed this 34 days ago, and no pull request is open. Opengood first issue help wanted stage/010-actionable stage/stalled
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
IBM/import-tracker#55 · 2 comments ·
-
Support for multiple extras sets with the same libraryMay be free again @AtharvRG claimed this 33 days ago, and no pull request is open. Opengood first issue help wanted stage/010-actionable stage/stalled
Difficulty 5/5 Over a week Newbie friendliness 30/100
IBM/import-tracker#19 · 3 comments ·
All issues in IBM/import-tracker
Similar issues
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
future-agi/future-agi#5908 ·
Maintainers usually reply within 1 day
-
Placeholder export disables HTML image input for picture descriptionPossibly taken @cloudiful claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
docling-project/docling-serve#817 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
Parse truncated verbose GC logs up to the first XML errorPossibly taken A pull request linked to this issue is open or already merged. Openbug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days