Skip to content

Commit d46ab70

Browse files
committed
fix: Pytest is touchy about venv
1 parent 883580a commit d46ab70

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ jobs:
6666
run: python3 scripts/download_artifacts.py c2pa-v0.55.0
6767

6868
- name: Install package in development mode
69-
run: pip install -e .
69+
run: |
70+
pip uninstall -y c2pa
71+
pip install -e .
72+
73+
- name: Verify installation
74+
run: |
75+
python3 -c "from c2pa import C2paError; print('C2paError imported successfully')"
7076
7177
- name: Install pytest
7278
run: python -m pip install pytest

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Start from clean env: Delete `.venv`, then `python3 -m venv .venv`
44
# Pre-requisite: Python virtual environment is active (source .venv/bin/activate)
5+
# Run Pytest tests in virtualenv: .venv/bin/pytest tests/test_unit_tests.py -v
56

67
clean:
78
rm -rf artifacts/ build/ dist/
@@ -10,12 +11,15 @@ clean-c2pa-env: clean
1011
python3 -m pip uninstall -y c2pa
1112
python3 -m pip cache purge
1213

13-
build-python:
14+
install-deps:
1415
python3 -m pip install -r requirements.txt
1516
python3 -m pip install -r requirements-dev.txt
1617
pip install -e .
1718

18-
rebuild: clean-c2pa-env download-native-artifacts build-python
19+
build-python:
20+
pip install -e .
21+
22+
rebuild: clean-c2pa-env install-deps download-native-artifacts build-python
1923
@echo "Development rebuild done!"
2024

2125
test:

src/c2pa/__init__.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
__version__ = "0.10.0"
22

3-
from .c2pa import * # NOQA
3+
from .c2pa import (
4+
Builder,
5+
C2paError,
6+
Reader,
7+
C2paSigningAlg,
8+
C2paSignerInfo,
9+
Signer,
10+
sdk_version
11+
) # NOQA
12+
13+
# Re-export C2paError and its subclasses
14+
__all__ = [
15+
'Builder',
16+
'C2paError',
17+
'Reader',
18+
'C2paSigningAlg',
19+
'C2paSignerInfo',
20+
'Signer',
21+
'sdk_version'
22+
]

0 commit comments

Comments
 (0)