Skip to content

Commit

Permalink
feat: drop python 3.6 support (#612)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Drop Python 3.6 support due to end of life.
  • Loading branch information
noahnu committed Aug 11, 2022
1 parent 2a85b0e commit bcdfd89
Show file tree
Hide file tree
Showing 17 changed files with 842 additions and 773 deletions.
12 changes: 0 additions & 12 deletions .github/actions/detect-env/action.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/actions/python/action.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: setup-env
description: Setup Environment
inputs:
python-version:
description: Version of python
required: true
outputs:
python-version:
value: ${{ steps.detect-python.outputs.version }}
description: Detected Python version.
runs:
using: "composite"
steps:
- name: Determine Commit Sha
shell: bash
run: echo COMMIT_SHA=$(jq -r ".pull_request.head.sha // .check_run.head_sha // .after" $GITHUB_EVENT_PATH) >> $GITHUB_ENV
- name: Detect Python Version
id: detect-python
run: |
if [[ -z "${{ inputs.python-version }}" ]]; then
echo "::set-output name=version::$(cat .python-version | tr -d '\n')"
else
echo "::set-output name=version::${{ inputs.python-version }}"
fi
shell: bash
- name: Detect Poetry Version
id: detect-poetry
run: |
echo "::set-output name=version::$(cat .poetry-version | tr -d '\n')"
shell: bash
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3.1
with:
version: ${{ steps.detect-poetry.outputs.version }}
virtualenvs-create: true
virtualenvs-in-project: true
47 changes: 21 additions & 26 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- uses: actions/checkout@v3.0.2
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Lint
Expand All @@ -35,23 +32,28 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11-dev']
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.0.2
- name: Setup Environment
uses: ./.github/actions/python
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
- name: Install project dependencies
run: . script/bootstrap
shell: bash
- name: Run tests
- name: Run Tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
run: |
poetry run invoke test --coverage
if: matrix.python-version != '3.11-dev'
run: poetry run invoke test --coverage
# pyinvoke doesn't support python 3.11 yet
- name: Run Tests (skip invoke)
shell: bash
if: matrix.python-version == '3.11-dev'
run: poetry run pytest ./tests
# # TODO: How to do this with poetry?
# version_checks:
# name: Dependency Version Constraint Checks
Expand All @@ -60,11 +62,10 @@ jobs:
# env:
# SKIP_DEPS: 1
# steps:
# - uses: actions/checkout@v2
# - uses: ./.github/actions/detect-env
# - name: Setup Environment
# uses: ./.github/actions/python
# with:
# - uses: actions/checkout@v3.0.2
# - name: Setup Environment
# uses: ./.github/actions/setup-env
# with:
# python-version: 3.7 # it's min, so we'll use an older version of python
# - name: Install project dependencies
# run: |
Expand All @@ -82,14 +83,11 @@ jobs:
# Dry run check does not need to wait for others
if: (github.event_name == 'pull_request' || github.ref == 'refs/heads/next') && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
- uses: ./.github/actions/detect-env
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
uses: ./.github/actions/setup-env
- name: Install project dependencies
run: . script/bootstrap
- name: Dry Release
Expand All @@ -109,15 +107,12 @@ jobs:
needs: [analysis, tests] # [version_checks]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/detect-env
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
uses: ./.github/actions/setup-env
- uses: cycjimmy/semantic-release-action@v2
with:
branch: master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ __pycache__/
# Distribution / packaging
.Python
.tox
.poetry
build/
develop-eggs/
dist/
Expand Down
1 change: 1 addition & 0 deletions .poetry-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.0b3
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0
3.10.4
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ These are mostly guidelines, not rules. Use your best judgment, and feel free to
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Pull Requests](#pull-requests)
- [Debugging](#debugging)

[Styleguides](#styleguides)

Expand Down Expand Up @@ -86,6 +87,10 @@ Creating a pull request uses our template using the GitHub web interface.

Fill in the relevant sections, clearly linking the issue the change is attemping to resolve.

### Debugging

`debugpy` is installed in local development. A VSCode launch config is provided. Run `inv test -v -d` to enable the debugger (`-d` for debug). It'll then wait for you to attach your VSCode debugging client.

## Styleguides

### Commit Messages
Expand Down
Loading

0 comments on commit bcdfd89

Please sign in to comment.