warpnet / salt-lint

A command-line utility that checks for best practices in SaltStack.
https://salt-lint.readthedocs.io/en/latest/
MIT License
152 stars 39 forks source link

Python 3.6.x is EOL and no longer supported. #304

Closed major0 closed 1 year ago

major0 commented 1 year ago

Describe the bug Python 3.6 is end-of-life and appears to be breaking installation of salt-lint?

https://endoflife.date/python

An unexpected error has occurred: CalledProcessError: command: ('/home/runner/.cache/pre-commit/reporr1pgmpm/py_env-python3/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing /home/runner/.cache/pre-commit/reporr1pgmpm
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'error'

stderr:
      error: subprocess-exited-with-error

      × python setup.py egg_info did not run successfully.
      │ exit code: 1
      ╰─> [1 lines of output]
          error in salt-lint setup command: 'python_requires' must be a string containing valid version specifiers; Invalid specifier: '>=3.6.*'
          [end of output]

      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.

Check the log at /home/runner/.cache/pre-commit/pre-commit.log
rreuvekamp commented 1 year ago

Invalid specifier: '>=3.6.*'

This seems key. We're also effected, even though we're not running 3.6 (at least, I hope)

major0 commented 1 year ago

Yah, the culprit looks to be here: https://github.com/warpnet/salt-lint/blob/main/setup.py#L61

edggoncalves commented 1 year ago

After forking the repository and replacing that with 3.8, I still observe the same behavior.

czyszCTDS commented 1 year ago

Noticed this bug in our CI pipeline today and tracked it as an intended change from packaging: https://github.com/pypa/packaging/issues/645

The fix is probably to drop the *: python_requires='>=3.6'

roaldnefs commented 1 year ago

Thanks @czyszCTDS your suggestion. Let's give you suggestion a try, removing the wildecard (*) shouldn't have any impact on the accepted version numbers as both >=3.6 and >=3.6.* should be equal.

roaldnefs commented 1 year ago

The updated python_requires definition has been released in v0.9.2.

czyszCTDS commented 1 year ago

Thank you! I can confirm the new version installs properly in our CI environment.