diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cedcf9..43b22b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,15 +42,15 @@ jobs: - name: Flake8 lints run: | - python -m pytest --flake8 parselglossy + python -m flake8 parselglossy - name: Black lints run: | - python -m pytest --black parselglossy + python -m black --check parselglossy - name: Mypy lints run: | - python -m pytest --mypy parselglossy + python -m mypy parselglossy - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 670d3d3..3967305 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,10 @@ repos: rev: 22.3.0 hooks: - id: black + - repo: https://github.com/pycqa/flake8 + rev: 5.0.3 + hooks: + - id: flake8 - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.3.0 hooks: diff --git a/parselglossy/api.py b/parselglossy/api.py index 6a9e383..4896e1b 100644 --- a/parselglossy/api.py +++ b/parselglossy/api.py @@ -153,7 +153,7 @@ def generate( copier(x, where_ / "plumbing") # copy pyparsing ppfolder = Path(ppfile).parent - dest = where_ / "pyparsing" + dest = where_ / "plumbing/pyparsing" copytree(ppfolder, dest, ignore=ignore_patterns("__pycache__")) folder_permissions(dest) # extract `parse_string_to_dict` and write it into `getkw.py` diff --git a/parselglossy/grammars/atoms.py b/parselglossy/grammars/atoms.py index 7c4f615..b651397 100644 --- a/parselglossy/grammars/atoms.py +++ b/parselglossy/grammars/atoms.py @@ -34,6 +34,10 @@ try: import pyparsing as pp + + if pp.__version__.split(".")[0] < "3": + # Import local copy + from . import pyparsing as pp # type: ignore except ImportError: # Import local copy from . import pyparsing as pp # type: ignore diff --git a/parselglossy/grammars/getkw.py b/parselglossy/grammars/getkw.py index a3fce04..8172c67 100644 --- a/parselglossy/grammars/getkw.py +++ b/parselglossy/grammars/getkw.py @@ -43,6 +43,10 @@ try: import pyparsing as pp + + if pp.__version__.split(".")[0] < "3": + # Import local copy + from . import pyparsing as pp # type: ignore except ImportError: # Import local copy from . import pyparsing as pp # type: ignore diff --git a/pyproject.toml b/pyproject.toml index 20c1dc3..557b7a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,5 @@ [tool.isort] -multi_line_output = 3 -include_trailing_comma = true -force_grid_wrap = 0 -use_parentheses = true -line_length = 88 +profile = "black" [tool.pytest.ini_options] addopts = "-rws --ignore=setup.py" @@ -78,10 +74,7 @@ test = [ "coverage", "hypothesis", "pytest", - "pytest-black", "pytest-cov", - "pytest-flake8", - "pytest-mypy", "pytest-sugar", ] dev = [