From 0446053e664e55d9413e9097af36a3ed13148a60 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Wed, 27 Apr 2022 16:16:24 +0100 Subject: [PATCH 01/10] Update version -> 2.14.1 (alpha release) --- sonar-project.properties | 2 +- yoti_python_sdk/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index b8f41b51..e85e5860 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,7 +2,7 @@ sonar.host.url = https://sonarcloud.io sonar.organization = getyoti sonar.projectKey = getyoti:python sonar.projectName = Python SDK -sonar.projectVersion = 2.14.0 +sonar.projectVersion = 2.14.1 sonar.exclusions = yoti_python_sdk/tests/**,examples/**,yoti_python_sdk/protobuf/**/* sonar.python.pylint.reportPath = coverage.out diff --git a/yoti_python_sdk/version.py b/yoti_python_sdk/version.py index 18b49b72..e8cf2158 100644 --- a/yoti_python_sdk/version.py +++ b/yoti_python_sdk/version.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = "2.14.0" +__version__ = "2.14.1" From 8aa887225e0967d33e9102c7d8a4889283cca9e9 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Wed, 27 Apr 2022 16:16:38 +0100 Subject: [PATCH 02/10] Update pytz -> 2022.1 --- requirements.in | 2 +- requirements.txt | 74 ++++++++++++++++++++++++++++++++++-------------- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/requirements.in b/requirements.in index a229f183..d7235772 100644 --- a/requirements.in +++ b/requirements.in @@ -7,7 +7,7 @@ pbr==1.10.0 protobuf==3.13.0 pyopenssl==19.1.0 PyYAML==5.2 # PyYAML 5.3 does not support Python 3.4 -pytz==2020.4 +pytz==2022.1 requests>=2.20.0 urllib3>=1.24.3 deprecated==1.2.10 diff --git a/requirements.txt b/requirements.txt index b8c0490b..7d09771c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,30 +1,60 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # pip-compile --output-file=requirements.txt requirements.in # -asn1==2.2.0 # via -r requirements.in -certifi==2018.11.29 # via requests -cffi==1.14.3 # via -r requirements.in, cryptography -chardet==3.0.4 # via requests -cryptography==2.8 # via -r requirements.in, pyopenssl -deprecated==1.2.10 # via -r requirements.in -future==0.18.2 # via -r requirements.in -idna==2.7 # via requests -iso8601==0.1.13 # via -r requirements.in -itsdangerous==1.1.0 # via -r requirements.in -pbr==1.10.0 # via -r requirements.in -protobuf==3.13.0 # via -r requirements.in -pycparser==2.18 # via cffi -pyopenssl==19.1.0 # via -r requirements.in -pytz==2020.4 # via -r requirements.in -pyyaml==5.2 # via -r requirements.in -requests==2.21.0 # via -r requirements.in -six==1.10.0 # via cryptography, protobuf, pyopenssl -urllib3==1.24.3 # via -r requirements.in, requests -wheel==0.33.6 # via -r requirements.in -wrapt==1.11.2 # via deprecated +asn1==2.2.0 + # via -r requirements.in +certifi==2018.11.29 + # via requests +cffi==1.14.3 + # via + # -r requirements.in + # cryptography +chardet==3.0.4 + # via requests +cryptography==2.8 + # via + # -r requirements.in + # pyopenssl +deprecated==1.2.10 + # via -r requirements.in +future==0.18.2 + # via -r requirements.in +idna==2.7 + # via requests +iso8601==0.1.13 + # via -r requirements.in +itsdangerous==1.1.0 + # via -r requirements.in +pbr==1.10.0 + # via -r requirements.in +protobuf==3.13.0 + # via -r requirements.in +pycparser==2.18 + # via cffi +pyopenssl==19.1.0 + # via -r requirements.in +pytz==2022.1 + # via -r requirements.in +pyyaml==5.2 + # via -r requirements.in +requests==2.21.0 + # via -r requirements.in +six==1.10.0 + # via + # cryptography + # protobuf + # pyopenssl +urllib3==1.24.3 + # via + # -r requirements.in + # requests +wheel==0.33.6 + # via -r requirements.in +wrapt==1.11.2 + # via deprecated # The following packages are considered to be unsafe in a requirements file: # setuptools From d5705d0fbd2da808978e148351446536524c9687 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Wed, 27 Apr 2022 16:23:51 +0100 Subject: [PATCH 03/10] Merge GitHub workflows from development --- .github/workflows/sonar.yaml | 2 +- .github/workflows/tests.yaml | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sonar.yaml b/.github/workflows/sonar.yaml index d0a30566..f5055259 100644 --- a/.github/workflows/sonar.yaml +++ b/.github/workflows/sonar.yaml @@ -26,7 +26,7 @@ jobs: - run: pytest --cov=yoti_python_sdk yoti_python_sdk/tests --cov-report=xml:coverage-reports/coverage-new.xml - - run: sed -i 's+.*+/home/travis/build/getyoti/yoti-python-sdk/yoti_python_sdk+g' coverage-reports/coverage-new.xml + - run: sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage-reports/coverage-new.xml - uses: sonarsource/sonarcloud-github-action@master env: diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ff260478..9506b63c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,12 +13,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: [2.7, 3.6, 3.7, 3.8, 3.9, "3.10-dev"] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2.1.4 + - uses: actions/setup-python@v2.3.1 with: python-version: ${{ matrix.python-version }} @@ -40,14 +40,16 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2.1.4 + - uses: actions/setup-python@v2.3.1 + with: + python-version: 3.9 - - run: pip install -U setuptools==45 + - run: pip install --upgrade setuptools - run: pushd examples/aml && pip install -r requirements.txt && popd - - run: pushd examples/yoti_example_django && pip install -r requirements.txt && popd - + - run: pushd examples/yoti_example_django && pip install --upgrade pip && pip install -r requirements.txt && popd + - run: pushd examples/yoti_example_flask && pip install -r requirements.txt && popd - + - run: pushd examples/doc_scan && pip install -r requirements.txt && popd From 741bbf35891879a51abd22af1948ff24a239af46 Mon Sep 17 00:00:00 2001 From: ZephSibley <43991578+ZephSibley@users.noreply.github.com> Date: Tue, 14 Jun 2022 12:39:49 +0100 Subject: [PATCH 04/10] bugfix: mismatch in protobuf dep between requirements.txt and setup.py This is the source of a bug in which this package will break other systems by allowing the incompatible version 4.* of protobuf to be installed. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4f3033a6..3906e73e 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ install_requires=[ "deprecated==1.2.10", "cryptography>=2.2.1", - "protobuf>=3.1.0", + "protobuf==3.13.0", "requests>=2.11.1", "future>=0.11.0", "asn1==2.2.0", From f4223513646f0818d353ced29d7c91391b9e7b52 Mon Sep 17 00:00:00 2001 From: Zeph! Date: Wed, 8 Jun 2022 15:08:23 +0100 Subject: [PATCH 05/10] Update version of pyzt --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3906e73e..5f11c781 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ "asn1==2.2.0", "pyopenssl>=18.0.0", "iso8601==0.1.13", - "pytz==2020.4", + "pytz==2022.1", ], extras_require={ "examples": [ From a0c81f8d78f445c58df3cc42300e73b1a2d3daf0 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Thu, 16 Jun 2022 10:21:02 +0100 Subject: [PATCH 06/10] Add venv to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8a197872..022b5cb0 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ examples/yoti_example_django/*.pem examples/yoti_example_flask/*.pem .scannerwork +.venv/ From 8af67664d35a96dd15d247e11f77436bb3af3e52 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Thu, 16 Jun 2022 10:21:56 +0100 Subject: [PATCH 07/10] Update pre-commit hooks, freeze version --- .pre-commit-config.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ed7baf9..c94a38e6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,13 @@ exclude: protobuf/ repos: - repo: https://github.com/ambv/black - rev: stable + rev: 22.3.0 hooks: - id: black - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.2.3 + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 hooks: - id: flake8 args: - - --ignore=E501,W5 + - --ignore=E501,W5 \ No newline at end of file From bc9c5ed1be4280585c6cdfcc965adc2b70f4cd10 Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Thu, 16 Jun 2022 10:22:21 +0100 Subject: [PATCH 08/10] Remove Travis references --- .travis.yml | 77 ------------------------------------------------- CONTRIBUTING.md | 2 +- README.md | 2 +- 3 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 180a9b1f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,77 +0,0 @@ -language: python - -dist: xenial - -git: - depth: 3 - -jobs: - allow_failures: - - python: "3.8-dev" - include: - - &test - stage: Test - python: "2.7" - cache: pip - before_install: - - pip install -U setuptools - install: - - pip install -r requirements.txt - - pip install -e .[dev] - script: - - pytest -v - - <<: *test - python: "3.4" - - <<: *test - python: "3.5" - - <<: *test - python: "3.5-dev" - - <<: *test - python: "3.6" - - <<: *test - python: "3.6-dev" - - <<: *test - python: "3.7" - - <<: *test - python: "3.7-dev" - - <<: *test - python: "3.8-dev" - - <<: *test - python: "3.8" - - - stage: Check Examples - name: AML - python: "3.8" - script: - - cd ./examples/aml - - pip install -r requirements.txt - - name: Django - python: "3.8" - script: - - cd ./examples/yoti_example_django - - pip install -r requirements.txt - - name: Flask - python: "3.8" - script: - - cd ./examples/yoti_example_flask - - pip install -r requirements.txt - - name: Doc Scan - python: "3.8" - script: - - cd ./examples/doc_scan - - pip install -r requirements.txt - - - stage: Analyze - name: Sonarcloud - python: "3.8" - addons: - sonarcloud: - organization: "getyoti" - install: - - pip install -r requirements.txt - - pip install -e .[dev] - script: - - pytest --cov=yoti_python_sdk yoti_python_sdk/tests --cov-report=xml:coverage-reports/coverage-new.xml - - sed -i 's+.*+/home/travis/build/getyoti/yoti-python-sdk/yoti_python_sdk+g' coverage-reports/coverage-new.xml - - sonar-scanner - if: type = pull_request OR branch = master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86e2f477..51e32699 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ ## Adding Features Any features added must be fully tested and documented, with examples supplied in the pull request. -The feature must support the lowest Python version that the SDK supports (see [the travis file](.travis.yml) for all supported versions). The feature +The feature must support the lowest Python version that the SDK supports (see [the GitHub workflow tests file](./.github/workflows/tests.yaml) for all supported versions). The feature must not introduce any unnecessary dependencies (although introducing a new third party library is open for discussion if absolutely required). diff --git a/README.md b/README.md index 1014886c..d50a9736 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ Yoti also allows you to enable user details verification from your mobile app by ## Requirements -To see the versions of Python this SDK is compatible with, see the [.travis.yml](/.travis.yml) file. +To see the versions of Python this SDK is compatible with, see the [the GitHub workflow tests file](./.github/workflows/tests.yaml) file. ## Installing the SDK From 3bd26b18dd5b265261d3485601a040f13a0f852e Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Thu, 16 Jun 2022 10:23:55 +0100 Subject: [PATCH 09/10] Fix test --- yoti_python_sdk/tests/test_activity_details.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoti_python_sdk/tests/test_activity_details.py b/yoti_python_sdk/tests/test_activity_details.py index 1735b030..1fc349f1 100644 --- a/yoti_python_sdk/tests/test_activity_details.py +++ b/yoti_python_sdk/tests/test_activity_details.py @@ -85,7 +85,7 @@ def create_age_verified_field( ): activity_details.field = lambda: None activity_details.field.name = ( - "age_over:{0}".format(age) if over is True else "age_under:".format(age) + "age_over:{0}".format(age) if over is True else "age_under:{0}".format(age) ) activity_details.field.value = encoded_string_verified_value activity_details.field.content_type = Protobuf.CT_STRING From c32e14bf6abc19f56a7c038029ffe790eeb4013b Mon Sep 17 00:00:00 2001 From: Ed Harrod Date: Thu, 16 Jun 2022 10:33:04 +0100 Subject: [PATCH 10/10] Update Flask Example requirements --- examples/yoti_example_flask/requirements.in | 8 +- examples/yoti_example_flask/requirements.txt | 96 +++++++++++++++----- 2 files changed, 76 insertions(+), 28 deletions(-) diff --git a/examples/yoti_example_flask/requirements.in b/examples/yoti_example_flask/requirements.in index 89c202b6..89d0b0ee 100644 --- a/examples/yoti_example_flask/requirements.in +++ b/examples/yoti_example_flask/requirements.in @@ -1,9 +1,11 @@ -cffi>=1.14.0 +click>=7 +cffi>=1.15.0 flask>=1.0.4 -jinja2>=2.8.1 +jinja2>=3.0.3 pyopenssl>=19.0.0 python-dotenv>=0.7.1 requests>=2.20.0 urllib3>=1.24.2 -yoti>=2.13.0 +yoti>=2.14.0 werkzeug>=1.0.1 +six==1.16.0 \ No newline at end of file diff --git a/examples/yoti_example_flask/requirements.txt b/examples/yoti_example_flask/requirements.txt index a5a293a8..81f2e9f6 100644 --- a/examples/yoti_example_flask/requirements.txt +++ b/examples/yoti_example_flask/requirements.txt @@ -1,33 +1,79 @@ # -# This file is autogenerated by pip-compile +# This file is autogenerated by pip-compile with python 3.9 # To update, run: # # pip-compile --output-file=requirements.txt requirements.in # -asn1==2.2.0 # via yoti -certifi==2018.4.16 # via requests -cffi==1.14.0 # via -r requirements.in, cryptography -chardet==3.0.4 # via requests -click==6.7 # via flask -cryptography==3.2 # via pyopenssl, yoti -deprecated==1.2.10 # via yoti -flask==1.1.1 # via -r requirements.in -future==0.16.0 # via yoti -idna==2.7 # via requests -iso8601==0.1.13 # via yoti -itsdangerous==0.24 # via flask -jinja2==2.10.1 # via -r requirements.in, flask -markupsafe==1.0 # via jinja2 -protobuf==3.6.0 # via yoti -pycparser==2.18 # via cffi -pyopenssl==19.0.0 # via -r requirements.in, yoti -python-dotenv==0.8.2 # via -r requirements.in -requests==2.21.0 # via -r requirements.in, yoti -six==1.11.0 # via cryptography, protobuf, pyopenssl -urllib3==1.24.2 # via -r requirements.in, requests -werkzeug==1.0.1 # via -r requirements.in, flask -wrapt==1.12.1 # via deprecated -yoti==2.13.0 # via -r requirements.in +asn1==2.2.0 + # via yoti +certifi==2018.4.16 + # via requests +cffi==1.15.0 + # via + # -r requirements.in + # cryptography +chardet==3.0.4 + # via requests +click==8.1.2 + # via + # -r requirements.in + # flask +cryptography==3.2 + # via + # pyopenssl + # yoti +deprecated==1.2.10 + # via yoti +flask==1.1.1 + # via -r requirements.in +future==0.16.0 + # via yoti +idna==2.7 + # via requests +iso8601==0.1.13 + # via yoti +itsdangerous==0.24 + # via flask +jinja2==3.0.3 + # via + # -r requirements.in + # flask +markupsafe==2.0.1 + # via jinja2 +protobuf==3.6.0 + # via yoti +pycparser==2.18 + # via cffi +pyopenssl==19.0.0 + # via + # -r requirements.in + # yoti +python-dotenv==0.8.2 + # via -r requirements.in +pytz==2020.4 + # via yoti +requests==2.21.0 + # via + # -r requirements.in + # yoti +six==1.16.0 + # via + # -r requirements.in + # cryptography + # protobuf + # pyopenssl +urllib3==1.24.2 + # via + # -r requirements.in + # requests +werkzeug==1.0.1 + # via + # -r requirements.in + # flask +wrapt==1.12.1 + # via deprecated +yoti==2.14.0 + # via -r requirements.in # The following packages are considered to be unsafe in a requirements file: # setuptools