mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-06-30 18:54:51 +02:00
22 lines
544 B
Python
22 lines
544 B
Python
from pathlib import Path
|
|
from shutil import copyfile
|
|
|
|
from setuptools import setup
|
|
from setuptools.command.build_py import build_py
|
|
|
|
ROOT = Path(__file__).resolve().parent
|
|
|
|
|
|
class BuildPyWithVersion(build_py):
|
|
def run(self) -> None:
|
|
super().run()
|
|
target = Path(self.build_lib) / "ccma" / "VERSION"
|
|
target.parent.mkdir(parents=True, exist_ok=True)
|
|
copyfile(ROOT / "VERSION", target)
|
|
|
|
|
|
setup(
|
|
version=(ROOT / "VERSION").read_text(encoding="utf-8").strip(),
|
|
cmdclass={"build_py": BuildPyWithVersion},
|
|
)
|