Skip to content

Commit 264dfbc

Browse files
committed
Revamp
1 parent e2a7afc commit 264dfbc

30 files changed

Lines changed: 1757 additions & 2825 deletions

.github/workflows/build-binary.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/build-wheels.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
target: ${{ matrix.target }}
3535
manylinux: 2014
36-
args: --release --out dist --interpreter 3.8 3.9 3.10 3.11 3.12 3.13
36+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
3737

3838
- name: Upload wheels
3939
uses: actions/upload-artifact@v4
@@ -55,7 +55,7 @@ jobs:
5555
uses: PyO3/maturin-action@v1
5656
with:
5757
target: ${{ matrix.target }}
58-
args: --release --out dist --interpreter 3.8 3.9 3.10 3.11 3.12 3.13
58+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
5959

6060
- name: Upload wheels
6161
uses: actions/upload-artifact@v4
@@ -77,7 +77,7 @@ jobs:
7777
uses: PyO3/maturin-action@v1
7878
with:
7979
target: ${{ matrix.target }}
80-
args: --release --out dist --interpreter 3.8 3.9 3.10 3.11 3.12 3.13
80+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
8181

8282
- name: Upload wheels
8383
uses: actions/upload-artifact@v4
@@ -113,13 +113,14 @@ jobs:
113113
fail-fast: false
114114
matrix:
115115
os: [ubuntu-latest, macos-latest, windows-latest]
116-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
116+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
117117
steps:
118118
- uses: actions/checkout@v4
119119

120120
- uses: actions/setup-python@v5
121121
with:
122122
python-version: ${{ matrix.python-version }}
123+
allow-prereleases: true
123124

124125
- name: Download wheels
125126
uses: actions/download-artifact@v4
@@ -137,17 +138,26 @@ jobs:
137138
shell: bash
138139
run: |
139140
python -c "
140-
from ofd_validator import PyValidationOrchestrator
141-
print('✓ Import successful')
142-
143-
# Test instantiation (will fail gracefully if dirs don't exist)
144-
try:
145-
orch = PyValidationOrchestrator('.', '.')
146-
print('✓ PyValidationOrchestrator created')
147-
except Exception as e:
148-
print(f'✓ Orchestrator creation handled: {e}')
149-
150-
print('✓ All tests passed')
141+
import ofd_validator
142+
print('Available:', [x for x in dir(ofd_validator) if not x.startswith('_')])
143+
144+
# Test types
145+
r = ofd_validator.ValidationResult()
146+
assert r.is_valid == True
147+
assert r.error_count == 0
148+
print('Types work correctly')
149+
150+
# Test functions exist
151+
assert callable(ofd_validator.validate_all)
152+
assert callable(ofd_validator.validate_json_files)
153+
assert callable(ofd_validator.validate_logo_files)
154+
assert callable(ofd_validator.validate_folder_names)
155+
assert callable(ofd_validator.validate_store_ids)
156+
assert callable(ofd_validator.validate_gtin_ean)
157+
assert callable(ofd_validator.validate_required_files)
158+
print('All functions available')
159+
160+
print('All tests passed')
151161
"
152162
153163
publish:
@@ -156,7 +166,7 @@ jobs:
156166
runs-on: ubuntu-latest
157167
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish-to-pypi == 'true')
158168
permissions:
159-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
169+
id-token: write
160170
steps:
161171
- name: Download all artifacts
162172
uses: actions/download-artifact@v4

.github/workflows/test-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: PyO3/maturin-action@v1
1515
with:
1616
command: build
17-
args: --release --out dist --interpreter 3.8 3.9 3.10 3.11 3.12 3.13
17+
args: --release --out dist --interpreter 3.10 3.11 3.12 3.13 3.14
1818

1919
- name: Build sdist
2020
uses: PyO3/maturin-action@v1

.github/workflows/test-python-bindings.yml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,57 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
os: [ubuntu-latest, macos-latest, windows-latest]
25-
python-version: ['3.8', '3.13'] # Test oldest and newest
25+
python-version: ['3.10', '3.14']
2626
steps:
2727
- uses: actions/checkout@v4
2828

2929
- uses: actions/setup-python@v5
3030
with:
3131
python-version: ${{ matrix.python-version }}
32+
allow-prereleases: true
3233

3334
- name: Install Rust toolchain
3435
uses: actions-rust-lang/setup-rust-toolchain@v1
3536

36-
- name: Install maturin
37-
run: pip install maturin
38-
39-
- name: Build Python package
40-
run: maturin develop --release --features python
41-
42-
- name: Test import
37+
- name: Install maturin and build
38+
shell: bash
4339
run: |
44-
python -c "from ofd_validator import PyValidationOrchestrator; print('✓ Import successful')"
40+
pip install maturin
41+
maturin develop --release
4542
46-
- name: Test basic functionality
43+
- name: Test import and functionality
44+
shell: bash
4745
run: |
4846
python -c "
49-
from ofd_validator import PyValidationOrchestrator
50-
import json
51-
52-
# Create orchestrator
53-
orch = PyValidationOrchestrator('.', '.')
54-
print('✓ Orchestrator created')
55-
56-
# Test methods exist
57-
assert hasattr(orch, 'validate_all')
58-
assert hasattr(orch, 'validate_json_files')
59-
assert hasattr(orch, 'validate_logo_files')
60-
print('✓ All methods exist')
47+
import ofd_validator
48+
49+
# Test types
50+
r = ofd_validator.ValidationResult()
51+
assert r.is_valid == True
52+
assert r.error_count == 0
53+
assert r.warning_count == 0
54+
55+
# Test error creation
56+
e = ofd_validator.ValidationError(ofd_validator.ValidationLevel.Error, 'Test', 'test msg', '/path')
57+
r.add_error(e)
58+
assert r.error_count == 1
59+
assert r.is_valid == False
60+
61+
# Test to_dict
62+
d = r.to_dict()
63+
assert d['error_count'] == 1
64+
assert d['is_valid'] == False
65+
66+
# Test all functions exist
67+
assert callable(ofd_validator.validate_all)
68+
assert callable(ofd_validator.validate_json_files)
69+
assert callable(ofd_validator.validate_logo_files)
70+
assert callable(ofd_validator.validate_folder_names)
71+
assert callable(ofd_validator.validate_store_ids)
72+
assert callable(ofd_validator.validate_gtin_ean)
73+
assert callable(ofd_validator.validate_required_files)
74+
assert callable(ofd_validator.validate_logo_file)
75+
assert callable(ofd_validator.validate_folder_name)
76+
77+
print('All tests passed')
6178
"

0 commit comments

Comments
 (0)