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 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/ 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 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 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 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 diff --git a/setup.py b/setup.py index 4f3033a6..5f11c781 100644 --- a/setup.py +++ b/setup.py @@ -20,13 +20,13 @@ 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", "pyopenssl>=18.0.0", "iso8601==0.1.13", - "pytz==2020.4", + "pytz==2022.1", ], extras_require={ "examples": [ 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/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 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"