Skip to content

Commit

Permalink
Merge pull request #181 from yfukai/migrating_to_understandable_defin…
Browse files Browse the repository at this point in the history
…ition

Migrating to understandable definition of variables
  • Loading branch information
yfukai authored Feb 10, 2022
2 parents 3c5791f + 75013d3 commit f3167d4
Show file tree
Hide file tree
Showing 10 changed files with 368 additions and 820 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST212,RST301,W503,S101,N803,N806,E713,E714,E266
ignore = E203,E501,RST201,RST203,RST212,RST301,W503,S101,N803,N806,E713,E714,E266,C901
max-line-length = 80
max-complexity = 10
docstring-convention = google
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
include:
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
# - { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
- { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
# - { python-version: 3.8, os: ubuntu-latest, session: "mypy" }
# - { python-version: 3.7, os: ubuntu-latest, session: "mypy" }
- { python-version: "3.10", os: ubuntu-latest, session: "tests" }
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
- { python-version: 3.8, os: ubuntu-latest, session: "tests" }
- { python-version: 3.7, os: ubuntu-latest, session: "tests" }
- { python-version: 3.9, os: windows-latest, session: "tests" }
- { python-version: 3.9, os: macos-latest, session: "tests" }
# - { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
- { python-version: 3.9, os: ubuntu-latest, session: "typeguard" }
- { python-version: 3.9, os: ubuntu-latest, session: "xdoctest" }
- { python-version: 3.8, os: ubuntu-latest, session: "docs-build" }

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
/docs/_build/
/src/*.egg-info/
__pycache__/
tests/data/testimages_lowncc.npy
tests/data/testimages_lowncc2.npy
tests/data/testimages_lowncc2.csv
56 changes: 19 additions & 37 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
repos:
- repo: local
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
- id: check-toml
name: Check Toml
entry: check-toml
language: system
types: [toml]
- id: check-yaml
name: Check Yaml
entry: check-yaml
language: system
types: [yaml]
- id: check-toml
- id: detect-private-key
# - id: name-tests-test
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
types: [text]
stages: [commit, push, manual]
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.7.1
hooks:
- id: reorder-python-imports
name: Reorder python imports
entry: reorder-python-imports
language: system
types: [python]
args: [--application-directories=src]
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
types: [text]
stages: [commit, push, manual]
- repo: https://github.com/prettier/pre-commit
rev: v2.1.2
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.0
hooks:
- id: prettier
15 changes: 3 additions & 12 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


package = "m2stitch"
python_versions = ["3.9", "3.8", "3.7"]
python_versions = ["3.10", "3.9", "3.8"]
nox.options.sessions = (
"pre-commit",
"safety",
Expand Down Expand Up @@ -88,17 +88,8 @@ def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
session.install(
"black",
"darglint",
"flake8",
"flake8-bandit",
"flake8-bugbear",
"flake8-docstrings",
"flake8-rst-docstrings",
"pep8-naming",
"pre-commit",
"pre-commit-hooks",
"reorder-python-imports",
)
session.run("pre-commit", *args)
if args and args[0] == "install":
Expand Down Expand Up @@ -128,7 +119,7 @@ def mypy(session: Session) -> None:
def tests(session: Session) -> None:
"""Run the test suite."""
session.install(".")
session.install("coverage[toml]", "pytest", "pygments")
session.install("coverage[toml]", "pytest", "pygments", "pytest-datadir")
try:
session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs)
finally:
Expand Down Expand Up @@ -156,7 +147,7 @@ def coverage(session: Session) -> None:
def typeguard(session: Session) -> None:
"""Runtime type checking using Typeguard."""
session.install(".")
session.install("pytest", "typeguard", "pygments")
session.install("pytest", "typeguard", "pygments", "pytest-datadir")
session.run("pytest", f"--typeguard-packages={package}", *session.posargs)


Expand Down
Loading

0 comments on commit f3167d4

Please sign in to comment.