Skip to content

Commit a26c9d8

Browse files
authored
Merge pull request #15 from getyoti/Tidy-Up-README
Changed README instructions to instruct the user to run the Django pr…
2 parents 292ddf9 + 831da75 commit a26c9d8

File tree

2 files changed

+99
-81
lines changed

2 files changed

+99
-81
lines changed

README.md

Lines changed: 16 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,34 @@ Welcome to the Yoti Python SDK. This repo contains the tools and step by step in
77
1) [An Architectural view](#an-architectural-view) -
88
High level overview of integration
99

10-
2) [References](#references) -
10+
1) [References](#references) -
1111
Guides before you start
1212

13-
3) [Requirements](#requirements) -
13+
1) [Requirements](#requirements) -
1414
Everything you need to get started
1515

16-
4) [Installing the SDK](#installing-the-sdk) -
16+
1) [Installing the SDK](#installing-the-sdk) -
1717
How to install our SDK
1818

19-
5) [SDK Project import](#sdk-project-import) -
19+
1) [SDK Project import](#sdk-project-import) -
2020
How to install the SDK to your project
2121

22-
6) [Configuration](#configuration) -
22+
1) [Configuration](#configuration) -
2323
Entry point explanation
2424

25-
7) [Handling Users](#handling-users) -
25+
1) [Handling Users](#handling-users) -
2626
How to manage users
2727

28-
8) [Running the examples](#running-the-examples) -
28+
1) [Running the examples](#running-the-examples) -
2929
How to retrieve a Yoti profile using the token
3030

31-
9) [Running the tests](#running-the-tests) -
31+
1) [Running the tests](#running-the-tests) -
3232
Running tests for SDK example
3333

34-
10) [API Coverage](#api-coverage) -
34+
1) [API Coverage](#api-coverage) -
3535
Attributes defined
3636

37-
11) [Version Support](#version-support) -
38-
Extra information on ensuring correct version of Python is being used
39-
40-
12) [Support](#support) -
37+
1) [Support](#support) -
4138
Please feel free to reach out
4239

4340
## An Architectural View
@@ -142,8 +139,10 @@ Both example applications utilise the env variables described in [Configuration]
142139

143140
### Django:
144141

145-
1. Apply migrations before the first start by running: `python examples/yoti_example_django/manage.py migrate`
146-
1. Run: `python examples/yoti_example_django/manage.py runserver 0.0.0.0:5000`
142+
1. Change directories to the Django project:
143+
`cd examples/yoti_example_django`
144+
2. Apply migrations before the first start by running: `python manage.py migrate`
145+
3. Run: `python manage.py runserver 0.0.0.0:5000`
147146

148147
### Plugins ###
149148

@@ -157,6 +156,8 @@ Run your project but please make sure you have all the correct requirements:
157156
2. Install the SDK: `python setup.py develop`
158157
3. Execute in the main project dir: `py.test`
159158

159+
For information on testing with multiple Python versions, see [VERSION-SUPPORT.md](/VERSION-SUPPORT.md)
160+
160161
## API Coverage
161162

162163
* Activity Details
@@ -172,72 +173,6 @@ Run your project but please make sure you have all the correct requirements:
172173
* [X] Gender `gender`
173174
* [X] Nationality `nationality`
174175

175-
176-
## Version Support
177-
### Testing on multiple Python versions ###
178-
179-
Tests executed using [py.test](http://doc.pytest.org/en/latest/) use your default/virtualenv's Python interpreter.
180-
Testing multiple versions of Python requires them to be installed and accessible on your system.
181-
One tool to do just this is [pyenv](https://github.com/yyuu/pyenv)
182-
183-
1. Install `pyenv`
184-
1. Install Python interpreters you want to test with, e.g. `pyenv install 2.6.9`
185-
1. Install project dependencies: `pip install -r requirements.txt`
186-
1. Execute in the main project dir: `tox`
187-
188-
You can choose a subset of interpreters to test with by running `tox -e <testenv_version>`.
189-
For a list of `<testenv_versions>` see `tox.ini`. Example: `tox -e py26` would run the
190-
test suite on Python 2.6 (2.6.9 in our case, as installed with `pyenv`).
191-
192-
To install all the Python versions this SDK has been tested against run:
193-
194-
```shell
195-
$ for version in 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3; do pyenv install $version; done
196-
```
197-
198-
Activate the installed interpreters (execute in this directory):
199-
200-
```shell
201-
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
202-
```
203-
204-
Run the tests:
205-
206-
```shell
207-
$ tox
208-
```
209-
210-
#### Tox Common Issues ####
211-
212-
Supporting multiple Python versions with dependencies, often requiring compilation, is not without issues.
213-
214-
For Python versions that do not provide binary wheels for `cryptography`, it will have to be compiled. This will be done automatically, however, you may need to install development headers of `openssl`.
215-
216-
##### On Debian-based Systems #####
217-
218-
Install `openssl` headers with `apt-get install openssl-dev`
219-
220-
##### On macOS #####
221-
222-
Install `openssl` headers using [homebrew](http://brew.sh/): `brew install openssl`
223-
224-
Install Xcode command line tools so we have access to a C compiler and common libs:
225-
226-
```shell
227-
$ xcode-select --install
228-
```
229-
230-
See [building cryptography on OS X](https://cryptography.io/en/latest/installation/#building-cryptography-on-os-x)
231-
232-
233-
For Python 2.6 and 2.7 you *might* have to install them via `pyenv` with specific unicode code point settings:
234-
235-
```
236-
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install <python version>
237-
```
238-
239-
To avoid `cffi` errors related to unicode see: [cffi ucs2 vs ucs4](http://cffi.readthedocs.io/en/latest/installation.html#linux-and-os-x-ucs2-versus-ucs4)
240-
241176
## Support
242177

243178
For any questions or support please email [[email protected]](mailto:[email protected]).

VERSION-SUPPORT.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
2+
# Version Support
3+
Extra information on ensuring correct version of Python is being used
4+
## Testing on multiple Python versions ##
5+
6+
Tests executed using [py.test](http://doc.pytest.org/en/latest/) use your default/virtualenv's Python interpreter.
7+
Testing multiple versions of Python requires them to be installed and accessible on your system.
8+
One tool to do this for Unix systems is [pyenv](https://github.com/yyuu/pyenv)
9+
10+
1. Install `pyenv`
11+
1. Install Python interpreters you want to test with, e.g. `pyenv install 2.6.9`
12+
1. Install project dependencies: `pip install -r requirements.txt`
13+
1. Execute in the main project dir: `tox`
14+
15+
You can choose a subset of interpreters to test with by running `tox -e <testenv_version>`.
16+
For a list of `<testenv_versions>` see `tox.ini`. Example: `tox -e py26` would run the
17+
test suite on Python 2.6 (2.6.9 in our case, as installed with `pyenv`).
18+
19+
To install all the Python versions this SDK has been tested against run:
20+
21+
```shell
22+
$ for version in 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.3; do pyenv install $version; done
23+
```
24+
25+
Activate the installed interpreters (execute in this directory):
26+
27+
```shell
28+
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.3
29+
```
30+
31+
Run the tests:
32+
33+
```shell
34+
$ tox
35+
```
36+
37+
### Tox Common Issues ###
38+
39+
Supporting multiple Python versions with dependencies, often requiring compilation, is not without issues.
40+
41+
For Python versions that do not provide binary wheels for `cryptography`, it will have to be compiled. This will be done automatically, however, you may need to install development headers of `openssl`.
42+
43+
#### On Debian-based Systems ####
44+
45+
Install `openssl` headers with:
46+
```shell
47+
apt-get install openssl-dev
48+
```
49+
50+
See [Building Cryptography on Linux](https://cryptography.io/en/latest/installation/#building-cryptography-on-linux) for more information.
51+
52+
#### On Windows #####
53+
54+
- Download and compile the OpenSSL binaries for your architecture from the [OpenSSL release](https://ci.cryptography.io/job/cryptography-support-jobs/job/openssl-release-1.1/) website
55+
- Set the `LIB` and `INCLUDE` environment variables to include your OpenSSL installation location e.g.
56+
```shell
57+
C:\> \path\to\vcvarsall.bat x86_amd64
58+
C:\> set LIB=C:\OpenSSL-win64\lib;%LIB%
59+
C:\> set INCLUDE=C:\OpenSSL-win64\include;%INCLUDE%
60+
C:\> pip install cryptography
61+
```
62+
For more information see the [building for windows](https://cryptography.io/en/latest/installation/#building-cryptography-on-windows) section on the Cryptography website.
63+
64+
#### On macOS ####
65+
66+
Install `openssl` headers using [homebrew](http://brew.sh/): `brew install openssl`
67+
68+
Install Xcode command line tools so we have access to a C compiler and common libs:
69+
70+
```shell
71+
$ xcode-select --install
72+
```
73+
74+
See [building cryptography on OS X](https://cryptography.io/en/latest/installation/#building-cryptography-on-os-x)
75+
76+
77+
For Python 2.6 and 2.7 you *might* have to install them via `pyenv` with specific unicode code point settings:
78+
79+
```
80+
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install <python version>
81+
```
82+
83+
To avoid `cffi` errors related to unicode see: [cffi ucs2 vs ucs4](http://cffi.readthedocs.io/en/latest/installation.html#linux-and-os-x-ucs2-versus-ucs4)

0 commit comments

Comments
 (0)