Repository navigation
Closed
Description
Bug summary
When adding matplotlib 3.8.0 to a poetry project, setuptools-scm and setuptools are installed and added to the list of dependencies. This was not the case with versions <= 3.7.2.
poetry version 1.6.1 was used.
Code for reproduction
poetry new poetry-demo
cd poetry-demo
poetry add matplotlibActual outcome
Using version ^3.8.0 for matplotlib
Updating dependencies
Resolving dependencies... (0.5s)
Package operations: 17 installs, 0 updates, 0 removals
• Installing numpy (1.25.2)
• Installing packaging (23.1)
• Installing setuptools (68.2.2)
• Installing six (1.16.0)
• Installing tomli (2.0.1)
• Installing typing-extensions (4.8.0)
• Installing zipp (3.17.0)
• Installing contourpy (1.1.1)
• Installing cycler (0.11.0)
• Installing fonttools (4.42.1)
• Installing importlib-resources (6.1.0)
• Installing kiwisolver (1.4.5)
• Installing pillow (10.0.1)
• Installing pyparsing (3.1.1)
• Installing python-dateutil (2.8.2)
• Installing setuptools-scm (8.0.3)
• Installing matplotlib (3.8.0)
Writing lock fileExpected outcome
This is the outcome when installing matplotlib 3.7.2 with poetry add matplotlib==3.7.2 :
Updating dependencies
Resolving dependencies... Downloading https://files.pythonhosted.org/packages/72/7d/2ad1b94106f8b1971d1eff0ebb97a81d980c448732a3e624bba281bd274d/matplotlib-3.7.2-cp310-cp310-macosx_10Resolving dependencies... Downloading https://files.pythonhosted.org/packages/72/7d/2ad1b94106f8b1971d1eff0ebb97a81d980c448732a3e624bba281bd274d/matplotlib-3.7.2-cp310-cp310-macosx_10Resolving dependencies... (1.0s)
Writing lock file
Package operations: 13 installs, 0 updates, 0 removals
• Installing numpy (1.25.2)
• Installing six (1.16.0)
• Installing zipp (3.17.0)
• Installing contourpy (1.1.1)
• Installing cycler (0.11.0)
• Installing fonttools (4.42.1)
• Installing importlib-resources (6.1.0)
• Installing kiwisolver (1.4.5)
• Installing packaging (23.1)
• Installing pillow (10.0.1)
• Installing pyparsing (3.0.9)
• Installing python-dateutil (2.8.2)
• Installing matplotlib (3.7.2)Additional information
No response
Operating system
Ubuntu, Windows
Matplotlib Version
3.8.0
Matplotlib Backend
No response
Python version
3.9.13
Jupyter version
No response
Installation
None
Reacted by Mikuláš Poul
Activity
oscargus commentedon Sep 27, 2023
From a quite quick check there is no obvious reason for this. Both those packages are added a build-only dependencies
matplotlib/pyproject.toml
Lines 1 to 9 in 11aa656
But that has not changed between 3.7.2 and 3.8.0.
This leaves the option that
tomliortyping-extensions(which are also added to the list) pull them in(?).ksunden commentedon Sep 27, 2023
This should only be true for source installs
, any chance you did this from an environment with a source install? (Not sure where poetry picks up the dependencies, from local install or from pypi package)(I wrote this question early on, but figured it out as I kept looking)I spot checked a wheel from pypi, and setuptools does not appear in the METADATA file there.
In a fresh virtualenv, pip does not pull in setuptools/setuptools-scm.
Certainly we have logic which does add setuptools-scm as a dependency (and recently added setuptools explicitly because of version conflicts), but that is only added if
.gitis found.matplotlib/setup.py
Lines 346 to 349 in 11aa656
But that logic is not new for 3.8.
From reading the poetry faq it looks like they do the pypi JSON API. and from looking at that, I do see
setuptools_scm. Which we don't set anywhere, and I'm not sure where it is pulling that from.Looking at the versioned json api:
nullThis traces back to the
PKG-INFOfile in thesdist, which setuptools newly started including forsdists in v68.2.0ksunden commentedon Sep 27, 2023
I think the action item here is to set the environment variable
CIBUILDWHEEL=1for the CI generated sdists (and then upload that one and not a locally generated one, but that part is already in the plans, I think, now that we cannot sign the files for PyPI).ksunden commentedon Oct 9, 2023
Closed by #27022