From 23eac4f149edc62bb7ccc36db623f9301e2d2fda Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 21 Jun 2020 15:27:45 -0400 Subject: Preliminary support for Python 3 This is a first step towards moving all of the Cryptech code from Python 2 to Python 3. At this stage, the goal is to make the same source code work in both language dialects, and to build packages which install both versions of the library code. This is a necessary step along the way, but since Python 2 is already past EOL as of this writing and since some distributions have started dropping all support for Python 2, we will almost certainly want to drop all Python 2 support in the relatively near future, if only because it's not really to do all the packaging right for both versions at once without much more trouble than a dead language dialect is probably worth. All platforms we care about should support Python 3 already, any that don't probably have much worse problems. So the primary purpose of pushing this particular commit is to archive what will probably be the last version supporting Python 2, while giving folks a chance to test the incoming Python 3 support a bit. Once we've cut loose from Python 2 for good, there's some cleanup we can and should do (eg, all the gymnastics to work around Python 2's handling of bytes as a form of text rather than a sequence of small integers), but for the moment we want to keep that compatability, albeit briefly. --- source/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/Makefile') diff --git a/source/Makefile b/source/Makefile index 5095766..5913f47 100644 --- a/source/Makefile +++ b/source/Makefile @@ -22,4 +22,6 @@ install: all install -D -m 644 cryptech-alpha-firmware.tar.gz ${DESTDIR}/usr/share/cryptech-alpha-firmware.tar.gz install -D -m 644 sw/pkcs11/libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so ln -s libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so.0 - python setup.py install --install-layout=deb --root=${DESTDIR} + python2 setup.py install --install-layout=deb --root=${DESTDIR} + python3 setup.py install --install-layout=deb --root=${DESTDIR} + find ${DESTDIR} -type d -name __pycache__ -exec rm -rf {} + -- cgit v1.2.3 From 9e6b0d1117e21f2e6d092e337c5c522726016467 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 12 Jul 2020 18:25:56 -0400 Subject: Attempt to go Python3-only Ubuntu 20.04 no longer really supports Python 2, so we'd have to fork the packaging code if we wanted to keep support for Python 2 elsewhere. Given that Python 3 has been around for a more than a decade and that Python 2 was formally EOLed more than six months ago as of this writing, this seems like an unnecessary complication. The biggest change is rewriting the Homebrew formula for Python 3. --- source/Makefile | 1 - 1 file changed, 1 deletion(-) (limited to 'source/Makefile') diff --git a/source/Makefile b/source/Makefile index 5913f47..0e1f613 100644 --- a/source/Makefile +++ b/source/Makefile @@ -22,6 +22,5 @@ install: all install -D -m 644 cryptech-alpha-firmware.tar.gz ${DESTDIR}/usr/share/cryptech-alpha-firmware.tar.gz install -D -m 644 sw/pkcs11/libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so ln -s libcryptech-pkcs11.so ${DESTDIR}/usr/lib/libcryptech-pkcs11.so.0 - python2 setup.py install --install-layout=deb --root=${DESTDIR} python3 setup.py install --install-layout=deb --root=${DESTDIR} find ${DESTDIR} -type d -name __pycache__ -exec rm -rf {} + -- cgit v1.2.3