Skip to content

Commit

Permalink
Merge pull request #138 from getyoti/release-2.10.0
Browse files Browse the repository at this point in the history
Release 2.10.0
  • Loading branch information
MrBurtyyy authored Dec 12, 2019
2 parents 8a3147e + e2899c9 commit 06f5278
Show file tree
Hide file tree
Showing 54 changed files with 1,009 additions and 93 deletions.
12 changes: 12 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1
update_configs:
- package_manager: "python"
directory: "/"
update_schedule: "live"
target_branch: "development"

default_reviewers:
- "echarrod"
- "davidgrayston"
- "emmas-yoti"
- "MrBurtyyy"
22 changes: 12 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
- id: flake8
args:
- --ignore=E501,W5
exclude: protobuf/
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
hooks:
- id: flake8
args:
- --ignore=E501,W5
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[MASTER]
ignore=yoti_python_sdk/tests/**,examples/**
ignore=tests,protobuf
disable=C0330
65 changes: 43 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,50 @@ dist: xenial
# Only clone the most recent commit.
git:
depth: 1

python:
- "2.7"
- "3.4"
- "3.5"
- "3.5-dev"
- "3.6"
- "3.6-dev"
- "3.7"
- "3.7-dev"
- "3.8-dev"

cache: pip

before_install:
- pip install -U setuptools

install:
- pip install -r requirements.txt
- python setup.py develop

script:
- py.test -v
jobs:
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:
- py.test -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"
- <<: *test
stage: Coverage
name: Coveralls
python: "3.7"
install:
- pip install -r requirements.txt
- pip install -e .[dev]
script:
- pytest --cov=yoti_python_sdk yoti_python_sdk/tests
if: type = pull_request OR branch = master
after_success:
- coveralls

matrix:
allow_failures:
Expand Down
37 changes: 37 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Contributing

1. Fork the repo, develop and test your code changes.
2. Ensure commit messages clearly define the changes that have been made.
3. Create a pull request.

## 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
must not introduce any unnecessary dependencies (although introducing a new third party library
is open for discussion if absolutely required).

## Pre-commit Hook

* Install the [pre-commit framework](https://pre-commit.com/)
* Run `pre-commit install`

## Testing

After cloning the repository, run the following to install dependencies:

```bash
pip install -r requirements.txt
pip install -e .[dev]
```

Running the tests:

```bash
pytest
```

## Coding Style

* The pre-commit hook uses the `black` formatter to auto-format any code when committing,
along with `flake8` for style guide enforcement.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Yoti Python SDK #

[![Build Status](https://travis-ci.com/getyoti/yoti-python-sdk.svg?branch=master)](https://travis-ci.com/getyoti/yoti-python-sdk)
[![Coverage Status](https://coveralls.io/repos/github/getyoti/yoti-python-sdk/badge.svg?branch=master)](https://coveralls.io/github/getyoti/yoti-python-sdk?branch=master)

Welcome to the Yoti Python SDK. This repo contains the tools and step by step instructions you need to quickly integrate your Python back-end with Yoti so that your users can share their identity details with your application in a secure and trusted way.

## Table of Contents
Expand Down Expand Up @@ -128,6 +131,7 @@ full_name = profile.full_name.value
phone_number = profile.phone_number.value
date_of_birth = profile.date_of_birth.value
postal_address = profile.postal_address.value
structured_postal_address = profile.structured_postal_address.value
gender = profile.gender.value
nationality = profile.nationality.value
email_address = profile.email_address.value
Expand Down Expand Up @@ -274,7 +278,7 @@ To run the Flask or Django container:
Running the tests is done by the following process, ensuring you are using Python 3.0+:

1. Install dependencies: `pip install -r requirements.txt`
1. Install the SDK: `python setup.py develop`
1. Install the SDK and development dependencies: `pip install .[dev]`
1. Execute in the main project dir: `py.test`

## API Coverage
Expand All @@ -293,6 +297,7 @@ Running the tests is done by the following process, ensuring you are using Pytho
* [X] Email Address `email_address`
* [X] Date of Birth `date_of_birth`
* [X] Address `postal_address`
* [X] Structured Postal Address `structured_postal_address`
* [X] Gender `gender`
* [X] Nationality `nationality`
* [X] Application Profile `application_profile`
Expand Down
7 changes: 4 additions & 3 deletions examples/yoti_example_django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ ARG YOTI_KEY_FILE_PATH
RUN if [ "$YOTI_SCENARIO_ID" = "yourScenarioId" ] ; then echo YOTI_SCENARIO_ID not set; exit 1; else echo YOTI_SCENARIO_ID is $YOTI_SCENARIO_ID ; fi
RUN if [ "$YOTI_CLIENT_SDK_ID" = "yourClientSdkId" ] ; then echo YOTI_CLIENT_SDK_ID not set; exit 1; else echo YOTI_CLIENT_SDK_ID is $YOTI_CLIENT_SDK_ID ; fi
RUN if [ "$YOTI_KEY_FILE_PATH" = "yourKeyFilePath" ] ; then echo YOTI_KEY_FILE_PATH not set; exit 1; else echo YOTI_KEY_FILE_PATH is $YOTI_KEY_FILE_PATH ; fi
ADD . /code
WORKDIR /code
ADD . /yoti-sdk
WORKDIR /yoti-sdk/examples/yoti_example_django/
RUN pip install --no-cache-dir -r /yoti-sdk/requirements.txt && pip install /yoti-sdk
RUN pip install --no-cache-dir -r requirements.txt
ENV YOTI_SCENARIO_ID $YOTI_SCENARIO_ID
ENV YOTI_CLIENT_SDK_ID $YOTI_CLIENT_SDK_ID
ENV YOTI_KEY_FILE_PATH $YOTI_KEY_FILE_PATH

RUN python manage.py migrate
CMD ["python", "manage.py", "runsslserver", "0.0.0.0:5000"]
CMD ["python", "manage.py", "runsslserver", "0.0.0.0:5000"]
3 changes: 2 additions & 1 deletion examples/yoti_example_django/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ version: '3.4'
services:
web:
build:
context: ./
context: ../../
dockerfile: examples/yoti_example_django/Dockerfile
args:
YOTI_SCENARIO_ID: "${YOTI_SCENARIO_ID}"
YOTI_CLIENT_SDK_ID: "${YOTI_CLIENT_SDK_ID}"
Expand Down
2 changes: 1 addition & 1 deletion examples/yoti_example_django/requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cryptography>=2.3
Django==2.2.4
Django==2.2.8
django-sslserver>=0.2.0
python-dotenv>=0.7.1
requests>=2.20.0
Expand Down
2 changes: 1 addition & 1 deletion examples/yoti_example_django/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cffi==1.11.5 # via cryptography
chardet==3.0.4 # via requests
cryptography==2.5
django-sslserver==0.20
django==2.2.4
django==2.2.8
future==0.16.0 # via yoti
idna==2.7 # via requests
protobuf==3.6.0 # via yoti
Expand Down
7 changes: 4 additions & 3 deletions examples/yoti_example_flask/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ARG YOTI_KEY_FILE_PATH
RUN if [ "$YOTI_SCENARIO_ID" = "yourScenarioId" ] ; then echo YOTI_SCENARIO_ID not set; exit 1; else echo YOTI_SCENARIO_ID is $YOTI_SCENARIO_ID ; fi
RUN if [ "$YOTI_CLIENT_SDK_ID" = "yourClientSdkId" ] ; then echo YOTI_CLIENT_SDK_ID not set; exit 1; else echo YOTI_CLIENT_SDK_ID is $YOTI_CLIENT_SDK_ID ; fi
RUN if [ "$YOTI_KEY_FILE_PATH" = "yourKeyFilePath" ] ; then echo YOTI_KEY_FILE_PATH not set; exit 1; else echo YOTI_KEY_FILE_PATH is $YOTI_KEY_FILE_PATH ; fi
ADD . /code
WORKDIR /code
ADD . /yoti-sdk
WORKDIR /yoti-sdk/examples/yoti_example_flask/
RUN pip install --no-cache-dir -r /yoti-sdk/requirements.txt && pip install /yoti-sdk
RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "app.py"]
CMD ["python", "app.py"]
3 changes: 2 additions & 1 deletion examples/yoti_example_flask/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ version: '3.4'
services:
web:
build:
context: ./
context: ../../
dockerfile: examples/yoti_example_flask/Dockerfile
args:
YOTI_SCENARIO_ID: "${YOTI_SCENARIO_ID}"
YOTI_CLIENT_SDK_ID: "${YOTI_CLIENT_SDK_ID}"
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[pytest]
testpaths = yoti_python_sdk/tests/
python_files = test_*.py
norecursedirs = venv
9 changes: 3 additions & 6 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
asn1==2.2.0
click==6.6
cryptography>=2.3.0
cryptography>=2.7.0
cffi>=1.13.0
future==0.15.2
itsdangerous==0.24
mock==2.0.0
pbr==1.10.0
protobuf==3.7.0
pyopenssl==18.0.0
pytest==3.3.2
pytz==2018.9
requests>=2.20.0
urllib3>=1.24.2
virtualenv==15.2
wheel==0.24.0
deprecated==1.2.6
pre-commit==1.17.0
wheel==0.24.0
26 changes: 5 additions & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,25 @@
#
asn1==2.2.0
asn1crypto==0.24.0 # via cryptography
aspy.yaml==1.3.0 # via pre-commit
attrs==18.1.0 # via pytest
certifi==2018.11.29 # via requests
cffi==1.11.5 # via cryptography
cfgv==2.0.0 # via pre-commit
cffi==1.13.0
chardet==3.0.4 # via requests
click==6.6
cryptography==2.4.1
cryptography==2.7
deprecated==1.2.6
future==0.15.2
identify==1.4.5 # via pre-commit
idna==2.7 # via cryptography, requests
importlib-metadata==0.18 # via pre-commit
importlib-resources==1.0.2 # via pre-commit
idna==2.7 # via requests
itsdangerous==0.24
mock==2.0.0
nodeenv==1.3.3 # via pre-commit
pbr==1.10.0
pluggy==0.6.0 # via pytest
pre-commit==1.17.0
protobuf==3.7.0
py==1.5.3 # via pytest
pycparser==2.18 # via cffi
pyopenssl==18.0.0
pytest==3.3.2
pytz==2018.9
pyyaml==5.1.1 # via aspy.yaml, pre-commit
requests==2.21.0
six==1.10.0 # via cfgv, cryptography, mock, pre-commit, protobuf, pyopenssl, pytest
toml==0.10.0 # via pre-commit
six==1.10.0 # via cryptography, protobuf, pyopenssl
urllib3==1.24.2
virtualenv==15.2.0
wheel==0.24.0
wrapt==1.11.2 # via deprecated
zipp==0.5.2 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools==41.1.0 # via protobuf, pytest
# setuptools==41.4.0 # via protobuf
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"future>=0.11.0",
"asn1==2.2.0",
"pyopenssl>=18.0.0",
"deprecated==1.2.6",
],
extras_require={
"examples": [
Expand All @@ -35,7 +36,17 @@
"python-dotenv>=0.7.1",
"django-sslserver>=0.2",
"Werkzeug==0.11.15",
]
],
"dev": [
"pre-commit==1.17.0",
"pytest>=3.6.0",
"pytest-cov>=2.7.1",
"pylint==1.9.4",
"pylint-exit>=1.1.0",
"python-coveralls==2.9.3",
"mock==2.0.0",
"virtualenv==15.2",
],
},
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand All @@ -44,10 +55,8 @@
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectKey = yoti-web-sdk:python
sonar.projectName = python-sdk
sonar.projectVersion = 2.9.2
sonar.projectVersion = 2.10.0
sonar.exclusions=yoti_python_sdk/tests/**,examples/**

sonar.python.pylint.reportPath=coverage.out
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from yoti_python_sdk.sandbox.attribute import SandboxAttribute
from yoti_python_sandbox.attribute import SandboxAttribute
from yoti_python_sdk import config


Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 06f5278

Please sign in to comment.