Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/test_python_turso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,5 @@ jobs:
python -c 'import analysator as pt;pt.plot.__dict__'
python -c 'import analysator as pt;pt.calculations.__dict__'
python -c 'import analysator as pt;pt.vlsvfile.__dict__'
python -c 'import analysator as pt;pt.miscellaneous.__dict__'
python -c 'import analysator as pt;pt.miscellaneous.__dict__;import analysator.miscellaneous._commithash as chash; print(chash.commithash)'


12 changes: 12 additions & 0 deletions hatch_build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import sys, subprocess
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
from packaging.version import Version

class CustomBuildHook(BuildHookInterface):
def initialize(self,*param,**kwargs):
with open("./analysator/miscellaneous/_commithash.py","w") as file:
commithash=subprocess.run(["git","rev-parse","HEAD"],capture_output=True).stdout.decode('utf-8')
commithash=commithash.strip("\n")
file.write(f"commithash='{commithash}'"+"\n")
file.close()

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling","pip"]
build-backend = "hatchling.build"


Expand Down Expand Up @@ -52,6 +52,8 @@ vlsvrs_build = [
Homepage = "https://github.com/fmihpc/analysator"
Issues = "https://github.com/fmihpc/analysator/issues"

[tool.hatch.build.hooks.custom]

[tool.hatch.build.targets.wheel]
packages = ["./analysator","./pytools"]

Expand Down
Loading