NREL / rdtools

PV Analysis Tools in Python
https://rdtools.readthedocs.io/
MIT License
158 stars 67 forks source link

Tagged version 3.0.0-pre-alpha.1 is incompatible with setuptools #364

Closed cdeline closed 1 year ago

cdeline commented 1 year ago

There's something wrong with semantic versioning using the tag 3.0.0-pre-alpha.1 in setuptools. Apparently this is a known issue, where setuptools disallows non-PEP 440 compliant tags starting in versions >= 66.0.0. I think the root cause is using dashes instead of underscores in the tag name.

Setuptools discussion here.

Current Workaround: downgrade setuptools to < 66.0.0 Long-term Solution: Use a different tag name that conforms with PEP 440

Traceback: ERROR: Command errored out with exit status 1: command: 'C:\Users\cdeline\Anaconda3\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\cdeline\AppData\Local\Temp\1\pip-req-build-yaqb4d0f\setup.py'"'"'; file='"'"'C:\Users\cdeline\AppData\Local\Temp\1\pip-req-build-yaqb4d0f\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\cdeline\AppData\Local\Temp\1\pip-pip-egg-info-icmdvbuo' cwd: C:\Users\cdeline\AppData\Local\Temp\1\pip-req-build-yaqb4d0f\ Complete output (49 lines): C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\dist.py:788: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try pip install --use-pep517. dist.fetch_build_eggs(dist.setup_requires) C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\dist.py:561: UserWarning: The version specified ('3.0.0-pre-alpha.1') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. warnings.warn( C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\dist.py:788: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running egg_info C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools_normalization.py:93: SetuptoolsDeprecationWarning: Invalid version: '3.0.0-pre-alpha.1'. !!

        ###################
        # Invalid version #
        ###################
        '3.0.0-pre-alpha.1' is not valid according to PEP 440.

        Please make sure specify a valid version for your package.
        Also note that future releases of setuptools may halt the build process
        if an invalid version is given.

!!

  warnings.warn(cleandoc(msg), SetuptoolsDeprecationWarning)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\cdeline\AppData\Local\Temp\1\pip-req-build-yaqb4d0f\setup.py", line 114, in <module>
    setup(name=DISTNAME,
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\dist.py", line 1221, in run_command
    super().run_command(command)
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\command\egg_info.py", line 220, in finalize_options
    parsed_version = packaging.version.Version(self.egg_version)
  File "C:\Users\cdeline\Anaconda3\lib\site-packages\setuptools\_vendor\packaging\version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: '3.0.0-pre-alpha.1'
cdeline commented 1 year ago

This was fixed by re-tagging as 3.0.0-a.1