Skip to content

Commit ff165aa

Browse files
committed
Went back to build hook to try to get builds to be cleaner and keep binaries out of VCS
1 parent f9087c9 commit ff165aa

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

build_differ.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def main():
5454
version = get_version()
5555
print(f"Version: {version}")
5656

57-
dist_dir = "./dist/"
57+
dist_dir = "./src/python_redlines/dist/"
5858

5959
# Build for Linux
6060
print("Building for Linux...")

dist/.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
*
2-
!linux-x64-*.tar.gz
3-
!osx-x64-*.tar.gz
4-
!win-x64-*.zip
5-
!.gitignore`
2+
!.gitignore

dist/linux-x64-0.0.4.tar.gz

-65.4 MB
Binary file not shown.

dist/osx-x64-0.0.4.tar.gz

-64.7 MB
Binary file not shown.

dist/win-x64-0.0.4.zip

-67.5 MB
Binary file not shown.

hatch_run_build_hook.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import subprocess
2+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
3+
4+
class HatchRunBuildHook(BuildHookInterface):
5+
PLUGIN_NAME = 'hatch-run-build'
6+
7+
def initialize(self, version, build_data):
8+
# Run the 'hatch run build' command
9+
subprocess.run(['hatch', 'run', 'build'], check=True)

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ artifacts = [
1111
"*.tar.gz",
1212
]
1313

14+
# Build hook to build the binaries for distribution...
15+
[tool.hatch.build.hooks.custom]
16+
path = "hatch_run_build_hook.py"
17+
1418
[project]
1519
name = "python-redlines"
1620
dynamic = ["version"]

0 commit comments

Comments
 (0)