diff --git a/.gitignore b/.gitignore index 6c5f6a4..cf4b461 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,9 @@ *.pyo # Cache -__pycache__/ -*.egg-info/ -.pytest_cache/ +**/__pycache__/ +**/*.egg-info/ +**/.pytest_cache/ .coverage .htmlcov/ @@ -21,4 +21,4 @@ dist/ build/ # Generated test files -tests/test.py +tests/*.py diff --git a/pyproject.toml b/pyproject.toml index 6a1503e..d63dcf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,9 +5,15 @@ description = "Tamil code compiler" requires-python = ">=3.9" dependencies = [] -[project.scripts] +[project.gui-scripts] tampy = "tampy.cli:main" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/tampy"] + +[tool.hatch.build.targets.sdist] +include = ["/src"] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..fcccae1 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = src diff --git a/src/tampy/cli.py b/src/tampy/cli.py index 724b6d5..36ac9fe 100644 --- a/src/tampy/cli.py +++ b/src/tampy/cli.py @@ -5,8 +5,8 @@ import subprocess import sys from pathlib import Path -from src.tampy.transpiler import SimpleTranspiler -from src.tampy.keywords import load_keywords +from .transpiler import SimpleTranspiler +from .keywords import load_keywords def main(): diff --git a/tests/test_transpiler.py b/tests/test_transpiler.py index e94978f..8cb8c9e 100644 --- a/tests/test_transpiler.py +++ b/tests/test_transpiler.py @@ -2,7 +2,9 @@ import ast import pytest -from src.tampy.transpiler import SimpleTranspiler +import sys +sys.path.insert(0, "..") +from tampy.transpiler import SimpleTranspiler def test_simple_transpile(): diff --git a/uv.lock b/uv.lock index 7b9c4bf..a55514e 100644 --- a/uv.lock +++ b/uv.lock @@ -5,4 +5,4 @@ requires-python = ">=3.9" [[package]] name = "tampy" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." }