Skip to content

Commit

Permalink
Drop Python 2 support (#648)
Browse files Browse the repository at this point in the history
Drop Python 2 support.
  • Loading branch information
shadinua committed Jun 2, 2020
1 parent 7acd054 commit e48d4c9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ jobs:

- run: sudo /sbin/ldconfig
# generate integration tests
- run: python tests/_integration/tests_generator.py
- run: python3 tests/_integration/tests_generator.py
- run: bash tests/_integration/integration_total.sh
- run: bash tests/tools/check_keygen.sh

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [python2, python3]
python: [python3]
fail-fast: false
env:
PYTHON: ${{ matrix.python }}
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Changes that are currently in development and have not been released yet.
- ObjCThemis installed via Carthage is now called `objcthemis` instead of just `themis` ([read more](#0.13.0-objcthemis-rename)).
- Themis 0.9.6 compatibility is now disabled by default ([read more](#0.13.0-drop-0.9.6-compat)).
- Themis is known to be broken on big-endian architectures ([read more](#0.13.0-big-endian)).
- Java 7 is no longer supported, breaking Android and Java builds on outdated systems ([read more](#0.13.0-drop-java-7))
- Java 7 is no longer supported, breaking Android and Java builds on outdated systems ([read more](#0.13.0-drop-java-7)).
- Python 2 is no longer supported ([read more](#0.13.0-drop-python-2)).

_Code:_

Expand Down Expand Up @@ -576,6 +577,10 @@ _Code:_
Existing master key API (`SCellSeal(key=...)`) should not be used with passphrases or passwords.
Use master key API with symmetric encryption keys, such as generated by `GenerateSymmetricKey()` ([#561](https://github.com/cossacklabs/themis/pull/561)).
Use passphrase API with human-readable passphrases.
- <a id="0.13.0-drop-python-2">Python 2 is no longer supported</a>
Python 2 had reached EOL on 2020-01-01.

In fact, we are not making any changes in this release that break compatibility, but we no longer officially support it. This means that we do not run any CI tests for Python 2, and in the future we will develop code compatible only with Python 3+.

- **Ruby**

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ ifdef PIP_VERSION
PIP_THEMIS_INSTALL := $(shell pip freeze |grep themis)
endif

pythemis_install: CMD = cd src/wrappers/themis/python/ && python2 setup.py install --record files.txt; python3 setup.py install --record files3.txt
pythemis_install: CMD = cd src/wrappers/themis/python/ && python3 setup.py install --record files3.txt
pythemis_install:
ifeq ($(or $(PYTHON2_VERSION),$(PYTHON3_VERSION)),)
@echo "python2 or python3 not found"
ifeq ($(PYTHON3_VERSION),)
@echo "python3 not found"
@exit 1
endif
@echo -n "pythemis install "
Expand Down
1 change: 0 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ detect_language_runtimes() {
set_variable NODE_VERSION "$(exec 2>/dev/null; which node >/dev/null && node --version)"
set_variable NPM_VERSION "$(exec 2>/dev/null; which npm >/dev/null && npm --version)"
set_variable PIP_VERSION "$(exec 2>/dev/null; which pip >/dev/null && pip --version)"
set_variable PYTHON2_VERSION "$(exec 2>/dev/null; which python2 >/dev/null && python2 --version)"
set_variable PYTHON3_VERSION "$(exec 2>/dev/null; which python3 >/dev/null && python3 --version)"
}

Expand Down
4 changes: 2 additions & 2 deletions tests/_integration/tests_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python3
import string
import os
from collections import namedtuple
Expand All @@ -12,7 +12,7 @@

languages = [
LanguageSetting(name='ruby', command='ruby', script_path='./tools/ruby', extension='rb'),
LanguageSetting(name='python', command='python', script_path='./tools/python', extension='py'),
LanguageSetting(name='python', command='python3', script_path='./tools/python', extension='py'),
LanguageSetting(name='js', command='node', script_path='./tools/js/wasm-themis', extension='js'),
LanguageSetting(name='node', command='node', script_path='./tools/js/jsthemis', extension='js'),
LanguageSetting(name='go', command='go run', script_path='./tools/go', extension='go'),
Expand Down
15 changes: 2 additions & 13 deletions tests/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ ifdef RUBY_GEM_VERSION
@chmod a+x ./$(BIN_PATH)/tests/rbthemis_test.sh
@$(PRINT_OK_)
endif
ifdef PYTHON2_VERSION
@echo -n "make tests for pythemis with python 2 "
@echo "#!/bin/bash -e" > ./$(PYTHON2_TEST_SCRIPT)
@echo "python2 -m unittest discover -s tests/pythemis" >> ./$(PYTHON2_TEST_SCRIPT)
@chmod a+x ./$(PYTHON2_TEST_SCRIPT)
endif
ifdef PYTHON3_VERSION
@echo -n "make tests for pythemis with python3 "
@echo "#!/bin/bash -e" > ./$(PYTHON3_TEST_SCRIPT)
Expand Down Expand Up @@ -117,20 +111,15 @@ endif

test_python:
# run test if any of python version available
ifneq ($(or $(PYTHON2_VERSION),$(PYTHON3_VERSION)),)
ifneq ($(PYTHON3_VERSION),)
@echo "------------------------------------------------------------"
@echo "Running pythemis tests."
@echo "In case of errors, see https://docs.cossacklabs.com/pages/python-howto/"
@echo "------------------------------------------------------------"
ifneq ($(PYTHON2_VERSION),)
$(PYTHON2_TEST_SCRIPT)
endif
ifneq ($(PYTHON3_VERSION),)
$(PYTHON3_TEST_SCRIPT)
endif
@echo "------------------------------------------------------------"
else
@echo "python2 or python3 not found"
@echo "python3 not found"
@exit 1
endif

Expand Down
2 changes: 1 addition & 1 deletion tests/tools/check_keygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test_keygen () {
check_result_zero
}

test_lang 'python' && test_keygen python tools/python/keygen.py
test_lang 'python' && test_keygen python3 tools/python/keygen.py
test_lang 'node' && test_keygen node tools/js/jsthemis/keygen.js
test_lang 'js' && test_keygen node tools/js/wasm-themis/keygen.js
test_lang 'php' && test_keygen "php -f" tools/php/keygen.php
Expand Down

0 comments on commit e48d4c9

Please sign in to comment.