Skip to content

Commit

Permalink
Merge pull request #5 from ajcr/move_grammar
Browse files Browse the repository at this point in the history
Move grammar.lark back under src/
  • Loading branch information
ajcr authored Nov 2, 2023
2 parents e4e6a09 + 1fb234e commit f69b1bd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include grammar.lark
include src/urn/grammar.lark
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ urn = "urn.cli:main"

[tool.pytest.ini_options]
pythonpath = [
"."
"src"
]
2 changes: 1 addition & 1 deletion src/urn/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main() -> None:
from urn.shell import run_shell
from urn.evaluation import process_query

command_parser = lark.Lark.open("grammar.lark", rel_to=__package__)
command_parser = lark.Lark.open("grammar.lark", rel_to=__file__)

if args.command or args.filename:

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions tests/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@


@pytest.fixture(scope="session")
def parser():
return lark.Lark.open("grammar.lark")
def parser(request):
rel_to = request.config.rootdir / "src" / "urn" / "grammar.lark"
return lark.Lark.open("grammar.lark", rel_to=rel_to)


@pytest.mark.parametrize(
Expand Down

0 comments on commit f69b1bd

Please sign in to comment.