Expose Marker tree structure in the API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 751
- Forks
- 324
- Avg merge
- 12h 58m
- Merged PRs (30d)
- 3
Description
I'd like to be able to use a library like packaging in Debian's dh-python, to parse environment markers, rather than having to maintain our own hacky parser.
The use-case is parsing .dist-info metadata from a built package, during the build, to generate Debian package dependencies based on the Python module's declared dependencies.
Similarly to #448, this means we're evaluating the markers for all supported environments, not just the current environment. So instead of a boolean evaluate(), we need to:
- Determine whether this dependency is required at all (boolean).
- Determine what python_version constraints are applied to the module, and emit appropriate Debian dependencies, as possible.
Examples:
Requires-Dist: foo; (os_name == 'posix')should result in a dependency onpython3-foo.Requires-Dist: bar; python_version < '3.5'should result in a dependency onpython3-bar | python3 (>= 3.5)
This means evaluate() is insufficient, for our needs. I really need to be able to walk the tree.
Can we make more of the tree structure public API?
Contributor 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.
Research direction
Start by reviewing the existing evaluate() API and the marker-tree behavior referenced by issue #448. Determine which tree structure must become public so callers can inspect all supported environments and derive dependency constraints; done means the public API supports traversal beyond a boolean evaluation, with coverage for the requested use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100