Skip to content

Commit 831da75

Browse files
committed
[SDK-175]: Moved "Version Support" to separate file, modified instructions slightly
1 parent 6e08095 commit 831da75

File tree

2 files changed

+95
-96
lines changed

2 files changed

+95
-96
lines changed

README.md

Lines changed: 12 additions & 96 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
@@ -159,6 +156,8 @@ Run your project but please make sure you have all the correct requirements:
159156
2. Install the SDK: `python setup.py develop`
160157
3. Execute in the main project dir: `py.test`
161158

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

164163
* Activity Details
@@ -174,89 +173,6 @@ Run your project but please make sure you have all the correct requirements:
174173
* [X] Gender `gender`
175174
* [X] Nationality `nationality`
176175

177-
178-
## Version Support
179-
### Testing on multiple Python versions ###
180-
181-
Tests executed using [py.test](http://doc.pytest.org/en/latest/) use your default/virtualenv's Python interpreter.
182-
Testing multiple versions of Python requires them to be installed and accessible on your system.
183-
One tool to do just this is [pyenv](https://github.com/yyuu/pyenv)
184-
185-
1. Install `pyenv`
186-
1. Install Python interpreters you want to test with, e.g. `pyenv install 2.6.9`
187-
1. Install project dependencies: `pip install -r requirements.txt`
188-
1. Execute in the main project dir: `tox`
189-
190-
You can choose a subset of interpreters to test with by running `tox -e <testenv_version>`.
191-
For a list of `<testenv_versions>` see `tox.ini`. Example: `tox -e py26` would run the
192-
test suite on Python 2.6 (2.6.9 in our case, as installed with `pyenv`).
193-
194-
To install all the Python versions this SDK has been tested against run:
195-
196-
```shell
197-
$ 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
198-
```
199-
200-
Activate the installed interpreters (execute in this directory):
201-
202-
```shell
203-
$ pyenv local 2.6.9 2.7.12 3.3.6 3.4.5 3.5.2 3.6.0b3
204-
```
205-
206-
Run the tests:
207-
208-
```shell
209-
$ tox
210-
```
211-
212-
#### Tox Common Issues ####
213-
214-
Supporting multiple Python versions with dependencies, often requiring compilation, is not without issues.
215-
216-
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`.
217-
218-
##### On Debian-based Systems #####
219-
220-
Install `openssl` headers with:
221-
```shell
222-
apt-get install openssl-dev
223-
```
224-
225-
See [Building Cryptography on Linux](https://cryptography.io/en/latest/installation/#building-cryptography-on-linux) for more information.
226-
227-
##### On Windows ######
228-
229-
- 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
230-
- Set the `LIB` and `INCLUDE` environment variables to include your OpenSSL installation location e.g.
231-
```shell
232-
C:\> \path\to\vcvarsall.bat x86_amd64
233-
C:\> set LIB=C:\OpenSSL-win64\lib;%LIB%
234-
C:\> set INCLUDE=C:\OpenSSL-win64\include;%INCLUDE%
235-
C:\> pip install cryptography
236-
```
237-
For more information see the [building for windows](https://cryptography.io/en/latest/installation/#building-cryptography-on-windows) section on the Cryptography website.
238-
239-
##### On macOS #####
240-
241-
Install `openssl` headers using [homebrew](http://brew.sh/): `brew install openssl`
242-
243-
Install Xcode command line tools so we have access to a C compiler and common libs:
244-
245-
```shell
246-
$ xcode-select --install
247-
```
248-
249-
See [building cryptography on OS X](https://cryptography.io/en/latest/installation/#building-cryptography-on-os-x)
250-
251-
252-
For Python 2.6 and 2.7 you *might* have to install them via `pyenv` with specific unicode code point settings:
253-
254-
```
255-
PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install <python version>
256-
```
257-
258-
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)
259-
260176
## Support
261177

262178
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)