Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unify PEP 508 marker handling across all dependency sources (incl. PEP 723) and fix marker passing to pip

Open
#456 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
tooling

Research direction

Start by reading parsing._parse_content, parsing._parse_requirement, parsing._parse_pep723, and pipmanager.install to trace how Requirement objects and install arguments are handled. Add coverage for markers from each dependency source, including a PEP 723 block, and verify that matching markers reach pip as one requirement argument without breaking editable dependencies.

Written by the indexing model from the issue text.

Description

Summary

PEP 508 environment markers (e.g. pkg==1.0; python_version < "3.6") are not handled consistently across fades' dependency-parsing paths, and the underlying install step mangles any requirement string that contains a marker. This needs a single shared fix once the relevant PRs land.

This issue tracks the follow-up work; I'll implement it in a separate PR after #452 (PEP 723) is merged.

Background

There are currently three places that turn requirement text into packaging.requirements.Requirement objects:

  • parsing._parse_content (inline # fades comments)
  • parsing._parse_requirement (manual -d deps, -r requirement files, docstrings)
  • parsing._parse_pep723 (the # /// script block, introduced in #452)

Problems

1. Marker evaluation is not shared across paths

PR #446 ("Support environment markers") adds the marker-skip logic, but as a duplicated inline block in only two functions — _parse_content and _parse_requirement:

if repo == REPO_PYPI and hasattr(dependency, 'marker') and dependency.marker is not None:
    if not dependency.marker.evaluate():
        ...
        continue

The PEP 723 path (_parse_pep723, #452) builds requirements directly:

deps[REPO_PYPI] = [Requirement(dep) for dep in dependencies]

so it never goes through that logic. If both PRs merge as-is, a # /// script block such as:

# /// script
# dependencies = ["pysha3==1.0b1; python_version < '3.6'"]
# ///

would not be filtered, even though PEP 723 explicitly defines dependencies as PEP 508 strings (markers are legal and expected there).

2. Matching markers still break pip install

The marker fix only handles the False case (skip the dep). When a marker evaluates True, the Requirement still stringifies with the marker, and pipmanager.install does:

str_dep = str(dependency)
args = [self.pip_exe, "install"] + str_dep.split()

str_dep.split() (added for multiword -e deps) shreds pkg==1.0; python_version >= "3.6" on the spaces inside the marker into separate args, which breaks the install. This is unfixed in both #446 and #452.

Proposed approach

  • Factor the marker-evaluation logic into a single shared helper (e.g. inside parse_fade_requirement, or a small _keep_for_marker(dependency) used by all three call sites) instead of duplicating it — so _parse_pep723 is covered too.
  • Fix pipmanager.install so requirements containing a marker (spaces) are passed as a single argument rather than .split()-ing them, while preserving the -e multiword behavior.
  • Add tests for markers coming from each source, including a PEP 723 block.

Related

  • #446 — Support environment markers (PEP 508) in requirements
  • #452 — Add PEP 723 inline script metadata support
  • #259 — original environment-markers report

To be implemented after #452 is merged.

Dominant language
Python
Stars
223
Forks
45
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from PyAr/fades

All issues in PyAr/fades

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.