Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JohnAtl opened this issue May 23, 2022 · 2 comments · Fixed by #23144
Milestone

Comments

@JohnAtl
Copy link

JohnAtl commented May 23, 2022

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

@jklymak
Copy link
Member

jklymak commented May 24, 2022

@JohnAtl your uni actually puts a .git inside package directories? It seems strange that they would version control an external package they have downloaded from pip.

ping @timhoffm - _get_version() maybe need a provisional import here, or we need some other way to know if we are on a development build or not.

timhoffm added a commit to timhoffm/matplotlib that referenced this issue May 26, 2022
Closes matplotlib#23114, where somebody has installed matplotlib into another
git repo.
timhoffm added a commit to timhoffm/matplotlib that referenced this issue May 26, 2022
Closes matplotlib#23114, where somebody has installed matplotlib into another
git repo.
timhoffm added a commit to timhoffm/matplotlib that referenced this issue May 26, 2022
Closes matplotlib#23114, where somebody has installed matplotlib into another
git repo.
@tacaswell
Copy link
Member

That is a .... strong choice on the part of who ever runs your cluster, but I can see how they got there. So long as they exclude the pyc files it might not ever get too outrageously big.

@tacaswell tacaswell added this to the v3.5.3 milestone May 26, 2022
andrew-fennell pushed a commit to andrew-fennell/matplotlib that referenced this issue Jun 14, 2022
Closes matplotlib#23114, where somebody has installed matplotlib into another
git repo.
jklymak pushed a commit to jklymak/matplotlib that referenced this issue Jun 24, 2022
Closes matplotlib#23114, where somebody has installed matplotlib into another
git repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants