From cc319e47a91158e1009053f0e7fc22aa7fd060b6 Mon Sep 17 00:00:00 2001 From: p1-bmu Date: Tue, 18 May 2021 21:26:47 +0200 Subject: [PATCH] solve the dep issue with enum34 in Py2, and make the cicd happy again --- README.md | 10 ++++++---- setup.cfg | 2 ++ setup.py | 13 +++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9b376f4..dacb435 100644 --- a/README.md +++ b/README.md @@ -49,21 +49,23 @@ Dependencies Currently none. Only the Python builtins and few internal modules of Python (e.g. os, system, re, struct, datetime) are required for most of the features. The json internal module is required for supporting the JSON API. +If you want to run pycrate in Python2 (which is bad !), you will however need to +install the [enum34](https://pypi.org/project/enum34/) package. The _pycrate\_ether/SCTP_ module can optionally use the external [crc32c](https://pypi.org/project/crc32c/) module from ICRAR. The _pycrate\_mobile/TS24301\_EMM_ and _pycrate\_mobile/TS24501\_FGMM_ modules use [CryptoMobile](https://github.com/p1sec/CryptoMobile) as optional dependency to -cipher / decipher LTE and 5G NAS messages. +encrypt and decrypt LTE and 5G NAS messages. + +The _pycrate\_corenet_ part requires also [pysctp](https://pypi.org/project/pysctp/) +and [CryptoMobile](https://github.com/p1sec/CryptoMobile) to run. The _pycrate\_diameter/parse\_iana\_diameter\_xml.py_ file uses [lxml](https://pypi.org/project/lxml/) to translate xml files from IANA to Python dictionnaries ; this is however not required for standard runtime. -The _pycrate\_corenet_ part requires [pysctp](https://pypi.org/project/pysctp/) -and [CryptoMobile](https://github.com/p1sec/CryptoMobile) to run. - Automatic installation ---------------------- diff --git a/setup.cfg b/setup.cfg index e84b97b..6956ad7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,6 +10,8 @@ platform = linux: linux macos: darwin windows: win32 +deps = + py27: enum34 commands = python -m unittest --verbose test.test_pycrate [gh-actions] diff --git a/setup.py b/setup.py index 96c2d14..4c0e4ba 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,21 @@ # -*- coding: UTF−8 -*- import os +import sys from setuptools import setup, find_packages # Pycrate Version VERSION = "0.4.1" +# get dependencies according to the Python version +if sys.version_info[0] == 2: + # Python2 requires enum34 + install_reqs = ['enum34'] +else: + install_reqs = [] + + # get long description from the README.md with open(os.path.join(os.path.dirname(__file__), "README.md")) as fd: long_description = fd.read() @@ -43,8 +52,8 @@ setup( "tools/pycrate_map_op_info.py", ], - # no mandatory dependency - install_requires=[], + # potential dependencies + install_requires=install_reqs, # optional dependencies extras_require={