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

Upgrade to support also Python 3.x #295

Closed
pombredanne opened this issue Aug 20, 2016 · 77 comments
Closed

Upgrade to support also Python 3.x #295

pombredanne opened this issue Aug 20, 2016 · 77 comments

Comments

@pombredanne
Copy link
Contributor

pombredanne commented Aug 20, 2016

The time is now!
Some important reads:

@pombredanne
Copy link
Contributor Author

And this likely means only Python 3.5 and up

@sschuberth
Copy link
Collaborator

Here's one more vote to support Python 3 as that would make debugging multiprocessing exceptions like issue #413 a bit easier.

@pombredanne
Copy link
Contributor Author

At a high level the key issues I can think of are:

  • unicode vs. bytes, since a good many functions handle low level bytes and not unicode and Py3 is unicode by default.
  • native libraries using C/C++
  • other third-party libraries
  • doctests (with u'' in their expectations) or other similar tests

And in all cases, I want to support 2 and 3 at the same time with a single codebase which is not a big deal.

FWIW, most libraries should be OK except some natives. Upcoming ones (e.g. https://github.com/nexB/license-expression/ ) are also ok (I just ported that to Python 3)

@pombredanne
Copy link
Contributor Author

For the 2 to 3 update, the first step will be effectively to gather wheels for every ScanCode-bundled dependencies

I do not know which one would be OK or not: this has to be tested

And eventually a Python 3 wheel --if not available-- can be built for all OSes/archs using https://github.com/pombreda/thirdparty-manylinux/ https://github.com/pombreda/thirdparty that are Travis and Appveyor build loops that create wheels and upload them to http://dl.bintray.com/pombreda/thirdparty/

Note that I have already started collecting Python 36 wheels there

And once all deps are available, the second step is to ensure that all the tests pass both on Py2 and Py3 and start making fixes, one at a time which will be the guide to make the port work

And BTW the minimum Python3 version we will support in ScanCode is 3.6.1.
Nothing before that 😉

@vivonk
Copy link
Contributor

vivonk commented Feb 10, 2018

According to me, most helpful is this so why we are collecting python wheels on version dependent. Are you trying say that packages of python3 should be installed as well like it do in python 2 case(bin/python2.7) for virtualenv purposes?

@pombredanne
Copy link
Contributor Author

@vivonk yes, that should be the way

@sschuberth
Copy link
Collaborator

More reasons to upgrade to Python 3.x, and version 3.7 in particular: https://docs.python.org/3/whatsnew/3.7.html#optimizations

@davidak
Copy link

davidak commented Jan 9, 2019

You have 11 months left to migrate to python 3. Then python 2 will no longer be maintained.

https://pythonclock.org/

What is the status?

@pombredanne
Copy link
Contributor Author

@davidak this is definitely in the plan for this year!
This is likely quite a bit of work especially if we want to keep support for Python 2 which may not be a good idea?

Help is definitely needed and welcomed. Would you be willing to chip in to help a bit if you have a few spare cycles?

Also, we are planning to participate in the Google Summer of Code this year and if we are accepted that would be a great student project. Mentoring help could be great there.

@sschuberth
Copy link
Collaborator

This is likely quite a bit of work especially if we want to keep support for Python 2 which may not be a good idea?

Wouldn't it be a nice & clean cut to make ScanCode 3.0 only support Python 3? That would be easy to remember 😉

@davidak
Copy link

davidak commented Jan 9, 2019

Would you be willing to chip in

Sadly i have already too many projects :D

@pombredanne
Copy link
Contributor Author

@davidak fair enough: may be you will be willing to kick in the tires when we start to have something usable?

@davidak
Copy link

davidak commented Jan 9, 2019

For now it works for me to manually set the license in my script. When this library works with python 3 i might try to detect it automatically.

@pombredanne
Copy link
Contributor Author

pombredanne commented Jan 29, 2019

from @dankegel in #1342

can't install with pip3
python2.7 is dying (see https://pythonclock.org/ ), time to make sure python3 support is happy.

On Ubuntu 18.04, installing with 'pip3 install scancode-toolkit' fails with

Collecting scancode-toolkit
 Could not find a version that satisfies the requirement scancode-toolkit (from versions: )
No matching distribution found for scancode-toolkit

This is especially annoying since 'pip install scancode-toolkit' fails with a sigsegv (not scancode's fault; 'pip install simplejson' also crashes. See simplejson/simplejson#114 for workaround).

@pombredanne
Copy link
Contributor Author

I wrote before

And in all cases, I want to support 2 and 3 at the same time with a single codebase which is not a big deal.

And

This is likely quite a bit of work especially if we want to keep support for Python 2 which may not be a good idea?

Unless someone disagree, the next major version after the 3.x release (4.x) will be ported and made to run only on Python3. And Python2 support will be dropped in 4.x and available only in maintenance branches of the 3.x releases.

Having a codebase that does not try to support both versions will help quite a bit. Also I do not want to try to support any Python 3 version before version 3.6. So it is more like we will be migrating to Python 3.6+

Objections and feedback welcomed!

@dankegel
Copy link
Contributor

Happy to lose python 2.7. python's story is way too hairy at the moment; we need to get to a place where everyone can always use venv.

@mjherzog
Copy link
Member

Python 3.6 sounds good

@steven-esser
Copy link
Contributor

I agree with @dankegel. Once we are fully migrated to python36+ I do not see a good reason to go out of our way to support python2.

Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ses aboutcode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 7, 2020
…ode-org#295

This script copies all thirdparty files(required) and place it in repo as release assets.

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
pombredanne added a commit that referenced this issue Jul 23, 2020
pombredanne added a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 25, 2020
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Jul 25, 2020
pombredanne added a commit that referenced this issue Jul 27, 2020
Expose all .whl,.ABOUT, .NOTICE,.LICENCE files and Create an archive
pombredanne added a commit that referenced this issue Jul 27, 2020
Automate the creation of requirement.txt and fetch deps
Abhishek-Dev09-zz pushed a commit to Abhishek-Dev09-zz/scancode-toolkit that referenced this issue Aug 26, 2020
…ode-org#295

Signed-off-by: Abhishek Kumar <abhishek.kasyap09@gmail.com>
pombredanne added a commit that referenced this issue Sep 1, 2020
Older version had too many regex deprecation warnings

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Sep 1, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 23, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 24, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 24, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 3, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
This removes any references to Python 2 and the commoncode.compat module

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
None of them are needed in Python 3.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
dict is ordered by default in Python 3.6+

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 4, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 9, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Dec 9, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
Copy link
Contributor Author

We now support fully Python 3.6, 3.7, 3.8 and 3.9 on Linux, Windows and macOS 64 bits.
we dropped Python 2 support (available in legacy 3.x versions)
Thank you all for the efforts and @Abhishek-Dev09 in particular!

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

No branches or pull requests