Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3000 fails to install in conda env #56184

Closed
raddessi opened this issue Feb 17, 2020 · 4 comments
Closed

v3000 fails to install in conda env #56184

raddessi opened this issue Feb 17, 2020 · 4 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-low 4th level, cosemtic problems, work around exists v3000.1 vulnerable version
Milestone

Comments

@raddessi
Copy link
Contributor

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.

@raddessi
Copy link
Contributor Author

Can set up a pr if that moves things along, just let me know :) thanks

@waynew
Copy link
Contributor

waynew commented Feb 19, 2020

@raddessi thanks for the report!

@s0undt3ch could you take a look at this?

@s0undt3ch
Copy link
Collaborator

Yes, loose version can be used here and is the right fix.

A PR is always welcomed @raddessi, Thank You!

@raddessi
Copy link
Contributor Author

No problem, this PR installs fine for me locally now.

@dwoz dwoz added Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-low 4th level, cosemtic problems, work around exists labels Feb 25, 2020
@sagetherage sagetherage added the v3000.1 vulnerable version label Feb 25, 2020
@sagetherage sagetherage added this to the Approved milestone Feb 25, 2020
@Ch3LL Ch3LL closed this as completed Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE severity-low 4th level, cosemtic problems, work around exists v3000.1 vulnerable version
Projects
None yet
Development

No branches or pull requests

6 participants