Skip to content

Commit

Permalink
git - Merge pull request #106 from DinoTools/update_ci_test
Browse files Browse the repository at this point in the history
ci - Update ci scripts
phibos authored Jun 2, 2023
2 parents 0faaa17 + f5e2b6a commit 71ee21a
Showing 7 changed files with 53 additions and 54 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Tests
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0

name: Python CI Tests

on:
push:
@@ -29,31 +32,23 @@ jobs:
- {name: Windows, python: '3.9', os: windows-latest, tox: py39}
# ToDo: There are errors on Mac, but I don't know why: Connection timeout or reset
# - {name: Mac, python: '3.9', os: macos-latest, tox: py39}
- {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
- {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3}
- {name: 'PyPy 3.9', python: pypy3.9, os: ubuntu-latest, tox: pypy39}

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
- uses: "actions/checkout@v3"

- uses: "actions/setup-python@v4"
with:
python-version: ${{ matrix.python }}
- name: update pip
run: |
python -VV
python -m site
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
- run: pip install tox
cache: 'pip' # caching pip dependencies

- name: Install tox and any other packages
run: pip install tox

- name: "Run tox targets for ${{ matrix.python }}"
run: tox -e ${{ matrix.tox }}
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

46 changes: 30 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -3,27 +3,30 @@

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
# Forbid files which have a UTF-8 byte-order marker
- id: check-byte-order-marker
# Prevent giant files from being committed
- id: check-added-large-files
# Simply check whether files parse as valid python
- id: check-ast
# Require literal syntax when initializing empty or zero Python builtin types
- id: check-builtin-literals
# Check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# Checks for a common error of placing code before the docstring
- id: check-docstring-first
# Ensures that (non-binary) executables have a shebang
- id: check-executables-have-shebangs
# Check for files that contain merge conflict strings
- id: check-merge-conflict
# Checks that scripts with shebangs are executable
- id: check-shebang-scripts-are-executable
# Checks for symlinks which do not point to anything
- id: check-symlinks
# This hook checks yaml files for parseable syntax
- id: check-yaml
files: .drone.yml
# Drone CI config allows and requires multiple documents
args: [--allow-multiple-documents]
- id: check-yaml
exclude: .drone.yml
# Check for debugger imports and py37+ breakpoint() calls in python source
- id: debug-statements
# Detects the presence of private keys
- id: detect-private-key
# Ensures that a file is either empty, or ends with one newline
@@ -37,36 +40,39 @@ repos:
exclude: ^tests/(json|response|xml)/

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
rev: v1.10.0
hooks:
# Enforce that `noqa` annotations always occur with specific codes
- id: python-check-blanket-noqa
# Enforce that # type: ignore annotations always occur with specific codes
- id: python-check-blanket-type-ignore
# Prevent common mistakes of `assert mck.not_called()`, `assert mck.called_once_with(...)` and `mck.assert_called`
- id: python-check-mock-methods
# A quick check for the `eval()` built-in function
- id: python-no-eval
# A quick check for the deprecated `.warn()` method of python loggers
- id: python-no-log-warn
# ToDo: Fix code
# # Enforce that python3.6+ type annotations are used instead of type comments
# - id: python-use-type-annotations
# Enforce that python3.6+ type annotations are used instead of type comments
- id: python-use-type-annotations
# Detect common mistake of using single backticks when writing rst
- id: rst-backticks
# Detect mistake of rst directive not ending with double colon
- id: rst-directive-colons
# Detect mistake of inline code touching normal text in rst
- id: rst-inline-touching-normal
# Forbid files which have a UTF-8 Unicode replacement character
- id: text-unicode-replacement-char

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.2
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
rev: v1.3.0
hooks:
- id: mypy
args: [--no-strict-optional, --ignore-missing-imports, --allow-untyped-global]
@@ -76,7 +82,15 @@ repos:
# # The REUSE helper tool assists with achieving and confirming REUSE compliance.
# # See: https://reuse.software/
# - repo: https://github.com/fsfe/reuse-tool
# rev: v0.11.1
# rev: v1.1.2
# hooks:
# - id: reuse
# exclude: ^tests/(json|response|xml)/

ci:
autofix_commit_msg: |
* - auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autofix_prs: false
autoupdate_commit_msg: 'ci - pre-commit autoupdate'
Empty file modified docs/source/conf.py
100644 → 100755
Empty file.
Empty file modified examples/get_areas.py
100644 → 100755
Empty file.
Empty file modified setup.py
100644 → 100755
Empty file.
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SPDX-FileCopyrightText: none
# SPDX-License-Identifier: CC0-1.0

[tox]
envlist = py36,py37,py38,py39,pypy3
envlist = py37,py38,py39,py310,py311,pypy39

[testenv]
deps =
@@ -9,8 +12,9 @@ commands = pytest --cov overpy --cov-report=term-missing -v tests/

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
pypy3: pypy3
3.10: py310
3.11: py311
pypy3.9: pypy39

0 comments on commit 71ee21a

Please sign in to comment.