python / python/cpython

Building on Windows should remove all `__pycache__`

Open
#93,783 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build OS-windows type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

The file Makefile.pre.in already has this target:

pycremoval:
	-find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
	-find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'

It would be useful to have an equivalent on Windows.

Pitch

This would be helpful when iterating on compiler/bytecode, instead of manually bumping the magic number at each build or manually removing all pycs. It's easy to forget and think there's a bug when in reality the .pyc files are just stale.

Contributor guide

Open the contributing guide

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 with the existing pycremoval target in Makefile.pre.in and identify the Windows build entry point that provides equivalent cleanup. Ensure the Windows workflow removes pycache directories and *.py[co] files, then verify the cleanup can be used during compiler or bytecode iteration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.