Colin-b / pytest_httpx

pytest fixture to mock HTTPX
https://colin-b.github.io/pytest_httpx/
MIT License
358 stars 30 forks source link

Do you plan on putting back support for Python 3.8? #109

Closed LilyFoote closed 1 year ago

LilyFoote commented 1 year ago

I work on a tool that supports all currently supported python versions. I would like to be able to test each version with the latest release of pytest-httpx, but in https://github.com/Colin-b/pytest_httpx/pull/100 you say:

Python 3.7 and 3.8 are no longer supported.

httpx still supports 3.8 and according to https://endoflife.date/python Python 3.8 is supported for one more year (end of life: 14 Oct 2024).

Colin-b commented 1 year ago

Hello @LilyFoote

First of all, thanks a lot for your interest in this project.

Python 3.12 is planned for release in less than a month and python 3.8 was released 4 years ago. I get that some tools might want to allow users to continue to use old python versions. However the decision I made on this project is to avoid keeping support for such outdated versions,

My point of view is that developers sometimes need to be incentivize to update their dependencies otherwise they tend to let them as is. I don't want to wait to be in front of the "python X is not supported anymore" to drop support for a python version.

To come back to your use case: Support for version 3.8 is still available on versions prior to 0.23.0, you can make conditional requirements with most packaging tools if you are looking for a pinned version with Python 3.8 and another one for python 3.9+. However all future developments on this projects consider that they can make use of python 3.9 features.

Please note that this project will continue to remove support for old python versions and pytest versions (we still support version 6 but that might not last long) as needs be.

In any case, every one of those changes will obviously be a major version bump as usual.

LilyFoote commented 1 year ago

I have just discovered that I cannot install httpx 0.25.0 and pytest-httpx 0.22.0 together. This now means I cannot test the latest version of httpx on Python 3.8, despite httpx still supporting it.

Colin-b commented 1 year ago

I have just discovered that I cannot install httpx 0.25.0 and pytest-httpx 0.22.0 together. This now means I cannot test the latest version of httpx on Python 3.8, despite httpx still supporting it.

You can try (at your own risk, given that it might be incompatible) to force installation of incompatible versions, I think pip provides a way to do so but I'm not sure how (that is outside of the scope of this project and you might also be using another tool anyway).

stumpylog commented 1 year ago

I've just run into this issue as well. It seems very odd to me that a project which is for testing another project chooses to support different versions of Python. If httpx had dropped 3.8 support, that would make sense. But for a dependent to drop it before the upstream does is very unexpected.

foarsitter commented 11 months ago

Although I agree on the incentivize, I like the carrot, not the stick. The carrot here is adding support for 3.12, the stick is removing older but still supported versions. With minimal effort I added support for 3.8 so there was no reason to drop it in the first place. A good reason to remove support for older supported versions is the maintenance burden (like supporting v2 and v3 next to each other). That's not the case here. Another good reason to drop support is a new feature that is vital for a library but that isn't the case either.

But in an OSS world the most of us are volunteers. Without your effort this piece of software didn't exists in the first place. So it's up to you to decide the policy and up to me if I want to use your library. Keep up to good work :+1: