ruststartracker 0.2.7__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: ruststartracker
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Lightweight Python Star Tracker With Rust Backend
5
5
  License: MIT
6
+ License-File: LICENSE
6
7
  Author: Nicolas Tobler
7
8
  Author-email: nitobler@gmail.com
8
9
  Requires-Python: >=3.10,<4.0
@@ -12,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.10
12
13
  Classifier: Programming Language :: Python :: 3.11
13
14
  Classifier: Programming Language :: Python :: 3.12
14
15
  Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
15
17
  Requires-Dist: numpy (>=1.26.0,<2.0.0)
16
18
  Requires-Dist: opencv-python-headless (>=4.9.0,<5.0.0)
17
19
  Project-URL: GaiaAttribution, https://www.cosmos.esa.int/gaia
@@ -3,8 +3,10 @@
3
3
  This script is automatically run when the pyproject is installed.
4
4
  """
5
5
 
6
+ import argparse
6
7
  import csv
7
8
  import io
9
+ import os
8
10
  import pathlib
9
11
  import shutil
10
12
  import subprocess
@@ -99,7 +101,7 @@ def download_hipparcos_data(output_file: pathlib.Path) -> None:
99
101
  print(f"Saved to: {output_file}")
100
102
 
101
103
 
102
- def build_script() -> None:
104
+ def build_script(*, static: bool = False) -> None:
103
105
  """Build rust backend and move shared library to correct folder."""
104
106
  cwd = pathlib.Path(__file__).parent.expanduser().absolute()
105
107
 
@@ -111,11 +113,19 @@ def build_script() -> None:
111
113
  if not hipparcos_file.exists():
112
114
  download_hipparcos_data(hipparcos_file)
113
115
 
116
+ env = dict(**os.environ)
117
+ if static:
118
+ env["OPENCV_LINK_STATIC"] = "1"
119
+ env["OPENCV_INCLUDE_PATHS"] = "/opt/opencv-static/include/opencv4"
120
+ env["OPENCV_LIBRARY_PATHS"] = "/opt/opencv-static/lib"
121
+ env["PKG_CONFIG_PATH"] = "/opt/opencv-static/lib/pkgconfig"
122
+
114
123
  subprocess.check_call( # noqa: S603
115
124
  ["cargo", "build", "--release", "--features", "improc,gaia,hipparcos"], # noqa: S607
116
125
  cwd=cwd,
117
126
  stdout=None,
118
127
  stderr=None,
128
+ env=env,
119
129
  )
120
130
  shutil.copy(
121
131
  cwd / "target/release/libruststartracker.so", cwd / "ruststartracker/libruststartracker.so"
@@ -123,4 +133,11 @@ def build_script() -> None:
123
133
 
124
134
 
125
135
  if __name__ == "__main__":
126
- build_script()
136
+ parser = argparse.ArgumentParser(description="Build the StarTracker project.")
137
+ parser.add_argument(
138
+ "--static", action="store_true", help="Link opencv statically.", default=False
139
+ )
140
+
141
+ args = parser.parse_args()
142
+
143
+ build_script(static=args.static or os.environ.get("RUST_STARTRACKER_OPENCV_LINK_STATIC") == "1")
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ruststartracker"
3
- version = "0.2.7"
3
+ version = "0.2.8"
4
4
  description = "Lightweight Python Star Tracker With Rust Backend"
5
5
  authors = ["Nicolas Tobler <nitobler@gmail.com>"]
6
6
  readme = "README.md"
@@ -44,7 +44,7 @@ requires = ["poetry-core", "astroquery>=0.4.10"]
44
44
  build-backend = "poetry.core.masonry.api"
45
45
 
46
46
  [tool.bumpversion]
47
- current_version = "0.2.7"
47
+ current_version = "0.2.8"
48
48
  commit = true
49
49
  tag = true
50
50
  tag_name = "v{new_version}"
File without changes