[Bug]: matplotlib __init__.py checks for .git folder 2 levels up, then errors due to setup tools_scm · Issue #23114 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: matplotlib __init__.py checks for .git folder 2 levels up, then errors due to setup tools_scm #23114

Description

@JohnAtl

Bug summary

My Uni deployed packages for me, which they store using git. Their .git folder happens to be two levels up from __init__.py, which see the folder and then requires setuptools_scm, which is not available in our cluster's environment.

Code for reproduction

Create .git folder two levels up from __init__.py .

Actual outcome

...
File /usr/local/pace-apps/manual/packages/nipype/1.7.1/matplotlib/__init__.py:168, in _get_version()
   166 root = Path(__file__).resolve().parents[2]
   167 if (root / ".git").exists() and not (root / ".git/shallow").exists():
--> 168     import setuptools_scm
   169     return setuptools_scm.get_version(
   170         root=root,
   171         version_scheme="release-branch-semver",
   172         local_scheme="node-and-date",
   173         fallback_version=_version.version,
   174     )
   175 else:  # Get the version from the _version.py setuptools_scm file.

ModuleNotFoundError: No module named 'setuptools_scm'

Expected outcome

No errors, no requirement for setuptools_scm.

Additional information

New setup on our PACE-ICE cluster.
Not sure how they installed it.

Operating system

Linux

Matplotlib Version

3.5.1

Matplotlib Backend

agg

Python version

3.8.8

Jupyter version

6.4.11

Installation

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions