Skip to content

Commit

Permalink
drop Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gruebel committed Nov 12, 2023
1 parent 8ce841d commit 33db76a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ on:
- 'CHANGELOG.md'
- '.github/**'

permissions: read-all
permissions:
contents: read

env:
MIN_PYTHON_VERSION: "3.8"

jobs:
bump-version:
Expand Down Expand Up @@ -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 "[email protected]"
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: PR Test

on: pull_request

permissions: read-all
permissions:
contents: read

jobs:
unit-tests:
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ on:
- reopened
- synchronize

permissions: read-all
permissions:
contents: read

jobs:
test:
name: Check code against linter/unit tests
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
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ mypy
# Testing tools
pytest
pytest-cov
mock>=1.0.1,<2
coverage>=4.5.1,<5
coverage
# Additional libraries
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 33db76a

Please sign in to comment.