Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 27, 2022
1 parent 9cb94f9 commit a5685c7
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 80 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ indent_size = 4
indent_style = space
trim_trailing_whitespace = true

[tabulated_rst.py]
trim_trailing_whitespace = false

# Two-space indentation
[*.yml]
indent_size = 2
40 changes: 6 additions & 34 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
name: Lint

on: [push, pull_request]

env:
FORCE_COLOR: 1
on: [push, pull_request, workflow_dispatch]

jobs:
build:
runs-on: ubuntu-20.04
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/.cache/pre-commit
key:
lint-v2-${{ hashFiles('**/setup.py') }}-${{
hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: |
lint-v2-
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U tox
- name: Lint
run: tox -e lint
env:
PRE_COMMIT_COLOR: always
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v2.0.3
35 changes: 8 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,28 @@
name: Test

on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

jobs:
build:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu, os: ubuntu-latest }
- { codecov-flag: GHA_macOS, os: macos-latest }
- { codecov-flag: GHA_Windows, os: windows-latest }
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v2-${{
hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v2-
cache: pip
cache-dependency-path: setup.py

- name: Install dependencies
run: |
Expand All @@ -49,12 +31,11 @@ jobs:
python -m pip install -U tox
- name: Tox tests
shell: bash
run: |
tox -e py
- name: Upload coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.codecov-flag }}
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
33 changes: 24 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.32.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
args: ["--target-version", "py36"]
Expand All @@ -15,30 +15,45 @@ repos:
types: []

- repo: https://github.com/PyCQA/isort
rev: 5.5.1
rev: 5.10.1
hooks:
- id: isort

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.6.0
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.2.0
hooks:
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/prettier/prettier
rev: 2.1.1
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.3.3
hooks:
- id: pyproject-fmt

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]

ci:
autoupdate_schedule: quarterly
1 change: 0 additions & 1 deletion COPYING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for i in range(10):
cprint("Attention!", "red", attrs=["bold"], file=sys.stderr)
```

## Text Properties
## Text properties

Text colors:

Expand Down
14 changes: 9 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
[tox]
envlist =
lint
py{36, 37, 38, 39, 310}
py{310, 39, 38, 37, 36}

[testenv]
passenv =
FORCE_COLOR
extras =
tests
commands =
{envpython} -m pytest --cov termcolor --cov tests --cov-report xml {posargs}
passenv = FORCE_COLOR

[testenv:lint]
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
passenv =
PRE_COMMIT_COLOR
skip_install = true
passenv = PRE_COMMIT_COLOR
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure

0 comments on commit a5685c7

Please sign in to comment.