Skip to content

Commit

Permalink
Remove cryptography > 3 support
Browse files Browse the repository at this point in the history
- Added the incompatiblity of cryptography to the dockerfile.
- 1.3.10 broke dependencies because the docker didn't pull
the project constraints.
- Added a constraints specific for python2 users, other can continue
using the python3 one.

This should allow:
 - Making sure further version's docker stay compatible
 - easier maintenance of python2 vs python3 compatibility.

This does not fix forward compatiblity with cryptography,
but at least make the current build work.
  • Loading branch information
fbouliane committed May 26, 2021
1 parent fd4f597 commit 94b8c9b
Show file tree
Hide file tree
Showing 7 changed files with 331 additions and 45 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ FROM python:2.7-alpine

RUN apk update && apk add --no-cache python-dev gcc git g++ make libffi-dev openssl-dev libxml2 libxml2-dev libxslt libxslt-dev

#
#
# NOTE(mmitchell): Mimick -onbuild using -alpine image.
# ONBUILD statements removed because this is an actual Dockerfile
#
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
COPY requirements.txt constraints-py27.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt -c constraints-py27.txt

COPY . /usr/src/app
#
Expand Down
60 changes: 60 additions & 0 deletions constraints-py27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --no-emit-trusted-host --no-index --output-file=constraints-py27.txt requirements.txt
#
-e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy
# via -r requirements.txt
appdirs==1.4.4
# via twisted
cffi==1.14.5
# via cryptography
constantly==15.1.0
# via twisted
contextlib2==0.6.0.post1
# via
# importlib-resources
# zipp
cryptography==2.9.2 ; python_version < "3"
# via
# -r requirements.txt
# twisted
enum34==1.1.10
# via cryptography
importlib-resources==3.3.1
# via netaddr
incremental==21.3.0
# via twisted
ipaddress==1.0.23
# via cryptography
lxml==4.6.3
# via -r requirements.txt
netaddr==0.8.0
# via -r requirements.txt
pathlib2==2.3.5
# via importlib-resources
pyasn1==0.4.8
# via twisted
pycparser==2.20
# via cffi
scandir==1.10.0
# via pathlib2
singledispatch==3.6.1
# via importlib-resources
six==1.16.0
# via
# cryptography
# pathlib2
# singledispatch
twisted[conch]==16.6.0
# via -r requirements.txt
typing==3.10.0.0
# via importlib-resources
zipp==1.2.0
# via importlib-resources
zope.interface==5.4.0
# via twisted

# The following packages are considered to be unsafe in a requirements file:
# setuptools
48 changes: 34 additions & 14 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,40 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --no-index --no-emit-trusted-host --output-file constraints.txt requirements.txt
# pip-compile --no-emit-trusted-host --no-index --output-file=constraints.txt requirements.txt
#
-e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy
appdirs==1.4.3 # via twisted
asn1crypto==0.24.0 # via cryptography
cffi==1.11.5 # via cryptography
constantly==15.1.0 # via twisted
cryptography==2.3.1 # via twisted
idna==2.7 # via cryptography
incremental==17.5.0 # via twisted
lxml==4.2.5
netaddr==0.7.19
pyasn1==0.4.4 # via twisted
pycparser==2.19 # via cffi
six==1.11.0 # via cryptography
# via -r requirements.txt
appdirs==1.4.4
# via twisted
cffi==1.14.5
# via cryptography
constantly==15.1.0
# via twisted
cryptography==2.9.2 ; python_version == "3.5"
# via
# -r requirements.txt
# twisted
importlib-resources==3.2.1
# via netaddr
incremental==21.3.0
# via twisted
lxml==4.6.3
# via -r requirements.txt
netaddr==0.8.0
# via -r requirements.txt
pyasn1==0.4.8
# via twisted
pycparser==2.20
# via cffi
six==1.16.0
# via cryptography
twisted[conch]==16.6.0
zope.interface==4.5.0 # via twisted
# via -r requirements.txt
zipp==1.2.0
# via importlib-resources
zope.interface==5.4.0
# via twisted

# The following packages are considered to be unsafe in a requirements file:
# setuptools
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy
cryptography<3; python_version<'3'
cryptography<3; python_version=='3.5'
netaddr>=0.7.13
Twisted[conch]>=16.6.0, <17.0
lxml>=3.7
130 changes: 130 additions & 0 deletions test-constraints-py27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --no-emit-trusted-host --no-index --output-file=test-constraints-py27.txt constraints-py27.txt test-requirements.txt
#
-e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy
# via -r constraints-py27.txt
appdirs==1.4.4
# via
# -r constraints-py27.txt
# twisted
bcrypt==3.1.7
# via paramiko
cffi==1.14.5
# via
# -r constraints-py27.txt
# bcrypt
# cryptography
# pynacl
constantly==15.1.0
# via
# -r constraints-py27.txt
# twisted
contextlib2==0.6.0.post1
# via
# -r constraints-py27.txt
# importlib-resources
# zipp
cryptography==2.9.2 ; python_version < "3"
# via
# -r constraints-py27.txt
# paramiko
# twisted
enum34==1.1.10
# via
# -r constraints-py27.txt
# cryptography
flexmock==0.10.4
# via -r test-requirements.txt
funcsigs==1.0.2
# via mock
importlib-resources==3.3.1
# via
# -r constraints-py27.txt
# netaddr
incremental==21.3.0
# via
# -r constraints-py27.txt
# twisted
ipaddress==1.0.23
# via
# -r constraints-py27.txt
# cryptography
lxml==4.6.3
# via
# -r constraints-py27.txt
# ncclient
mock==3.0.5
# via -r test-requirements.txt
ncclient==0.6.10
# via -r test-requirements.txt
netaddr==0.8.0
# via
# -r constraints-py27.txt
# pyeapi
nose==1.3.7
# via -r test-requirements.txt
paramiko==2.7.2
# via ncclient
pathlib2==2.3.5
# via
# -r constraints-py27.txt
# importlib-resources
pexpect==4.8.0
# via -r test-requirements.txt
ptyprocess==0.7.0
# via pexpect
pyasn1==0.4.8
# via
# -r constraints-py27.txt
# twisted
pycparser==2.20
# via
# -r constraints-py27.txt
# cffi
pyeapi==0.8.4
# via -r test-requirements.txt
pyhamcrest==1.10.1
# via -r test-requirements.txt
pynacl==1.4.0
# via paramiko
scandir==1.10.0
# via
# -r constraints-py27.txt
# pathlib2
selectors2==2.0.2
# via ncclient
singledispatch==3.6.1
# via
# -r constraints-py27.txt
# importlib-resources
six==1.16.0
# via
# -r constraints-py27.txt
# bcrypt
# cryptography
# mock
# ncclient
# pathlib2
# pyhamcrest
# pynacl
# singledispatch
twisted[conch]==16.6.0
# via -r constraints-py27.txt
typing==3.10.0.0
# via
# -r constraints-py27.txt
# importlib-resources
zipp==1.2.0
# via
# -r constraints-py27.txt
# importlib-resources
zope.interface==5.4.0
# via
# -r constraints-py27.txt
# twisted

# The following packages are considered to be unsafe in a requirements file:
# setuptools
110 changes: 85 additions & 25 deletions test-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,93 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --no-index --no-emit-trusted-host --output-file test-constraints.txt test-requirements.txt constraints.txt
# pip-compile --no-emit-trusted-host --no-index --output-file=test-constraints.txt constraints.txt test-requirements.txt
#
-e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy
appdirs==1.4.3
asn1crypto==0.24.0
bcrypt==3.1.4 # via paramiko
cffi==1.11.5
# via -r constraints.txt
appdirs==1.4.4
# via
# -r constraints.txt
# twisted
bcrypt==3.1.7
# via paramiko
cffi==1.14.5
# via
# -r constraints.txt
# bcrypt
# cryptography
# pynacl
constantly==15.1.0
cryptography==2.3.1
flexmock==0.10.2
idna==2.7
incremental==17.5.0
lxml==4.2.5
mock==2.0.0
ncclient==0.6.3
netaddr==0.7.19
# via
# -r constraints.txt
# twisted
cryptography==2.9.2 ; python_version == "3.5"
# via
# -r constraints.txt
# paramiko
# twisted
flexmock==0.10.4
# via -r test-requirements.txt
importlib-resources==3.2.1
# via
# -r constraints.txt
# netaddr
incremental==21.3.0
# via
# -r constraints.txt
# twisted
lxml==4.6.3
# via
# -r constraints.txt
# ncclient
mock==3.0.5
# via -r test-requirements.txt
ncclient==0.6.10
# via -r test-requirements.txt
netaddr==0.8.0
# via
# -r constraints.txt
# pyeapi
nose==1.3.7
paramiko==2.4.2 # via ncclient
pbr==4.3.0 # via mock
pexpect==4.6.0
ptyprocess==0.6.0 # via pexpect
pyasn1==0.4.4
pycparser==2.19
pyeapi==0.8.2
pyhamcrest==1.9.0
pynacl==1.3.0 # via paramiko
selectors2==2.0.1 # via ncclient
six==1.11.0
# via -r test-requirements.txt
paramiko==2.7.2
# via ncclient
pexpect==4.8.0
# via -r test-requirements.txt
ptyprocess==0.7.0
# via pexpect
pyasn1==0.4.8
# via
# -r constraints.txt
# twisted
pycparser==2.20
# via
# -r constraints.txt
# cffi
pyeapi==0.8.4
# via -r test-requirements.txt
pyhamcrest==2.0.2
# via -r test-requirements.txt
pynacl==1.4.0
# via paramiko
six==1.16.0
# via
# -r constraints.txt
# bcrypt
# cryptography
# mock
# ncclient
# pynacl
twisted[conch]==16.6.0
zope.interface==4.5.0
# via -r constraints.txt
zipp==1.2.0
# via
# -r constraints.txt
# importlib-resources
zope.interface==5.4.0
# via
# -r constraints.txt
# twisted

# The following packages are considered to be unsafe in a requirements file:
# setuptools
Loading

0 comments on commit 94b8c9b

Please sign in to comment.