Skip to content

v3000 fails to install in conda env #56184

Closed
@raddessi

Description

Description of Issue

Salt fails to install via pip in a conda env

Setup

conda create -n testenv python=3.6

Steps to Reproduce Issue

conda activate testenv
pip install salt==v3000

This seems to result in a version error because we are checking strict versions. Snipped traceback:

  running install
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-oy9w2_9m/salt/setup.py", line 1241, in <module>
      setup(distclass=SaltDistribution)
    File "/opt/miniconda/envs/testenv/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
      return distutils.core.setup(**attrs)
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/opt/miniconda/envs/testenv/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 259, in run
      self.run_command('install')
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-oy9w2_9m/salt/setup.py", line 704, in run
      if StrictVersion(setuptools.__version__) < StrictVersion('9.1'):
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/version.py", line 40, in __init__
      self.parse(vstring)
    File "/opt/miniconda/envs/testenv/lib/python3.6/distutils/version.py", line 137, in parse
      raise ValueError("invalid version number '%s'" % vstring)
  ValueError: invalid version number '45.2.0.post20200210'
  ----------------------------------------
  ERROR: Failed building wheel for salt

Do you know why strictversion is being used? I'm not familiar but it feels like loose should be adequate for this check, and does appear to function properly:

In [1]: from distutils.version import StrictVersion, LooseVersion                                                                 

In [2]: StrictVersion("45.2.0.post20200210") < StrictVersion("9.1")                                                               
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-1cce196e2000> in <module>
----> 1 StrictVersion("45.2.0.post20200210") < StrictVersion("9.1")

/usr/lib64/python3.7/distutils/version.py in __init__(self, vstring)
     38     def __init__ (self, vstring=None):
     39         if vstring:
---> 40             self.parse(vstring)
     41 
     42     def __repr__ (self):

/usr/lib64/python3.7/distutils/version.py in parse(self, vstring)
    135         match = self.version_re.match(vstring)
    136         if not match:
--> 137             raise ValueError("invalid version number '%s'" % vstring)
    138 
    139         (major, minor, patch, prerelease, prerelease_num) = \

ValueError: invalid version number '45.2.0.post20200210'

In [3]: LooseVersion("45.2.0.post20200210") < LooseVersion("9.1")                                                                 
Out[3]: False

In [4]:   

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Salt versions not relevant, this was found trying to upgrade from v2019.2.3 to v3000 in my conda env and is reproducable on a clean install as shown above.

Metadata

Assignees

Labels

Bugbroken, incorrect, or confusing behaviorConfirmedSalt engineer has confirmed bug/feature - often including a MCVEseverity-low4th level, cosemtic problems, work around existsv3000.1vulnerable version

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions