Skip to content

Commit 9b9d35f

Browse files
authored
fix: Some renaming going on (#106)
1 parent 434efcd commit 9b9d35f

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include src/c2pa/libs/*.dylib
22
include src/c2pa/libs/*.dll
3-
include src/c2pa/libs/*.so
3+
include src/c2pa/libs/*.so

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
build-python:
77
python3 -m pip uninstall -y maturin
88
python3 -m pip install -r requirements.txt
9+
python3 -m pip install -r requirements-dev.txt
910
pip install -e .
1011

1112
test:
1213
python3 ./tests/test_unit_tests.py
13-
python3 ./tests/test_api.py
1414

1515
publish: release
1616
python3 -m pip install twine

requirements-dev.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Build dependencies
2+
wheel==0.41.2 # For building wheels
3+
setuptools==68.0.0 # For building packages
4+
5+
# Testing dependencies
6+
pytest==7.4.0
7+
8+
# for downloading the library artifacts
9+
requests>=2.0.0

requirements.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,2 @@
1-
2-
wheel==0.41.2 # For building wheels
3-
setuptools==68.0.0 # For building packages
4-
# Testing dependencies
5-
pytest==7.4.0
6-
# only used in the training example
7-
cryptography>=41.0.0
8-
# for downloading the library artifacts
9-
requests>=2.0.0
1+
# only used in the training example
2+
cryptography>=41.0.0

src/c2pa/build.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,48 @@ def get_latest_release() -> dict:
2323
def download_artifact(url: str, platform_name: str) -> None:
2424
"""Download and extract an artifact to the appropriate platform directory."""
2525
print(f"Downloading artifact for {platform_name}...")
26-
26+
2727
# Create platform directory
2828
platform_dir = ARTIFACTS_DIR / platform_name
2929
platform_dir.mkdir(parents=True, exist_ok=True)
30-
30+
3131
# Download the zip file
3232
response = requests.get(url)
3333
response.raise_for_status()
34-
34+
3535
# Extract the zip file
3636
with zipfile.ZipFile(io.BytesIO(response.content)) as zip_ref:
3737
# Extract all files to the platform directory
3838
zip_ref.extractall(platform_dir)
39-
39+
4040
print(f"Successfully downloaded and extracted artifacts for {platform_name}")
4141

4242
def download_artifacts() -> None:
4343
"""Main function to download artifacts. Can be called as a script or from hatch."""
4444
try:
4545
# Create artifacts directory if it doesn't exist
4646
ARTIFACTS_DIR.mkdir(exist_ok=True)
47-
47+
4848
# Get latest release
4949
print("Fetching latest release information...")
5050
release = get_latest_release()
5151
print(f"Found release: {release['tag_name']}")
52-
52+
5353
# Download each asset
5454
for asset in release['assets']:
5555
# Skip non-zip files
5656
if not asset['name'].endswith('.zip'):
5757
continue
58-
58+
5959
# Determine platform from asset name
6060
# Example: c2pa-rs-v1.0.0-macosx-arm64.zip
6161
platform_name = asset['name'].split('-')[-1].replace('.zip', '')
62-
62+
6363
# Download and extract the artifact
6464
download_artifact(asset['browser_download_url'], platform_name)
65-
65+
6666
print("\nAll artifacts have been downloaded successfully!")
67-
67+
6868
except requests.exceptions.RequestException as e:
6969
print(f"Error downloading artifacts: {e}", file=sys.stderr)
7070
sys.exit(1)
@@ -77,4 +77,4 @@ def initialize_build() -> None:
7777
download_artifacts()
7878

7979
if __name__ == "__main__":
80-
download_artifacts()
80+
download_artifacts()

src/c2pa/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def dynamically_load_library(lib_name: Optional[str] = None) -> Optional[ctypes.
8383
# Package directory
8484
Path(__file__).parent,
8585
# Additional library directory
86-
Path(__file__).parent / "lib",
86+
Path(__file__).parent / "libs",
8787
# System library paths
8888
*[Path(p) for p in os.environ.get("LD_LIBRARY_PATH", "").split(os.pathsep) if p],
8989
]
@@ -95,7 +95,7 @@ def dynamically_load_library(lib_name: Optional[str] = None) -> Optional[ctypes.
9595
raise RuntimeError(f"Could not find {lib_name} in any of the search paths")
9696
return lib
9797

98-
# Default paht (no library name provided in the environment)
98+
# Default path (no library name provided in the environment)
9999
c2pa_lib = _load_single_library(c2pa_lib_name, possible_paths)
100100
if not c2pa_lib:
101101
raise RuntimeError(f"Could not find {c2pa_lib_name} in any of the search paths")

0 commit comments

Comments
 (0)