Skip to content

Commit

Permalink
Fix workflows and dev configs (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio authored Aug 14, 2023
1 parent b8ab533 commit 524f2fb
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10, 3.11]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 10 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
.PHONY: init test lint pretty precommit_hook bump_major bump_minor bump_patch ci

BIN = .venv/bin/
CODE = context_logging

.PHONY: init
init:
python3 -m venv .venv
poetry install

.PHONY: test
test:
$(BIN)pytest --verbosity=2 --showlocals --strict --log-level=DEBUG --cov=$(CODE) $(args)
$(BIN)pytest --verbosity=2 --showlocals --strict-markers --log-level=DEBUG --cov=$(CODE) $(args)

.PHONY: lint
lint:
$(BIN)flake8 --jobs 4 --statistics --show-source $(CODE) tests
$(BIN)pylint --jobs 4 --rcfile=setup.cfg $(CODE)
$(BIN)mypy $(CODE) tests
$(BIN)black --skip-string-normalization --line-length=79 --check $(CODE) tests
$(BIN)pytest --dead-fixtures --dup-fixtures

.PHONY: pretty
pretty:
$(BIN)isort --apply --recursive $(CODE) tests
$(BIN)black --skip-string-normalization --line-length=79 $(CODE) tests
$(BIN)unify --in-place --recursive $(CODE) tests

.PHONY: precommit_hook
precommit_hook:
echo '#!/bin/sh\nmake lint test\n' > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

.PHONY: bump_major
bump_major:
$(BIN)bumpversion major

.PHONY: bump_minor
bump_minor:
$(BIN)bumpversion minor

.PHONY: bump_patch
bump_patch:
$(BIN)bumpversion patch

.PHONY: ci
ci: lint test
ci: $(BIN)codecov
60 changes: 32 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ codecov = "^2.1.8"
flake8-awesome = "^1"
mypy = "*"
pylint = [
{ version = "^2.17.5", python = ">=3.8" },
{ version = "^2", python = "<3.8" }
{ version = "^2.17.5", python = ">=3.8" },
{ version = "^2", python = "<3.8" }
]
py = "^1.11"
pytest = "^7"
pytest-asyncio = "^0.14"
pytest-cov = "^2"
pytest-asyncio = "^0.21"
pytest-cov = "^4"
pytest-deadfixtures = "^2"
pytest-mock = "^3"
unify = "^0.5"
types-deprecated = "^1.2.9.3"
unify = "^0.5"

[build-system]
requires = ["poetry>=1.0"]
Expand Down
19 changes: 11 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
enable-extensions = G
exclude = .git, .venv
ignore =
A003 ; 'id' is a python builtin, consider renaming the class attribute
W503 ; line break before binary operator
S101 ; Use of assert detected
# 'id' is a python builtin, consider renaming the class attribute
A003
# line break before binary operator
W503
# Use of assert detected
S101
max-complexity = 8
max-annotations-complexity = 3
max-expression-complexity = 7
Expand Down Expand Up @@ -43,11 +46,11 @@ max-statements=20
output-format = colorized

disable=
C0103, ; Constant name "api" doesn't conform to UPPER_CASE naming style (invalid-name)
C0111, ; Missing module docstring (missing-docstring)
E0213, ; Method should have "self" as first argument (no-self-argument) - N805 for flake8
R0901, ; Too many ancestors (m/n) (too-many-ancestors)
R0903, ; Too few public methods (m/n) (too-few-public-methods)
C0103, # Constant name "api" doesn't conform to UPPER_CASE naming style (invalid-name)
C0111, # Missing module docstring (missing-docstring)
E0213, # Method should have "self" as first argument (no-self-argument) - N805 for flake8
R0901, # Too many ancestors (m/n) (too-many-ancestors)
R0903, # Too few public methods (m/n) (too-few-public-methods)

ignored-classes=
contextlib.closing,
Expand Down

0 comments on commit 524f2fb

Please sign in to comment.