diff --git a/Makefile b/Makefile index 56d00bc..2b6205e 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,12 @@ journey: ${ANTLRFILES} dist: ${ANTLRFILES} rm -rf build/ dist/ python tests/test_general.py - python -m build --wheel + python -m build .PHONY: dist +build: ${ANTLRFILES} +.PHONY: build + ${ANTLRFILES}: RFPL.g4 antlr4 -Dlanguage=Python3 -no-listener -no-visitor RFPL.g4 -o rfpl diff --git a/pyproject.toml b/pyproject.toml index 6f40a1e..44f4661 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,3 +36,6 @@ journey = "journey.__main__:main" [tool.setuptools_scm] version_scheme = "no-guess-dev" + +[tool.setuptools.cmdclass] +build_py = "scripts.build.CustomBuild" diff --git a/scripts/build.py b/scripts/build.py new file mode 100644 index 0000000..f3dad04 --- /dev/null +++ b/scripts/build.py @@ -0,0 +1,9 @@ +from setuptools import setup +from setuptools.command.build_py import build_py +from setuptools.command.install import install +import subprocess + +class CustomBuild(build_py): + def run(self): + subprocess.run(['make', 'build'], check=True) + super().run()