You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When using the ~= version specifier with pip.installed errors are logged. The state does run successfully, though always thinks there have been changes.
Setup
on-prem machine
VM (Virtualbox, KVM, etc. please specify)
VM running on a cloud service, please be explicit and add details
container (Kubernetes, Docker, containerd, etc. please specify)
or a combination, please be explicit
jails if it is FreeBSD
classic packaging
onedir packaging
used bootstrap to install
Steps to Reproduce the behavior
# salt-call --local state.single pip.installed name='elasticsearch ~= 7.17.6' -linfo
[INFO] Loading fresh modules for state activity
[INFO] Running state [elasticsearch ~= 7.17.6] at time 15:47:39.466748
[INFO] Executing state pip.installed for [elasticsearch ~= 7.17.6]
[INFO] Executing command /opt/saltstack/salt/salt-pip in directory '/root'
[INFO] Executing command /opt/saltstack/salt/salt-pip in directory '/root'
[ERROR] Invalid operator '~=' for version comparison
[INFO] Executing command /opt/saltstack/salt/salt-pip in directory '/root'
[INFO] Executing command /opt/saltstack/salt/salt-pip in directory '/root'
[INFO] Executing command /opt/saltstack/salt/salt-pip in directory '/root'
[INFO] {'elasticsearch==7.17.12': 'Installed'}
[INFO] Loading fresh modules for state activity
[INFO] Completed state [elasticsearch ~= 7.17.6] at time 15:47:43.298461 (duration_in_ms=3831.713)
local:
Name: elasticsearch ~= 7.17.6 - Function: pip.installed - Result: Changed - Started: 15:47:39.466748 - Duration: 3831.713 ms
Summary for local
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 3.832 s
Expected behavior
All Python package version specifiers should be handled correctly, with no errors logged.
Versions Report
salt-call --versions
Salt Version:
Salt: 3006.9Python Version:
Python: 3.10.14 (main, Jun 26 2024, 11:44:37) [GCC 11.2.0]Dependency Versions:
cffi: 1.17.1cherrypy: 18.6.1cryptography: 42.0.5dateutil: 2.8.1docker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.4libgit2: 1.7.1looseversion: 1.0.2M2Crypto: 0.38.0Mako: Not Installedmsgpack: 1.0.2msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 22.0pycparser: 2.21pycrypto: Not Installedpycryptodome: 3.19.1pygit2: 1.13.3python-gnupg: 0.4.8PyYAML: 6.0.1PyZMQ: 23.2.0relenv: 0.17.0smmap: Not Installedtimelib: 0.2.4Tornado: 4.5.3ZMQ: 4.3.4System Versions:
dist: ubuntu 24.04.1 noblelocale: utf-8machine: x86_64release: 6.8.0-47-genericsystem: Linuxversion: Ubuntu 24.04.1 noble
Additional information
There are similar issues with other specifiers, for example:
[ERROR] Comparison of package versions "7.17.12" and "7.17.*" failed: Invalid version: '7.17.*'
Traceback (most recent call last):
File "/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/pip_state.py", line 365, in _pep440_version_cmp
if pkg_resources.parse_version(pkg1) < pkg_resources.parse_version(pkg2):
File "/opt/saltstack/salt/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py", line 198, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '7.17.*'
The text was updated successfully, but these errors were encountered:
Description
When using the
~=
version specifier withpip.installed
errors are logged. The state does run successfully, though always thinks there have been changes.Setup
Steps to Reproduce the behavior
Expected behavior
All Python package version specifiers should be handled correctly, with no errors logged.
Versions Report
salt-call --versions
Additional information
There are similar issues with other specifiers, for example:
The text was updated successfully, but these errors were encountered: