matplotlib / matplotlib/matplotlib

Tests in Distribution Files

Open
#30,833 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Maintenance status: needs comment/discussion
Dominant language
Python
Stars
23.2k
Forks
8.5k
Avg merge
1d 6h
Merged PRs (30d)
66

Description

This may be a stupid question, but I don't see the reason why this is the case.

I was running the following (essentially checking out matplotlib in a venv)
```bash
uv init example
cd example
uv add matplotlib
```
This created a new repo with a virtual environment.
When I was checking out `example/.venv/lib/python3.13/site-packages/matplotlib` I found the `tests` directory with a bunch of `pytest` files.
Basically, [these files](https://github.com/matplotlib/matplotlib/tree/main/lib/matplotlib/tests) seem to be distributed.
I then ran `du -h` and found out that the tests alone amass to just about `2MB`.
This seems to be a lot of wasted disk space.

Therefore, my questions.
- Are these tests actually used in the distributed package?
- Would it make sense to exclude them from the distribution, if they are not used by any user anyway?

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 by inspecting lib/matplotlib/tests and the packaging configuration that produces the matplotlib distribution installed through uv. Check whether the distributed tests are required by any supported workflow and measure the resulting package contents. Done means the issue has a documented answer and, if appropriate, an agreed packaging change with validation that the installed package still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.