| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Note, tox does support this already, so the stubtest job is the only one (using dependencies) that does work right now. |
Sorry, something went wrong.
There was a problem hiding this comment.
I was curious about this new PEP, so I took a look through the changes. I think this would be a really neat feature when pip implements it. I know this is just a draft, but I figured I can point out a couple things I noticed, and I had a couple of questions, too.
Sorry, something went wrong.
| python -m pip install --upgrade pip | ||
| python -m pip install --upgrade -r requirements/dev/build-requirements.txt | ||
| python -m pip install -r requirements/testing/all.txt -r requirements/testing/extra.txt | ||
| python -m pip install --group build --group test --group test-extra |
There was a problem hiding this comment.
We'll have to see if it matters whether or not we were upgrading certain dependencies or not. I suspect not.
Sorry, something went wrong.
|
|
||
| # Extra pip requirements for the Python 3.10+ builds | ||
| test-extra = [ | ||
| "--prefer-binary", |
There was a problem hiding this comment.
Will command-line arguments and sys.platform references work in this PEP? It isn't entirely clear to me.
Sorry, something went wrong.
There was a problem hiding this comment.
Ah, the command-line argument probably won't, but we'll have to see how the pip implementation ends up. The sys.platform should work as these are standard dependency specifiers.
Sorry, something went wrong.
There was a problem hiding this comment.
I learned something new! Neat!
Sorry, something went wrong.
There was a problem hiding this comment.
So unfortunately, we can't keep --prefer-binary here, so I've moved it to the CI invocation.
Sorry, something went wrong.
|
|
||
| - name: Install mypy | ||
| run: pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt | ||
| run: pip3 install --group typing |
There was a problem hiding this comment.
does this also need group "test"?
Sorry, something went wrong.
There was a problem hiding this comment.
I'm hoping not, so we can reduce the install set.
Sorry, something went wrong.
| # | ||
| # You will first need a matching Matplotlib installation | ||
| # e.g (from the Matplotlib root directory) | ||
| # pip install --no-build-isolation --editable .[dev] |
There was a problem hiding this comment.
Is the .[dev] correct? Or should it be just .?
Sorry, something went wrong.
There was a problem hiding this comment.
The [dev] is an extra, not a dependency group. It was intended to cover both build and runtime dependencies. It didn't really work though, as pip installed . before its dependencies, so you couldn't get the build ones early enough. Based on the other implementations, dependency groups should be strictly better, since they should install before ., but we'll have to see how it's finally implemented. I should probably rewrite this section a bit once that's finalized.
Sorry, something went wrong.
There was a problem hiding this comment.
Oh, I see. I'm not used to seeing an extra be specified against a directory, so I thought it was a typo. And, yeah, extras wouldn't work for installing dependencies.
Sorry, something went wrong.
There was a problem hiding this comment.
No more .[dev] now.
Sorry, something went wrong.
|
I rebased and fixed the comments. pip doesn't yet support this, but pypa/pip#13065 is scheduled for 25.1 next weekend. |
Sorry, something went wrong.
There was a problem hiding this comment.
This is also going to require pip >= 25.1 for anyone developing Matplotlib - that should at least go in some sort of release note/changelog entry, and be noted in the development setup docs.
Sorry, something went wrong.
| {include-group = "doc"}, | ||
| {include-group = "test"}, | ||
| {include-group = "test-extra"}, | ||
| "ruff", |
There was a problem hiding this comment.
pre-commit should be added here, and perhaps ruff dropped since running pre-commit runs ruff.
Sorry, something went wrong.
| "types-python-dateutil", | ||
| "types-psutil", | ||
| "sphinx", | ||
| {include-group = "build"}, |
There was a problem hiding this comment.
Given the doc and test groups dont' depend on build, I don't think typing should either, and the build group can be additionally specified during the CI install stage.
Sorry, something went wrong.
|
Added a few notes for the pip 25.1 requirement. |
Sorry, something went wrong.
|
Coming over from #30877, this branch works for a modified uv workflow: uv venv .venv
# Activate the environment (NOT optional)
source .venv/bin/activate # Linux/macOS
# or: .venv\Scripts\activate # Windows
# Install dev dependencies
uv pip install --group dev
# Install matplotlib in editable mode
uv pip install --no-build-isolation --group dev --editable .
# Verify installation
python -c "import matplotlib; print(matplotlib.__file__)"However, solving dependencies using a strict solver that tries to make a lock file (this includes uv sync or using uv run for anything) is running into repeated issues and dependency conflicts with the "test-minver" group, which go away if that group is removed. I haven't tried pixi, but I expect that this is going to happen with any tool making a lock file that tries to resolve all the dependencies in the base pyproject.toml. Could we split that group off into its own subproject? Eg something like: matplotlib/
├── pyproject.toml
└── requirements/
└── test-minver/
└── pyproject.toml
requirements/minver-test/pyproject.toml: [project]
name = "matplotlib-test-minver"
version = "0.0.0"
requires-python = ">=3.11,<3.12"
dependencies = [
"contourpy==1.0.1",
"cycler==0.10",
"fonttools==4.22.0",
"importlib-resources==3.2.0",
"kiwisolver==1.3.2",
"meson-python==0.13.1",
"meson==1.1.0",
"numpy==1.25.0",
"packaging==20.0",
"pillow==9.0.1",
"pyparsing==3.0.0",
"pytest==7.0.0",
"python-dateutil==2.7",
"ipython==7.29.0",
"ipykernel==5.5.6",
"matplotlib-inline<0.1.7",
] |
Sorry, something went wrong.
|
Consensus on call is to put the minver back in a requirments.txt as we only use it one CI test to keep things simple and unbreak uv. |
Sorry, something went wrong.
|
OK, moved the minimum version requirements to the ci directory. @scottshambaugh let me know if there are any other problems with uv. |
Sorry, something went wrong.
|
uv installation is super simple now and works without errors! # Create the environment and install (includes dev group in the env)
uv sync
# Verify installation
uv run python -c "import matplotlib; print(matplotlib.__file__)"
# OR
source .venv/bin/activate
python -c "import matplotlib; print(matplotlib.__file__)" |
Sorry, something went wrong.
|
And pixi works out of the box as well! @tacaswell FYI # Add tool.pixi sections to pyproject.toml (can skip if preconfigured)
pixi init
# Create the environment and install (creates both default and dev environments)
pixi install
# Verify installation
pixi run -e dev python -c "import matplotlib; print(matplotlib.__file__)"
# OR
pixi shell -e dev
python -c "import matplotlib; print(matplotlib.__file__)"These are the non-empty sections added to pyproject.toml with pixi init. We could add this by default to simplify setup, though platforms should be extended. I'm not as familiar with pixi so someone else should weigh in. [tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.pypi-dependencies]
matplotlib = { path = ".", editable = true }
[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" } |
Sorry, something went wrong.
|
@QuLogic were there any outstanding discussions from the call on this? IMO it's good to merge |
Sorry, something went wrong.
|
I don't recall anything, and I'm not seeing anything in the meeting notes. |
Sorry, something went wrong.
This extra was moved to dependency groups in matplotlib#29281.
This extra was moved to dependency groups in matplotlib#29281.
| Back | FazBrowse Home | New Git URL |
PR summary
PEP735 introduces the concept of "Dependency Groups"; these essentially replace our use of various requirements.txt files.
NOTE: This is waiting for pip to actually implement Dependency Groups: pypa/pip#12963 We may or may not wish to wait for that to bake a bit even after it's been implemented as well.
PR checklist