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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ packages = ["mseedindex"]

[tool.hatch.build.targets.wheel.force-include]
"python/__main__.py" = "mseedindex/__main__.py"
"python/__init__.py" = "mseedindex/__init__.py"
15 changes: 15 additions & 0 deletions python/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import sys
from pathlib import Path

def get_path_to_binary() -> Path:
"""
Returns a path to a binary of mseedindex, regardless of the OS.
"""
if sys.platform.lower().startswith("win"):
binary_name = "mseedindex.exe"
else:
binary_name = "mseedindex"

binary_path = Path(__file__).parent / binary_name
return binary_path

15 changes: 5 additions & 10 deletions python/__main__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# A Python wrapper for PyPI packaging entry point
import subprocess
import subprocess
import sys
from pathlib import Path

def main():
if sys.platform.lower().startswith("win"):
binary_name = "mseedindex.exe"
else:
binary_name = "mseedindex"

binary_path = Path(__file__).parent / binary_name
from mseedindex import get_path_to_binary

def main():
binary_path = get_path_to_binary()
result = subprocess.run([str(binary_path)] + sys.argv[1:])
sys.exit(result.returncode)
sys.exit(result.returncode)
2 changes: 1 addition & 1 deletion src/mseedindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
#include "md5.h"
#include "sha256.h"

#define VERSION "3.0.8"
#define VERSION "3.0.9"
#define PACKAGE "mseedindex"

static flag verbose = 0;
Expand Down