Skip to content

Commit 5723a25

Browse files
committed
Bump to 3.2 for multi-platform wheel support.
updates some build info on Readme. pull support code from c2pa-c main branch.
1 parent 6967794 commit 5723a25

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Cargo.lock
1919
# Python caches
2020
__pycache__/
2121
.pytest_cache/
22+
dist
2223

2324
# Mac OS X files
2425
.DS_Store

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "c2pa-python"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
edition = "2021"
55
authors = ["Gavin Peacock <[email protected]"]
66

@@ -10,8 +10,7 @@ name = "c2pa_python"
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13-
c2pa-c = { git = "https://github.com/contentauth/c2pa-c.git", branch = "gpeacock/rlib"}
14-
#c2pa = {version="0.26.0", features = ["file_io", "add_thumbnails", "fetch_remote_manifests"]}
13+
c2pa-c = { git = "https://github.com/contentauth/c2pa-c.git", branch = "main"}
1514
serde = { version = "1.0", features = ["derive"] }
1615
serde_derive = "1.0"
1716
serde_json = "1.0"

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,9 @@ Install from PyPI by entering this command:
1414
pip install -U c2pa-python
1515
```
1616

17-
To build from source on Linux, install curl and rustup and set up python
18-
19-
```
20-
apt update
21-
apt install curl
22-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
23-
source "$HOME/.cargo/env"
24-
25-
apt install python3
26-
apt install pip
27-
apt install python3.11-venv
17+
This is a platform wheel built with Rust. If your platform is not already supported,
18+
see the development section for info on how to build from source.
2819

29-
python3 -m venv .venv
30-
source .venv/bin/activate
31-
pip install uniffi-bindgen
32-
pip install -U c2pa-python
3320
```
3421
## Usage
3522
@@ -120,18 +107,36 @@ manifest_json = json.dumps({
120107

121108
It is best to [set up a virtual environment](https://virtualenv.pypa.io/en/latest/installation.html) for development and testing.
122109

123-
We use `maturin` for packaging Rust in Python. Install it as follows:
110+
To build from source on Linux, install curl and rustup and set up python
124111

112+
First update apt
125113
```
126-
pip install maturin
114+
apt update
127115
```
128116

129-
You also must install `uniffi`, `bindgen`, and `pytest` for testing
117+
Install Rust
118+
```apt install curl
119+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
120+
source "$HOME/.cargo/env"
121+
```
130122

123+
Install Python, pip and venv
131124
```
132-
pip install uniffi_bindgen
125+
apt install python3
126+
apt install pip
127+
apt install python3.11-venv
128+
python3 -m venv .venv
129+
```
130+
131+
Build the wheel for your platform
132+
```
133+
source .venv/bin/activate
134+
pip install maturin
135+
pip install uniffi-bindgen
136+
python3 -m pip install build
133137
pip install -U pytest
134-
pip install <path-to-whl> --force-reinstall
138+
139+
python3 -m build --wheel
135140
```
136141

137142
### Testing

tests/test_c2pa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def getitem(d, key):
2424
return reduce(operator.getitem, key, d)
2525

2626
def test_version():
27-
assert c2pa.version() == "0.3.0"
27+
assert c2pa.version() == "0.3.2"
2828

2929
def test_sdk_version():
3030
assert c2pa.sdk_version() == "0.28.3"

0 commit comments

Comments
 (0)