As the title states, I am getting this ERROR when I run python -m build locally using a version file. I have read the PEP 440 and to me, it appears compliant. I cannot see from the documentation on setuptools why I would be running into this issue
I would really appreciate some help on this since I don't see how I am able to run a debugger on python -m build or get some more understanding of specifically why the _parse_version of setuptools/config.py is unhappy with my version file.
More details:
I have a project structured as follows:
src/
mypackage/
__init__.py
VERSION
pyproject.toml
setup.cfg
setup.py
VERSION
0.0.1
setup.cfg
name = mypackage
version = file: src/mypackage/VERSION
# etc. etc. etc.
setup.py
#!/usr/bin/env python
# Used to create editable installs
import setuptools
setuptools.setup()
pyproject.toml
[build-system]
# Minimum requirements for the build system to execute.
requires = [
"setuptools>=42",
"wheel"] # PEP 508 specifications.
build-backend = "setuptools.build_meta"
More detail on the error:
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
self.run_setup()
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 5, in <module>
setuptools.setup()
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
result = old_parse_config_files(self, *args, **kwargs)
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/dist.py", line 778, in parse_config_files
parse_configuration(self, self.command_options,
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/config.py", line 157, in parse_configuration
meta.parse()
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/config.py", line 463, in parse
section_parser_method(section_options)
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/config.py", line 436, in parse_section
self[name] = value
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/config.py", line 220, in __setitem__
value = parser(value)
File "/tmp/build-env-2kboopyp/lib/python3.8/site-packages/setuptools/config.py", line 553, in _parse_version
raise DistutilsOptionError(tmpl.format(**locals()))
distutils.errors.DistutilsOptionError: Version loaded from file: src/mypackage/VERSION does not comply with PEP 440:
ERROR Backend subproccess exited when trying to invoke get_requires_for_build_wheel