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

Add minimum required Python version #200

Closed

Conversation

Rotzbua
Copy link

@Rotzbua Rotzbua commented Oct 24, 2023

Change

  • Add minimum required Python version
  • Add test for every alive Python version (except broken 3.12)

Add test for every alive Python version
@coveralls
Copy link

Coverage Status

coverage: 88.889% (+1.0%) from 87.847% when pulling d7b3918 on Rotzbua:add_python_requirement into 5e9ef5d on JohannesBuchner:master.

@JohannesBuchner
Copy link
Owner

what causes this change? for both.

@JohannesBuchner
Copy link
Owner

What is the oldest python version we can support? I think it is driven by the requirements, not this package.

@Rotzbua
Copy link
Author

Rotzbua commented Oct 24, 2023

The oldest version is python 3.8. Everything else is EOL:
https://devguide.python.org/versions/

@Rotzbua
Copy link
Author

Rotzbua commented Oct 24, 2023

what causes this change? for both.

pip supports proper dependency resolution. For this it needs the supported Python versions.
Good programming paradigm: only claim to support something when it is tested.

@JohannesBuchner
Copy link
Owner

I am closing this because it is not properly justified.

Firstly, just because the Python project does not provide support for older versions, does not mean imagehash is incompatible.

Second, passing tests is a requirement for compatible versions, but there may be compatible versions beyond the tests currently set up. We also do not test all patch versions of python, yet assume they are compatible.

Imagehash is pure python code. The compatibility is introduced by dependencies. We do not need to document these dependencies here, because pip will look them up as needed.

There is a cost associated to testing "all" or a large number of python versions, namely a carbon footprint on the computing center for every git push. It seems to me we do not gain substantial information here by testing intermediate versions over testing the earliest and latest supported python version.

@Rotzbua
Copy link
Author

Rotzbua commented Oct 25, 2023

Firstly, just because the Python project does not provide support for older versions, does not mean imagehash is incompatible.

The statement contradicts itself, because the project does not make any statement about the actively supported Python versions.
The python_requires attribute can be overridden by a command to pip. But then the programmer is actively aware that the library version may not be compatible.
Not specifying a minimum version also limits further development, since new Python language features cannot be used. For example, it is totally normal to use features like typing or f-strings for coding.

Imagehash is pure python code. The compatibility is introduced by dependencies.

This is simply wrong. Python code is processed by the Python interpreter and thus has a clear dependency on it.
Furthermore, "pure" is to be understood only in the sense of written in a single programming language. There is no universally (pure) valid python code, because the programming language is also constantly evolving.

There is a cost associated to testing "all" or a large number of python versions, namely a carbon footprint on the computing center for every git push.

  • The trigger points for test runs can be customized.
  • CI CPU time consumption can be reduced by caching.
  • For those reason the number of supported python versions is limited.
  • In my opinion distributing buggy code causes more CO2 than testing it at one point in the chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants