saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.18k stars 5.48k forks source link

[FEATURE REQUEST] ship pythonnet==3.0.0 with the Windows minions #62874

Open lubyou opened 2 years ago

lubyou commented 2 years ago

Hi,

Is your feature request related to a problem? Please describe. pythonnet 3.0 is finally out, it has a bunch of fixes and improvements, including support for python > 3.8.

Describe the solution you'd like Replace pythonnet==2.5.2 with pythonnet==3.0.0 for the Windows minions

Describe alternatives you've considered Install pythonnet==3.0.0 via pip, it breaks salt.

Additional context

Salt Version:
          Salt: 3004.2

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: 4.0.7
     gitpython: 3.1.18
        Jinja2: 2.10.1
       libgit2: Not Installed
      M2Crypto: Not Installed
          Mako: 1.1.4
       msgpack: 0.6.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: 2.20
      pycrypto: Not Installed
  pycryptodome: 3.10.1
        pygit2: Not Installed
        Python: 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)]
  python-gnupg: 0.4.7
        PyYAML: 5.4.1
         PyZMQ: 19.0.0
         smmap: 4.0.0
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.2

System Versions:
          dist:   
        locale: cp1252
       machine: AMD64
       release: 2012ServerR2
        system: Windows
       version: 2012ServerR2 6.3.9600 SP0 Multiprocessor Free
OrangeDog commented 2 years ago

it breaks salt

Then that certainly needs fixing before Salt ships it.

lubyou commented 2 years ago

it breaks salt

Then that certainly needs fixing before Salt ships it.

I should clarify - it breaks the minion due to defined dependencies:

C:\Program Files\Salt Project\Salt\bin\Scripts>pip install pythonnet==3.0.0
Collecting pythonnet==3.0.0
  Using cached pythonnet-3.0.0-py3-none-any.whl (278 kB)
Requirement already satisfied: clr-loader<0.3.0,>=0.2.2 in c:\program files\salt project\salt\bin\lib\site-packages (fro
m pythonnet==3.0.0) (0.2.3)
Requirement already satisfied: cffi>=1.13 in c:\program files\salt project\salt\bin\lib\site-packages (from clr-loader<0
.3.0,>=0.2.2->pythonnet==3.0.0) (1.14.6)
Requirement already satisfied: pycparser in c:\program files\salt project\salt\bin\lib\site-packages (from cffi>=1.13->c
lr-loader<0.3.0,>=0.2.2->pythonnet==3.0.0) (2.20)
WARNING: The candidate selected for download or install is a yanked version: 'pythonnet' candidate (version 3.0.0 at htt
ps://files.pythonhosted.org/packages/a6/9d/536b48354e44834ef7651e08152d40e0accbb5de492d88d371e5b7b45884/pythonnet-3.0.0-
py3-none-any.whl#sha256=6ee55d8e2720ddf9eeef1d88e61be3c6e63d94026eee0696d3696d81faa18fe6 (from https://pypi.org/simple/p
ythonnet/))
Reason for being yanked: Is missing python_requires and thus installs on unsupported versions
Installing collected packages: pythonnet
  Attempting uninstall: pythonnet
    Found existing installation: pythonnet 2.5.2
    Uninstalling pythonnet-2.5.2:
      Successfully uninstalled pythonnet-2.5.2
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviou
r is the source of the following dependency conflicts.
salt 3004.2 requires pythonnet==2.5.2, but you have pythonnet 3.0.0 which is incompatible.
Successfully installed pythonnet-3.0.0
WARNING: There was an error checking the latest version of pip.

C:\Program Files\Salt Project\Salt\bin\Scripts>cd ..

C:\Program Files\Salt Project\Salt\bin>cd ..

C:\Program Files\Salt Project\Salt>salt-call.bat --local --version
Traceback (most recent call last):
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 800, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pythonnet 3.0.0 (c:\program files\salt project\salt\bin\lib\site-packages), Re
quirement.parse('pythonnet==2.5.2'), {'salt'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Salt Project\Salt\bin\Scripts\salt-call", line 4, in <module>
    __import__('pkg_resources').run_script('salt==3004.2', 'salt-call')
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 3272, in _initialize_m
aster_working_set
    working_set = WorkingSet._build_master()
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 596, in _build_from_re
quirements
    dists = ws.resolve(reqs, Environment())
  File "C:\Program Files\Salt Project\Salt\bin\lib\site-packages\pkg_resources\__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pythonnet==2.5.2' distribution was not found and is required by salt

C:\Program Files\Salt Project\Salt>