Skip to content

Commit

Permalink
Merge pull request #117 from dev-cafe/fix-generator-bug
Browse files Browse the repository at this point in the history
Locate hard-copy of `pyparsing` *inside* `plumbing` folder
  • Loading branch information
bast authored Sep 13, 2022
2 parents 1af13f2 + 93b9a79 commit 8588a38
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion parselglossy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 4 additions & 0 deletions parselglossy/grammars/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions parselglossy/grammars/getkw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -78,10 +74,7 @@ test = [
"coverage",
"hypothesis",
"pytest",
"pytest-black",
"pytest-cov",
"pytest-flake8",
"pytest-mypy",
"pytest-sugar",
]
dev = [
Expand Down

0 comments on commit 8588a38

Please sign in to comment.