Skip to content

support Python3 (Proof of concept) #205

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

Closed
wants to merge 4 commits into from

Conversation

Findus23
Copy link
Collaborator

This is a quick test of a python3 compatible version.

Apart from converting the file with 2to3 only few manual changes were made, but it seems to be working in a simple use case and no tests are failing.

This version doesn't support python2.
Either we could make this changes with a lot of ifs or maybe keep both versions, deprecate the python2 one and keep the new one for eventual future refactoring.

@Findus23
Copy link
Collaborator Author

The failing test seems to be because the order here jumps around in python3:

assert hits[0]['args']['_cvar'] == {1: ['The Date', '2012-04-01 00:00:13'], 2: ['User Name', 'theuser']} # check visit custom vars

@mattab
Copy link
Member

mattab commented Feb 22, 2018

Very useful.. 👍

Either we could make this changes with a lot of ifs or maybe keep both versions, deprecate the python2 one and keep the new one for eventual future refactoring.

Moving on to Python 3 only makes sense.

some thoughts on the Python3 roll-out

  • we could have the two scripts for a while and only build new features in the Python 3 version. (important fixes would go to both)
  • it would be useful if the Python3 script failed with an easy to understand message, when python2 is used instead
  • we would need to wait for Matomo 4.0.0 before making the switch and replace the current script by the Python 3 script for all users.
    • This would break by default all people who use the script as Python2 wouldn't run it and people explicitely use python2. Wondering if it's maybe a bad idea. If we do this, we need at least to make sure there is a clear error message, and clear communication in our Matomo 4 changelogs
    • even after Matomo 4 we could maybe keep the old Python2 script, at least for a while (maybe until Matomo 5 or so), renamed for example import_logs_python2.py

@Findus23
Copy link
Collaborator Author

See #242 for the up to date branch

@Findus23 Findus23 closed this Feb 15, 2019
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.

2 participants