Skip to content

Commit

Permalink
Fix CI (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>

Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat authored Jan 13, 2023
1 parent 03324a7 commit 913c311
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 59 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import codecs; import os; import sys
env = f"TOXENV=py3{sys.version_info[0]}\n"
print("Picked:\n{env}for{sys.version}")
with codecs.open(os.environ["GITHUB_ENV"], "a", "utf-8") as file_handler:
file_handler.write(env)
shell: python
- name: Setup test suite
run: tox -vv --notest
run: tox -e py${{ matrix.py }} -vv --notest
- name: Run test suite
run: tox --skip-pkg-install
run: tox -e py${{ matrix.py }} --skip-pkg-install
env:
PYTEST_ADDOPTS: "-vv --durations=20"
CI_RUN: "yes"
Expand Down
12 changes: 12 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
MD013:
code_blocks: false
headers: false
line_length: 120
tables: false

MD046:
style: fenced

MD033:
allowed_elements:
- a
61 changes: 35 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -11,52 +11,61 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [ "--py37-plus" ]
exclude: "^(tests/roots/test-dummy/dummy_module.py)$"
- id: pyupgrade
files: "^(tests/roots/test-dummy/dummy_module.py)$"
args: [ "--py36-plus" ]
args: ["--py37-plus"]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
args: [ --safe ]
args: [--safe]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [ black==22.10 ]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: rst-backticks
additional_dependencies: [black==22.12]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "0.5.2"
rev: "0.6.0"
hooks:
- id: tox-ini-fmt
args: [ "-p", "fix" ]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ]
args: ["-p", "fix"]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==22.10.27
- flake8-bugbear==22.12.6
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
- flake8-spellcheck==0.28
- flake8-unused-arguments==0.0.12
- flake8-noqa==1.2.9
- pep8-naming==0.13.2
- flake8-noqa==1.3
- pep8-naming==0.13.3
- flake8-pyproject==1.2.2
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- "@prettier/[email protected]"
args: ["--print-width=120", "--prose-wrap=always"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
hooks:
- id: markdownlint
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# 0.0.4 - 2022-01-08
# Changelog

## 0.0.4 - 2022-01-08

- Support tox 4.0.0a10

# 0.0.3 - 2021-09-17
## 0.0.3 - 2021-09-17

- Specify support for 3.10

# 0.0.2 - 2021-09-17
## 0.0.2 - 2021-09-17

- Add environment grouping

# 0.0.1 - 2021-09-17
## 0.0.1 - 2021-09-17

- First version
6 changes: 0 additions & 6 deletions codecov.yml

This file was deleted.

9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=65.5", "setuptools-scm>=7.0.5"]
requires = ["setuptools>=65.7", "setuptools-scm>=7.1"]
build-backend = 'setuptools.build_meta'

[tool.black]
Expand All @@ -19,3 +19,10 @@ testpaths = ["tests"]
[tool.mypy]
python_version = "3.9"
strict = true

[tool.flake8]
max-complexity = 22
max-line-length = 120
unused-arguments-ignore-abstract-functions = true
noqa-require-code = true
dictionaries = ["en_US", "python", "technical", "django"]
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ project_urls =
[options]
packages = find:
install_requires =
tox>=4.0.0b2
tox>=4.2.8
python_requires = >=3.7
include_package_data = True
package_dir =
Expand All @@ -49,7 +49,8 @@ tox =

[options.extras_require]
test =
covdefaults>=2.2
covdefaults>=2.2.2
devpi-process>=0.3
pytest>=7.2
pytest-cov>=4
pytest-mock>=3.10
Expand Down
4 changes: 4 additions & 0 deletions tests/test_tox_gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ def test_gh_ok(monkeypatch: MonkeyPatch, tox_project: ToxProjectCreator) -> None
assert result.out.splitlines() == [
"ROOT: running tox-gh",
"ROOT: tox-gh set a, b",
"a: freeze> python -m pip freeze --all",
ANY, # freeze list
"::group::tox:a",
"::endgroup::",
ANY, # a finished
"b: freeze> python -m pip freeze --all",
ANY, # freeze list
"::group::tox:b",
"::endgroup::",
ANY, # a status
Expand Down
14 changes: 4 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ passenv =
PROGRAMDATA
skip_install = true
deps =
pre-commit>=2.20
pre-commit>=2.21
commands =
pre-commit run --all-files --show-diff-on-failure

Expand All @@ -43,7 +43,7 @@ description = run type check on code base
setenv =
{tty:MYPY_FORCE_COLOR = 1}
deps =
mypy==0.982
mypy==0.991
types-docutils>=0.19.1.1
commands =
mypy src {posargs}
Expand All @@ -55,8 +55,8 @@ setenv =
{tty:FORCE_COLOR = 1}
skip_install = true
deps =
build[virtualenv]>=0.9
twine>=4.0.1
build[virtualenv]>=0.10
twine>=4.0.2
changedir = {toxinidir}
commands =
python -m build --sdist --wheel -o {envtmpdir} .
Expand All @@ -78,9 +78,3 @@ python =
3.8 = py38
3.9 = py39, type, dev, readme
3.10 = py310

[flake8]
max-complexity = 22
max-line-length = 120
noqa-require-code = true
dictionaries = en_US,python,technical,django

0 comments on commit 913c311

Please sign in to comment.