AlexsLemonade / refinebio

Refine.bio harmonizes petabytes of publicly available biological data into ready-to-use datasets for cancer researchers and AI/ML scientists.
https://www.refine.bio/
Other
129 stars 19 forks source link

Fix `Invalid version` error #3266

Closed arkid15r closed 1 year ago

arkid15r commented 1 year ago

Context

In order to complete restoring staging deploy process CI/CD tests need to be fixed.

Problem or idea

The current product versioning scheme (e.g., v1.43.3-dev-hotfix) is inconsistent with PEP 440 standards.

#13 [ 8/13] COPY common/dist/data-refinery-common-* common/
#13 DONE 0.0s

#14 [ 9/13] RUN pip3 install --ignore-installed --no-cache-dir         common/$(ls common -1 | sort --version-sort | tail -1)
#14 0.981 Processing ./common/data-refinery-common-v1.43.3-dev-hotfix.tar.gz
#14 1.013   Preparing metadata (setup.py): started
#14 1.255   Preparing metadata (setup.py): finished with status 'error'
#14 1.262   error: subprocess-exited-with-error
#14 1.262   
#14 1.262   × python setup.py egg_info did not run successfully.
#14 1.262   │ exit code: 1
#14 1.262   ╰─> [44 lines of output]
#14 1.262       running egg_info
#14 1.262       /usr/local/lib/python3.8/dist-packages/setuptools/dist.py:561: UserWarning: The version specified ('v1.43.3-dev-hotfix') 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.
#14 1.262         warnings.warn(
#14 1.262       /usr/local/lib/python3.8/dist-packages/setuptools/_normalization.py:93: SetuptoolsDeprecationWarning: Invalid version: 'v1.43.3-dev-hotfix'.
#14 1.262               !!
#14 1.262       
#14 1.262       
#14 1.262               ###################
#14 1.262               # Invalid version #
#14 1.262               ###################
#14 1.262               'v1.43.3-dev-hotfix' is not valid according to PEP 440.
#14 1.262       
#14 1.262               Please make sure specify a valid version for your package.
#14 1.262               Also note that future releases of setuptools may halt the build process
#14 1.262               if an invalid version is given.
#14 1.262       
#14 1.262       
#14 1.262       !!
#14 1.262       
#14 1.262         warnings.warn(cleandoc(msg), SetuptoolsDeprecationWarning)
#14 1.262       Traceback (most recent call last):
#14 1.262         File "<string>", line 2, in <module>
#14 1.262         File "<pip-setuptools-caller>", line 34, in <module>
#14 1.262         File "/tmp/pip-req-build-0xlfvqgi/setup.py", line 19, in <module>
#14 1.262           setup(
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 108, in setup
#14 1.262           return distutils.core.setup(**attrs)
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 185, in setup
#14 1.262           return run_commands(dist)
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
#14 1.262           dist.run_commands()
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
#14 1.262           self.run_command(cmd)
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/dist.py", line 1221, in run_command
#14 1.262           super().run_command(command)
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/dist.py", line 987, in run_command
#14 1.262           cmd_obj.ensure_finalized()
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
#14 1.262           self.finalize_options()
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/command/egg_info.py", line 220, in finalize_options
#14 1.262           parsed_version = packaging.version.Version(self.egg_version)
#14 1.262         File "/usr/local/lib/python3.8/dist-packages/setuptools/_vendor/packaging/version.py", line 197, in __init__
#14 1.262           raise InvalidVersion(f"Invalid version: '{version}'")
#14 1.262       setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'v1.43.3-dev-hotfix'
#14 1.262       [end of output]
#14 1.262   
#14 1.262   note: This error originates from a subprocess, and is likely not a problem with pip.
#14 1.265 error: metadata-generation-failed
#14 1.265 
#14 1.265 × Encountered error while generating package metadata.
#14 1.265 ╰─> See above for output.
#14 1.265 
#14 1.265 note: This is an issue with the package mentioned above, not pip.
#14 1.265 hint: See above for details.
#14 1.365 
#14 1.365 [notice] A new release of pip is available: 23.0.1 -> 23.1
#14 1.365 [notice] To update, run: python3 -m pip install --upgrade pip
#14 ERROR: process "/bin/bash -o pipefail -c pip3 install --ignore-installed --no-cache-dir         common/$(ls common -1 | sort --version-sort | tail -1)" did not complete successfully: exit code: 1
------
 > [ 9/13] RUN pip3 install --ignore-installed --no-cache-dir         common/$(ls common -1 | sort --version-sort | tail -1):
#14 1.265 error: metadata-generation-failed
#14 1.265 
#14 1.265 × Encountered error while generating package metadata.
#14 1.265 ╰─> See above for output.
#14 1.265 
#14 1.265 note: This is an issue with the package mentioned above, not pip.
#14 1.265 hint: See above for details.
#14 1.365 
#14 1.365 [notice] A new release of pip is available: 23.0.1 -> 23.1
#14 1.365 [notice] To update, run: python3 -m pip install --upgrade pip
------
Dockerfile.smasher:17
--------------------
  16 |     COPY common/dist/data-refinery-common-* common/
  17 | >>> RUN pip3 install --ignore-installed --no-cache-dir \
  18 | >>>         common/$(ls common -1 | sort --version-sort | tail -1)
  19 |     
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c pip3 install --ignore-installed --no-cache-dir         common/$(ls common -1 | sort --version-sort | tail -1)" did not complete successfully: exit code: 1
######
Finished building new images for v1.43.3-dev-hotfix
######
Docker image ccdlstaging/dr_smasher:v1.43.3-dev-hotfix doesn't exist after running update_docker_img.sh!
This is generally caused by a temporary error, please try the 'Rerun workflow' button.
Error: Process completed with exit code 1.

Solution or next step

As a quick fix I'm going to try pinning setuptools to version 65.7. In a long term perspective we'll need to migrate to valid versioning scheme.