diff --git a/.github/workflows/pythonx-boot-check.yaml b/.github/workflows/pythonx-boot-check.yaml index 5a8c7e4..add4f2d 100644 --- a/.github/workflows/pythonx-boot-check.yaml +++ b/.github/workflows/pythonx-boot-check.yaml @@ -1,13 +1,16 @@ name: 'Runs with Python3.6 - Python3.10' -on: [ push ] +on: + pull_request_target: + branches: + - 'master' jobs: boots: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.x' ] + python-version: [ '3.8.x', '3.9.x', '3.10.x' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/pythonx-pytest.yaml b/.github/workflows/pythonx-pytest.yaml index 4b668c0..8545e1a 100644 --- a/.github/workflows/pythonx-pytest.yaml +++ b/.github/workflows/pythonx-pytest.yaml @@ -1,13 +1,16 @@ name: 'PyTest with Python3.6 - Python3.10' -on: [ push ] +on: + pull_request_target: + branches: + - 'master' jobs: pytest: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.x' ] + python-version: [ '3.8.x', '3.9.x', '3.10.x' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/sonatype-jack.yml b/.github/workflows/sonatype-jack.yml index 65b1995..6697fc5 100644 --- a/.github/workflows/sonatype-jack.yml +++ b/.github/workflows/sonatype-jack.yml @@ -1,13 +1,16 @@ name: 'Sonatype Jake' -on: [ push ] +on: + pull_request_target: + branches: + - 'master' jobs: security: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6.x', '3.10.x' ] + python-version: [ '3.8.x', '3.9.x', '3.10.x' ] steps: - uses: actions/checkout@v2 @@ -19,9 +22,6 @@ jobs: - name: Run jake from Sonatype run: | - # needed for Python3.6 - export PYTHONIOENCODING=utf-8 - python -m pip install --upgrade pip pip3 install -r requirements.txt pip3 freeze > frozen.requirements.txt diff --git a/README.md b/README.md index 75ceb41..e403724 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # Maltego TRX Python Library -[![Runs with Python3.6 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml) -[![PyTest with Python3.6 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-pytest.yaml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-pytest.yaml) +[![Runs with Python3.8 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-boot-check.yaml) +[![PyTest with Python3.8 - Python3.10](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-pytest.yaml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/pythonx-pytest.yaml) [![Sonatype Jake](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml/badge.svg)](https://github.com/paterva/maltego-trx/actions/workflows/sonatype-jack.yml) ## Release Notes +__1.6.1__: Update cryptography and Flask dependency and deprecate Python 3.7 + __1.6.0__: Automatically generate am `.mtz` for your local transforms __1.5.2__: Add logging output for invalid / missing params in xml serialization @@ -22,7 +24,7 @@ __1.4.2__: Fixed python3.6 incompatibility ## Getting Started -_Note: Support for Python 2 has been officially discontinued as of July 2021. Please use Python 3.6 or higher to use +_Note: Support for Python 2 has been officially discontinued as of July 2021. Please use Python 3.8 or higher to use up-to-date versions of Maltego TRX._ To install the trx library run the following command: diff --git a/maltego_trx/__init__.py b/maltego_trx/__init__.py index 4c41a25..ac30235 100644 --- a/maltego_trx/__init__.py +++ b/maltego_trx/__init__.py @@ -1 +1 @@ -VERSION = "1.6.0" +VERSION = "1.6.1" diff --git a/maltego_trx/utils.py b/maltego_trx/utils.py index 74ab937..bd2ceab 100644 --- a/maltego_trx/utils.py +++ b/maltego_trx/utils.py @@ -7,8 +7,6 @@ from xml.etree import ElementTree from xml.etree.ElementTree import Element -from six import text_type, binary_type - logger = logging.getLogger("maltego-trx") @@ -39,12 +37,12 @@ def make_printable(val): def force_encoding(val, encoding): - if type(val) == text_type: + if isinstance(val, str): return val.encode(encoding, 'replace').decode(encoding, 'replace') - elif type(val) == binary_type: + elif isinstance(val, bytes): return val.decode(encoding, 'replace') else: - return text_type(val).encode(encoding, 'replace').decode(encoding, 'replace') + return str(val).encode(encoding, 'replace').decode(encoding, 'replace') def remove_invalid_xml_chars(val): diff --git a/requirements.txt b/requirements.txt index d1e00b2..2cf72cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ -flask>=1 -six>=1 -cryptography==3.3.2 # pinned for now as newer versions require setuptools_rust -dataclasses==0.8; python_version < "3.7" +flask>=2.2.3 +cryptography==39.0.1 diff --git a/setup.py b/setup.py index 9d55a91..a29f294 100644 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ setup( name='maltego-trx', + python_requires='>=3.8.0', version=VERSION, description='Python library used to develop Maltego transforms', long_description=long_description, @@ -15,15 +16,9 @@ author_email='support@maltego.com', license='MIT', install_requires=[ - 'flask>=1', - 'six>=1', - 'cryptography==3.3.2' # pinned for now as newer versions require setuptools_rust + 'flask>=2.2.0', + 'cryptography>=39.0.1' ], - extras_require={ - ':python_version == "3.6"': [ - 'dataclasses', - ], - }, packages=[ 'maltego_trx', 'maltego_trx/template_dir',