Skip to content

Commit

Permalink
0.7.0 Release (#95)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
Co-authored-by: Maxwell G <[email protected]>
  • Loading branch information
madpah and gotmax23 authored Apr 3, 2024
1 parent f66f2da commit 5c3442a
Show file tree
Hide file tree
Showing 18 changed files with 505 additions and 427 deletions.
37 changes: 37 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf

[*.py]
indent_style = space
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.toml]
indent_style = space
indent_size = 2

[*.md]
charset = latin1
indent_style = space
indent_size = 2
# 2 trailing spaces indicate line breaks.
trim_trailing_whitespace = false

[*.{rst,txt}]
indent_style = space
indent_size = 4

[{*.ini,.bandit,.flake8}]
charset = latin1
indent_style = space
indent_size = 4
27 changes: 27 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[flake8]
## https://flake8.pycqa.org/en/latest/user/configuration.html
## keep in sync with isort config - in `isort.cfg` file

exclude =
build,dist,__pycache__,.eggs,*.egg-info*,
*_cache,*.cache,
.git,.tox,.venv,venv,.venv*,venv*,
_OLD,_TEST,
docs

max-line-length = 120

max-complexity = 10

ignore =
# ignore `self`, `cls` markers of flake8-annotations>=2.0
ANN101,ANN102
# ignore ANN401 for dynamically typed *args and **kwargs
ANN401
# See https://www.flake8rules.com/rules/W503.html
# > Despite being in the best practice section, this will soon be considered an anti-pattern.
# So lets ignore this "suggestion" that is actually an anti-pattern already!
W503
# Until we've refactored code, we need to ignore "is too complex"
# See https://github.com/madpah/requirements-parser/issues/96
C901
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ concurrency:
cancel-in-progress: false # prevent duplicates semantic-release

env:
PYTHON_VERSION_DEFAULT: "3.9"
POETRY_VERSION: "1.4.2"
PYTHON_VERSION_DEFAULT: "3.12"
POETRY_VERSION: "1.8.1"

permissions:
id-token: write
Expand Down
64 changes: 33 additions & 31 deletions .github/workflows/poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ name: Python CI

on:
push:
branches: ["master", "main"]
branches: ["main"]
pull_request:
workflow_dispatch:
schedule:
# schedule weekly tests, since some dependencies are not intended to be pinned
# this means: at 23:42 on Fridays
- cron: '42 23 * * 5'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
REPORTS_DIR: CI_reports
PYTHON_VERSION_DEFAULT: "3.10"
POETRY_VERSION: "1.4.2"
PYTHON_VERSION_DEFAULT: "3.12"
POETRY_VERSION: "1.8.1"
TESTS_REPORTS_ARTIFACT: tests-reports

jobs:
coding-standards:
name: Linting & CodingStandards
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -39,21 +45,24 @@ jobs:
- name: Install dependencies
run: poetry install --no-root
- name: Run tox
run: poetry run tox -e flake8
run: poetry run tox run -e flake8 -s false

static-code-analysis:
name: StaticCodingAnalysis (py${{ matrix.python-version}} ${{ matrix.toxenv-factor }})
runs-on: ubuntu-latest
name: StaticCodingAnalysis (py${{ matrix.python-version}}${{ matrix.toxenv-factors }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- # test with the locked dependencies
python-version: '3.11'
toxenv-factor: 'locked'
os: ubuntu-latest
python-version: '3.12'
toxenv-factors: '-current'
- # test with the lowest dependencies
python-version: '3.7'
toxenv-factor: 'lowest'
os: ubuntu-latest
python-version: '3.8'
toxenv-factors: '-lowest'
steps:
- name: Checkout
# see https://github.com/actions/checkout
Expand All @@ -70,34 +79,24 @@ jobs:
with:
poetry-version: ${{ env.POETRY_VERSION }}
- name: Install dependencies
run: |
pip install --upgrade pip
poetry install --no-root
run: poetry install --no-root
- name: Run tox
run: poetry run tox -e mypy-${{ matrix.toxenv-factor }}
run: poetry run tox run -e mypy${{ matrix.toxenv-factors }} -s false

build-and-test:
name: Test (${{ matrix.os }} py${{ matrix.python-version }} ${{ matrix.toxenv-factor }})
name: Test (${{ matrix.os }} py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
env:
REPORTS_ARTIFACT: tests-reports
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
python-version:
- "3.11" # highest supported
- "3.12" # highest supported
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7" # lowest supported
toxenv-factor: ['locked']
include:
- # test with the lowest dependencies
os: 'ubuntu-latest'
python-version: '3.7'
toxenv: 'lowest'
timeout-minutes: 15
- "3.8" # lowest supported
steps:
- name: Disabled Git auto EOL CRLF transforms
run: |
Expand Down Expand Up @@ -126,17 +125,20 @@ jobs:
- name: Ensure build successful
run: poetry build
- name: Run tox
run: poetry run tox -e py-${{ matrix.toxenv-factor }} -s false
run: poetry run tox run -e py${{ matrix.toxenv-factors }} -s false
- name: Generate coverage reports
run: >
poetry run coverage report &&
if: ${{ failure() || success() }}
shell: bash
run: |
set -eux
poetry run coverage report -m
poetry run coverage xml -o ${{ env.REPORTS_DIR }}/coverage-${{ matrix.os }}-${{ matrix.python-version }}.xml &&
poetry run coverage html -d ${{ env.REPORTS_DIR }}
- name: Artifact reports
if: ${{ ! cancelled() }}
# see https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPORTS_ARTIFACT }}
name: ${{ env.TESTS_REPORTS_ARTIFACT }}
path: ${{ env.REPORTS_DIR }}
if-no-files-found: error
20 changes: 20 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[settings]
## read the docs: https://pycqa.github.io/isort/docs/configuration/options.html
## keep in sync with flake8 config - in `.flake8` file
known_first_party = requirements
skip_gitignore = false
skip_glob =
build/*,dist/*,__pycache__,.eggs,*.egg-info*,
*_cache,*.cache,
.git/*,.tox/*,.venv/*,venv/*,.venv*/*,venv*/*,
_OLD/*,_TEST/*,
docs/*
combine_as_imports = true
default_section = THIRDPARTY
ensure_newline_before_comments = true
include_trailing_comma = true
line_length = 120
multi_line_output = 3
src_paths =
requirements
tests
4 changes: 1 addition & 3 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ no_implicit_optional = True
warn_redundant_casts = True
warn_return_any = True
no_implicit_reexport = True

# needed to silence some py37|py38 differences
warn_unused_ignores = False
warn_unused_ignores = True

[mypy-pytest.*]
ignore_missing_imports = True
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
python: "3.11"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
Expand All @@ -44,4 +44,4 @@ python:
install:
- method: pip
path: .
- requirements: docs/requirements.txt
- requirements: docs/requirements.txt
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @madpah
Loading

0 comments on commit 5c3442a

Please sign in to comment.