Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cryptography 2.6.1 (plus adding new python3.7 lambda env) #98

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
dist: xenial
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
# command to install dependencies
install:
- "pip install nose"
Expand Down
12 changes: 8 additions & 4 deletions lambda_packages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
},
'cryptography': {
'python2.7': {
'version': '2.3.1',
'path': os.path.join(PACKAGES_DIR, 'cryptography', 'python2.7-cryptography-2.3.1.tar.gz')
'version': '2.6.1',
'path': os.path.join(PACKAGES_DIR, 'cryptography', 'python2.7-cryptography-2.6.1.tar.gz')
},
'python3.6': {
'version': '2.3.1',
'path': os.path.join(PACKAGES_DIR, 'cryptography', 'python3.6-cryptography-2.3.1.tar.gz')
'version': '2.6.1',
'path': os.path.join(PACKAGES_DIR, 'cryptography', 'python3.6-cryptography-2.6.1.tar.gz')
},
'python3.7': {
'version': '2.6.1',
'path': os.path.join(PACKAGES_DIR, 'cryptography', 'python3.7-cryptography-2.6.1.tar.gz')
}
},
'cv2': {
Expand Down
7 changes: 4 additions & 3 deletions lambda_packages/cryptography/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

On an machine with Amazon Linux:

`./build.sh cryptography 2.3.1`
`./build.sh cryptography <package version>`

On a machine with docker and access to lambci images:

```
docker run --rm -v `pwd`:/app lambci/lambda:build-python2.7 bash -c "cd /app && /app/build.sh --docker --py2-only cryptography 2.3.1"
docker run --rm -v `pwd`:/app lambci/lambda:build-python3.6 bash -c "cd /app && /app/build.sh --docker --py3-only cryptography 2.3.1"
docker run --rm -v `pwd`:/app lambci/lambda:build-python2.7 bash -c "cd /app && /app/build.sh --docker --py2.7-only cryptography <package version>"
docker run --rm -v `pwd`:/app lambci/lambda:build-python3.6 bash -c "cd /app && /app/build.sh --docker --py3.6-only cryptography <package version>"
docker run --rm -v `pwd`:/app lambci/lambda:build-python3.7 bash -c "cd /app && /app/build.sh --docker --py3.7-only cryptography <package version>"
```
44 changes: 30 additions & 14 deletions lambda_packages/cryptography/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
# with --docker (you need docker installed and network access to reach lambci's
# docker-lambda image).
#
# Defaults to building both python2.7 and python3.6 packages. If you only want
# one of them use either --py2-only or --py3-only.
# Defaults to building python2.7, python3.6 and python 3.7 packages. If you only want
# one of them use --py2.7-only or --py3.6-only or --py3.7-only.
#
set -e

DOCKER=0
PY2=1
PY3=1
PY27=1
PY36=1
PY37=1
SUDO=sudo

while [[ $# -gt 2 ]]
Expand All @@ -28,14 +29,22 @@ case $key in
SUDO=""
shift
;;
--py2-only)
PY2=1
PY3=0
--py2.7-only)
PY27=1
PY36=0
PY37=0
shift
;;
--py3-only)
PY2=0
PY3=1
--py3.6-only)
PY27=0
PY36=1
PY37=0
shift
;;
--py3.7-only)
PY27=0
PY36=0
PY37=1
shift
;;
*)
Expand All @@ -48,8 +57,9 @@ PACKAGE=${1}
VERSION=${2}

echo DOCKER = "${DOCKER}"
echo PY2 = "${PY2}"
echo PY3 = "${PY3}"
echo PY27 = "${PY27}"
echo PY36 = "${PY36}"
echo PY37 = "${PY37}"
echo PACKAGE = "${PACKAGE}"
echo VERSION = "${VERSION}"

Expand All @@ -73,6 +83,8 @@ function build_package {
if [ "${VIRTUALENV}" == "virtualenv" ]; then
${SUDO} ${PIP} install virtualenv
fi

echo `${PYTHON} --version`

echo "make virtualenv"
ENV="env-${PYTHON}-${PACKAGE}-${VERSION}"
Expand All @@ -98,10 +110,14 @@ function build_package {
rm -r ${TMP_DIR}
}

if [ ${PY2} == 1 ]; then
if [ ${PY27} == 1 ]; then
build_package ${PACKAGE} ${VERSION} python2.7 pip virtualenv
fi

if [ ${PY3} == 1 ]; then
if [ ${PY36} == 1 ]; then
build_package ${PACKAGE} ${VERSION} python3.6 pip3.6 "python3.6 -m venv "
fi

if [ ${PY37} == 1 ]; then
build_package ${PACKAGE} ${VERSION} python3.7 pip3.7 "python3.7 -m venv "
fi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.