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

Drop Python 2.7 support #186

Open
saroad2 opened this issue Feb 23, 2021 · 5 comments
Open

Drop Python 2.7 support #186

saroad2 opened this issue Feb 23, 2021 · 5 comments
Labels
wontfix This will not be worked on

Comments

@saroad2
Copy link
Contributor

saroad2 commented Feb 23, 2021

As of January 2020, Python 2.7 (and Python 2 in general) is not supported by the Python Software Foundation (PSF). The same implies to Python 3.5 as from December 2020.

I think it's about time that pytest-cases will do the same. This will allow us to use f-strings, type hints (not as comments), data classes, and many more abilities which are currently out of reach.

What do you think?

@smarie
Copy link
Owner

smarie commented Feb 23, 2021

I have considered this but I would prefer not to do it for now. The pros are much lower than the cons (you can use pyfields if you need dataclass in python 2, even though I agree that type hinting class attributes without type comments is a bit less convenient :) )

Even if PSF dropped support, for the month of december 2020 only 73.6% of the total pytest-cases downloads were on python 3... So python 2 is clearly still around.

@smarie smarie closed this as completed Feb 23, 2021
@saroad2
Copy link
Contributor Author

saroad2 commented Feb 23, 2021

I suggest keeping this issue open and marking it as blocked.

I'm pretty sure that one day we would want to drop Python 2.7 and 3.5 support. This issue can help us track it.

@smarie
Copy link
Owner

smarie commented Feb 23, 2021

Good point

@smarie smarie reopened this Feb 23, 2021
@smarie smarie added the wontfix This will not be worked on label Feb 23, 2021
@saroad2
Copy link
Contributor Author

saroad2 commented Feb 24, 2022

Hey @smarie .

I'm bumping this issue again. I think that a year later, it's about time to drop python 2.7 support.

Keeping 2.7 makes the code a lot harder to read than it should be. I truly believe that people should have moved to python 3 by now.

Would love to hear your opinion about this.

@saroad2 saroad2 changed the title Drop Python 2.7 and Python 3.5 support Drop Python 2.7 support Feb 24, 2022
@smarie
Copy link
Owner

smarie commented Mar 1, 2022

Thanks @saroad2 for coming back at this point !

Indeed this could be something doable, if you are motivated.

Knowing the details inside pytest-cases, I am just afraid that by far the largest complexity by far is not due to python 2 support, but to working around the pytest engine with tweaks that are more or less ugly (creation of fixtures behind the users' back in particular, and manipulating the callspecs).

This is why I thought that the first refactoring to happen would be #170 and not #186

Maybe doing #186 first is a way to reduce the amount of code and increase readability , before doing the #170.
Unfortunately I have absolutely no bandwidth these days... I can try to keep some time for review activity, if a focused PR (only solving this issue) pops up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants