Skip to content

Commit

Permalink
Move grammar.lark to module base
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcr committed Nov 2, 2023
1 parent 206591e commit 98db31e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include grammar.lark
File renamed without changes.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,9 @@ dev = ["pytest"]
Homepage = "https://github.com/ajcr/urn"

[project.scripts]
urn = "urn.cli:main"
urn = "urn.cli:main"

[tool.pytest.ini_options]
pythonpath = [
"."
]
4 changes: 2 additions & 2 deletions src/urn/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from urn import __version__

DESCRIPTION = "Draw odds calculator."
DESCRIPTION = "Multivariate hypergeometric calculator."


def parse_args() -> argparse.Namespace:
Expand All @@ -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=__file__)
command_parser = lark.Lark.open("grammar.lark", rel_to=__package__)

if args.command or args.filename:

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


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


@pytest.mark.parametrize(
Expand Down

0 comments on commit 98db31e

Please sign in to comment.