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 .gitfoldertwolevelsupfrom__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.
@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.
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.
Activity
jklymak commented on 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.
Only import setuptools_scm when we are in a matplotlib git repo
Only import setuptools_scm when we are in a matplotlib git repo
Only import setuptools_scm when we are in a matplotlib git repo
tacaswell commented on May 26, 2022
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.
Only import setuptools_scm when we are in a matplotlib git repo
Only import setuptools_scm when we are in a matplotlib git repo
Only import setuptools_scm when we are in a matplotlib git repo