The Makefile runs python at parse time for every target

Closed Beginner friendly
#1,291 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1298 by @isaaclimmy — merged

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
build-system

Research direction

Read Makefile at the XDIST and XDIST_ENV definitions. Change the variable evaluation so Python runs only for targets that use it, keeping both variables consistent. Done means make help starts no interpreter, verified with the failing-Python-on-PATH test described in the issue.

Written by the indexing model from the issue text.

Description

enhancement good first issue tooling

Where: Makefile (XDIST).

Current gap: XDIST := $(shell python3 -c ...) is evaluated whenever make reads the file, so even make help or make -n lint starts a Python interpreter just to decide whether pytest-xdist is installed.

Suggested approach: Use a lazily evaluated variable (=) so it is only expanded by the targets that use it, and keep XDIST_ENV consistent with it.

Done when: make help starts no interpreter, checked with a test that runs it with a failing python on PATH.

Dominant language
HTML
Stars
47
Forks
45
Avg merge
2h 45m
Merged PRs (30d)
93

Getting set up

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 yakew7/Fair-Code

All issues in yakew7/Fair-Code

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.