From 33db76af5bd3713848d7b3da5b8552beb40c038f Mon Sep 17 00:00:00 2001 From: gruebel Date: Sun, 12 Nov 2023 15:27:04 +0100 Subject: [PATCH] drop Python 3.7 --- .github/workflows/main.yml | 17 +++++++++-------- .github/workflows/pr.yml | 7 ++++--- .github/workflows/test-build-publish.yml | 6 ++++-- setup.py | 3 +-- test-requirements.txt | 3 +-- tox.ini | 6 +++--- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 82a2f13..a93820a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,11 @@ on: - 'CHANGELOG.md' - '.github/**' -permissions: read-all +permissions: + contents: read + +env: + MIN_PYTHON_VERSION: "3.8" jobs: bump-version: @@ -54,10 +58,9 @@ jobs: contents: write steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3 - - name: Set up Python 3.7 - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 + - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 with: - python-version: 3.7 + python-version: ${{ env.MIN_PYTHON_VERSION }} - name: create python package run: | git config --local user.email "action@github.com" @@ -77,8 +80,6 @@ jobs: needs: [bump-version, publish-package] runs-on: ubuntu-latest environment: release - env: - PYTHON_VERSION: "3.7" steps: - name: Checkout checkov uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3 @@ -87,14 +88,14 @@ jobs: repository: bridgecrewio/checkov - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 with: - python-version: ${{ env.PYTHON_VERSION }} + python-version: ${{ env.MIN_PYTHON_VERSION }} - name: Prepare PR run: | # install needed tools python -m pip install --no-cache-dir --upgrade pipenv "pipenv-setup[black]" "vistir<0.7.0" # update Pipfile - pipenv --python ${{ env.PYTHON_VERSION }} + pipenv --python ${{ env.MIN_PYTHON_VERSION }} pipenv install bc-python-hcl2==${{ needs.bump-version.outputs.version }} pipenv lock diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 33dbef7..43d6873 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -2,7 +2,8 @@ name: PR Test on: pull_request -permissions: read-all +permissions: + contents: read jobs: unit-tests: @@ -13,12 +14,12 @@ jobs: uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 with: python-version: | - 3.7 3.8 3.9 3.10 3.11 - 3.12-dev + 3.12 + allow-prereleases: true - name: run UT run: | pip install tox diff --git a/.github/workflows/test-build-publish.yml b/.github/workflows/test-build-publish.yml index 9e75396..4336d4c 100644 --- a/.github/workflows/test-build-publish.yml +++ b/.github/workflows/test-build-publish.yml @@ -9,7 +9,8 @@ on: - reopened - synchronize -permissions: read-all +permissions: + contents: read jobs: test: @@ -17,13 +18,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install dependencies run: python -m pip install tox tox-gh-actions - name: Test with Tox diff --git a/setup.py b/setup.py index b005db9..6758853 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def get_requirements(): setup( name='bc-python-hcl2', - python_requires='>=3.7', + python_requires='>=3.8', version=get_version(), description="A parser for HCL2", long_description=get_long_description(), @@ -49,7 +49,6 @@ def get_requirements(): 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', diff --git a/test-requirements.txt b/test-requirements.txt index 4616904..dca932f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,6 +5,5 @@ mypy # Testing tools pytest pytest-cov -mock>=1.0.1,<2 -coverage>=4.5.1,<5 +coverage # Additional libraries diff --git a/tox.ini b/tox.ini index f39a112..28f872e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist=lint,{py37}-unit,{py38}-unit,{py39}-unit,{py310}-unit,{py311}-unit,{py312}-unit +envlist=lint,{py38}-unit,{py39}-unit,{py310}-unit,{py311}-unit,{py312}-unit skipsdist=true [testenv] @@ -10,7 +10,7 @@ commands = [testenv:lint] whitelist_externals=npm -basepython=python3.7 +basepython=python3.8 commands = pip install --upgrade -r requirements.txt -r test-requirements.txt -e . pylint --rcfile=pylintrc --output-format=colorized hcl2 test bin setup.py @@ -21,7 +21,7 @@ commands = [testenv:tf_test] whitelist_externals=rm passenv = TERRAFORM_CONFIG -basepython=python3.7 +basepython=python3.8 commands = pip install --upgrade -r requirements.txt -r test-requirements.txt -e . rm -f hcl2/.lark_cache.bin