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

Switch to Python 3 #70

Merged
merged 1 commit into from
May 28, 2018
Merged

Switch to Python 3 #70

merged 1 commit into from
May 28, 2018

Conversation

nijel
Copy link
Member

@nijel nijel commented Jan 4, 2018

Fixes #68

Signed-off-by: Michal Čihař michal@cihar.com

@nijel nijel self-assigned this Jan 4, 2018
@nijel nijel added the help wanted Extra attention is needed. label Jan 4, 2018
@nijel
Copy link
Member Author

nijel commented Jan 4, 2018

Apparently there is something broken in using memcached after this, but I failed to find the culprit.

@mlaggner
Copy link
Contributor

just tried create a docker instance with python3, but I saw that debian stretch is still using python3.5
what about changing the base image to ubuntu 18.04 after release (should be by the end of April '18) and adopt the dockerfile to use the latest python

@nijel
Copy link
Member Author

nijel commented Apr 12, 2018

Switching the base image is an option as well. Still the test failure on Python 3 which happens here is weird.

@mlaggner
Copy link
Contributor

switching to ubuntu 18.04 (beta build) and python 3.6 lead me to only 1 error in the test suite:

======================================================================
FAIL: test_wrong_path (weblate.trans.tests.test_models.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/Weblate-2.20/weblate/trans/tests/test_models.py", line 121, in test_wrong_path
    project.full_clean
  File "/usr/local/lib/python3.6/dist-packages/django/test/testcases.py", line 615, in assertRaisesMessage
    callable_obj(*args, **kwargs)
  File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.6/dist-packages/django/test/testcases.py", line 590, in _assert_raises_message_cm
    yield cm
AssertionError: ValidationError not raised

the only differences to your changes are:

  • changed the base image to FROM ubuntu:18.04
  • changed cython to cython3
  • changed all occurrences of python3.5 to python3.6
  • added missind requirements from the Weblate repo:
    • python-levenshtein>=0.12.0
    • filelock>=3.0.1
    • user-agents>=1.1.0

but there are some issues inside weblate with python which I will post as issues in weblate itself

@mlaggner
Copy link
Contributor

mlaggner commented May 8, 2018

I get the following error in the admin panel after switching to python 3.6

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/weblate/formats/models.py", line 50, in load_data
    fileformat.get_class()
  File "/usr/local/lib/python3.6/dist-packages/weblate/formats/ttkit.py", line 728, in get_class
    raise ImportError('RC not supported on Python 3')
ImportError: RC not supported on Python 3

@nijel
Copy link
Member Author

nijel commented May 8, 2018

File format errors are safe to ignore, it's just to indicate that some feature is not available.

Fixes #68

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel nijel merged commit 2ff9f50 into WeblateOrg:docker May 28, 2018
@nijel nijel deleted the python3 branch May 28, 2018 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants