VirusTotal / yara-python

The Python interface for YARA
http://virustotal.github.io/yara/
Apache License 2.0
648 stars 179 forks source link

Remove python2 support. #133

Closed wxsBSD closed 2 years ago

wxsBSD commented 4 years ago

Python2 is a dead language, we should no longer be supporting it. To that end, this commit removes python2 support by doing the following:

If you run setup.py with a python2 interpreter, it will error out.

The pip runtime is now enforcing a required python version of 3 or higher.

Remove all preprocessor macros for supporting both python2 and python3. They are all now python3 only.

I also removed the PYTHON_API_VERSION check since that is very old (as far as I can tell that API version was first set in 1997).

wxsBSD commented 4 years ago

I know we've talked about this eventually happening but I thought I would get a jump start on it for when you are ready to finally remove python2 support. I'm happy to leave this PR open and keep it updated until such time. I don't think it belongs in the 4.0 release since we haven't given any heads up that this is coming, but maybe in a future 4.x release we can merge this.

This has only been lightly tested manually by me, and I also made sure all tests pass.

plusvic commented 4 years ago

That's the idea. Python 2.x won't be supported starting with YARA v 4.0, but only in the sense that no effort will be made to make it work. For example, Windows installers for Python 2.x are not generated anymore because that requires using Visual C++ 9.0 which doesn't support C99. But for the time being I don't want to prevent people from using it with Python 2.x if it works without doing anything.

plusvic commented 2 years ago

For the time being we are not actively removing support for Python 2.x.

wxsBSD commented 2 years ago

I had mostly forgot about this PR. When you're ready to remove it I'll do the work!