-
Hi all, This question relates to the pre/post-processing tools of DAMASK. Say I want to run the test suite against an editable install of the DAMASK/python directory. What is the canonical way of doing this? I'm getting the following error since the version is not PEP 440 compatible: $ git clone git@github.com:damask-multiphysics/DAMASK.git
...
$ cd DAMASK/python
$ pip install -e .
(damask312) hakon:python [master] $ pip install .
Processing /Users/hakon/kode/personal/DAMASK/python
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [46 lines of output]
Traceback (most recent call last):
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 589, in _parse_version
Version(version)
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/_vendor/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: '3.0.0-159-g649170de5'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/homebrew/Caskroom/miniforge/base/envs/damask312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/opt/homebrew/Caskroom/miniforge/base/envs/damask312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Caskroom/miniforge/base/envs/damask312/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
self.run_setup()
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup
exec(code, locals())
File "<string>", line 1, in <module>
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 157, in setup
dist.parse_config_files()
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 604, in parse_config_files
setupcfg.parse_configuration(
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 193, in parse_configuration
meta.parse()
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 506, in parse
section_parser_method(section_options)
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 481, in parse_section
self[name] = value
~~~~^^^^^^
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 299, in __setitem__
parsed = self.parsers.get(option_name, lambda x: x)(value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/pw/922n1x9d1_941f372c96y5t00000gn/T/pip-build-env-fong7g_6/overlay/lib/python3.12/site-packages/setuptools/config/setupcfg.py", line 591, in _parse_version
raise OptionError(
distutils.errors.DistutilsOptionError: Version loaded from file: damask/VERSION does not comply with PEP 440: 3.0.0-159-g649170de5
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Not installing in editable mode as described in the installation docs results in the same error. Versions: $ cat DAMASK/VERSION
3.0.0-159-g649170de5
$ pip -V
pip 24.2 from /opt/homebrew/Caskroom/miniforge/base/envs/damask312/lib/python3.12/site-packages/pip (python 3.12)
$ python -V
Python 3.12.7 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@hakonanes thanks for reporting. I can confirm this issue, which is due to our Normally (since the processing tools are completely Python-based) it suffices to add the location of the module to |
Beta Was this translation helpful? Give feedback.
@hakonanes thanks for reporting.
I can confirm this issue, which is due to our
git describe
-based generation of version strings for development versions. The information on https://damask-multiphysics.org/dev/installation/source_code will be updated soon with the following information:Normally (since the processing tools are completely Python-based) it suffices to add the location of the module to
PYTHONPATH
. For a pip install (which also handles dependencies) one has to update the VERSION file manually. For that, sed with's/-/.dev/;s/-g/+/'
can be used.