pdf-inspector 0.1.0__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.
- pdf_inspector-0.1.0/.github/workflows/ci.yml +134 -0
- pdf_inspector-0.1.0/.github/workflows/publish.yml +106 -0
- pdf_inspector-0.1.0/.gitignore +33 -0
- pdf_inspector-0.1.0/Cargo.lock +1414 -0
- pdf_inspector-0.1.0/Cargo.toml +59 -0
- pdf_inspector-0.1.0/PKG-INFO +12 -0
- pdf_inspector-0.1.0/README.md +365 -0
- pdf_inspector-0.1.0/examples/basic_usage.py +76 -0
- pdf_inspector-0.1.0/external/bcmaps/78-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78ms-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/78ms-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/83pv-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90ms-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90ms-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90msp-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90msp-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90pv-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/90pv-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Add-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Add-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Add-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Add-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-0.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-1.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-3.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-4.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-5.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-6.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-0.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-1.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-3.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-4.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-5.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-GB1-UCS2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-0.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-1.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-3.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-4.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-5.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-6.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Korea1-0.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Korea1-1.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Korea1-2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/B5pc-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/B5pc-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS1-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS1-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS2-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/CNS2-V.bcmap +3 -0
- pdf_inspector-0.1.0/external/bcmaps/ETHK-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/ETHK-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/ETen-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/ETen-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/ETenms-B5-H.bcmap +3 -0
- pdf_inspector-0.1.0/external/bcmaps/ETenms-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Ext-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Ext-RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Ext-RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Ext-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GB-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GB-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GB-H.bcmap +4 -0
- pdf_inspector-0.1.0/external/bcmaps/GB-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBK-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBK-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBK2K-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBK2K-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBKp-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBKp-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBT-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBT-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBT-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBT-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBTpc-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBTpc-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBpc-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/GBpc-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKdla-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKdla-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKdlb-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKdlb-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKgccs-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKgccs-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKm314-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKm314-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKm471-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKm471-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKscs-B5-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/HKscs-B5-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Hankaku.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Hiragana.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-Johab-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-Johab-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCms-UHC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCms-UHC-HW-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCms-UHC-HW-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCms-UHC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCpc-EUC-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/KSCpc-EUC-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Katakana.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/LICENSE +36 -0
- pdf_inspector-0.1.0/external/bcmaps/NWP-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/NWP-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/RKSJ-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/RKSJ-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/Roman.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UCS2-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UCS2-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF16-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF16-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF8-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniCNS-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UCS2-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UCS2-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF16-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF16-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF8-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniGB-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UCS2-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UCS2-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF16-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF16-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF8-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISPro-UCS2-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISPro-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UCS2-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UCS2-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF16-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF16-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF32-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF32-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF8-H.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/UniKS-UTF8-V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/V.bcmap +0 -0
- pdf_inspector-0.1.0/external/bcmaps/WP-Symbol.bcmap +0 -0
- pdf_inspector-0.1.0/pdf_inspector.pyi +56 -0
- pdf_inspector-0.1.0/pyproject.toml +21 -0
- pdf_inspector-0.1.0/src/adobe_korea1.rs +17073 -0
- pdf_inspector-0.1.0/src/bin/detect_pdf.rs +247 -0
- pdf_inspector-0.1.0/src/bin/dump_ops.rs +43 -0
- pdf_inspector-0.1.0/src/bin/pdf2md.rs +340 -0
- pdf_inspector-0.1.0/src/detector.rs +1077 -0
- pdf_inspector-0.1.0/src/extractor/content_stream.rs +952 -0
- pdf_inspector-0.1.0/src/extractor/fonts.rs +1076 -0
- pdf_inspector-0.1.0/src/extractor/layout.rs +819 -0
- pdf_inspector-0.1.0/src/extractor/links.rs +320 -0
- pdf_inspector-0.1.0/src/extractor/mod.rs +915 -0
- pdf_inspector-0.1.0/src/extractor/xobjects.rs +617 -0
- pdf_inspector-0.1.0/src/glyph_names.rs +4590 -0
- pdf_inspector-0.1.0/src/lib.rs +729 -0
- pdf_inspector-0.1.0/src/markdown/analysis.rs +280 -0
- pdf_inspector-0.1.0/src/markdown/classify.rs +180 -0
- pdf_inspector-0.1.0/src/markdown/convert.rs +682 -0
- pdf_inspector-0.1.0/src/markdown/mod.rs +960 -0
- pdf_inspector-0.1.0/src/markdown/postprocess.rs +463 -0
- pdf_inspector-0.1.0/src/markdown/preprocess.rs +442 -0
- pdf_inspector-0.1.0/src/process_mode.rs +11 -0
- pdf_inspector-0.1.0/src/python.rs +269 -0
- pdf_inspector-0.1.0/src/tables/detect_heuristic.rs +1074 -0
- pdf_inspector-0.1.0/src/tables/detect_lines.rs +391 -0
- pdf_inspector-0.1.0/src/tables/detect_rects.rs +2296 -0
- pdf_inspector-0.1.0/src/tables/financial.rs +115 -0
- pdf_inspector-0.1.0/src/tables/format.rs +415 -0
- pdf_inspector-0.1.0/src/tables/grid.rs +774 -0
- pdf_inspector-0.1.0/src/tables/mod.rs +907 -0
- pdf_inspector-0.1.0/src/text_utils.rs +428 -0
- pdf_inspector-0.1.0/src/tounicode.rs +2515 -0
- pdf_inspector-0.1.0/src/types.rs +264 -0
- pdf_inspector-0.1.0/tests/fixtures/2013-app2.pdf +0 -0
- pdf_inspector-0.1.0/tests/fixtures/nexo-price-en.pdf +0 -0
- pdf_inspector-0.1.0/tests/fixtures/p1244-1996.pdf +0 -0
- pdf_inspector-0.1.0/tests/fixtures/real-estate-pricing.pdf +0 -0
- pdf_inspector-0.1.0/tests/fixtures/td9264.pdf +0 -0
- pdf_inspector-0.1.0/tests/fixtures/thermo-freon12.pdf +0 -0
- pdf_inspector-0.1.0/tests/integration_tests.rs +996 -0
- pdf_inspector-0.1.0/tests/snapshots/2013-app2.md +298 -0
- pdf_inspector-0.1.0/tests/snapshots/nexo-price-en.md +10 -0
- pdf_inspector-0.1.0/tests/snapshots/p1244-1996.md +75 -0
- pdf_inspector-0.1.0/tests/snapshots/real-estate-pricing.md +57 -0
- pdf_inspector-0.1.0/tests/snapshots/td9264.md +235 -0
- pdf_inspector-0.1.0/tests/snapshots/thermo-freon12.md +110 -0
- pdf_inspector-0.1.0/tests/test_python.py +188 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Test
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install Rust
|
|
20
|
+
uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
|
|
22
|
+
- name: Cache cargo
|
|
23
|
+
uses: actions/cache@v4
|
|
24
|
+
with:
|
|
25
|
+
path: |
|
|
26
|
+
~/.cargo/bin/
|
|
27
|
+
~/.cargo/registry/index/
|
|
28
|
+
~/.cargo/registry/cache/
|
|
29
|
+
~/.cargo/git/db/
|
|
30
|
+
target/
|
|
31
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
32
|
+
restore-keys: |
|
|
33
|
+
${{ runner.os }}-cargo-
|
|
34
|
+
|
|
35
|
+
- name: Run tests
|
|
36
|
+
run: cargo test --verbose
|
|
37
|
+
|
|
38
|
+
fmt:
|
|
39
|
+
name: Format
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Install Rust
|
|
45
|
+
uses: dtolnay/rust-toolchain@stable
|
|
46
|
+
with:
|
|
47
|
+
components: rustfmt
|
|
48
|
+
|
|
49
|
+
- name: Check formatting
|
|
50
|
+
run: cargo fmt --all -- --check
|
|
51
|
+
|
|
52
|
+
clippy:
|
|
53
|
+
name: Clippy
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
|
|
58
|
+
- name: Install Rust
|
|
59
|
+
uses: dtolnay/rust-toolchain@stable
|
|
60
|
+
with:
|
|
61
|
+
components: clippy
|
|
62
|
+
|
|
63
|
+
- name: Cache cargo
|
|
64
|
+
uses: actions/cache@v4
|
|
65
|
+
with:
|
|
66
|
+
path: |
|
|
67
|
+
~/.cargo/bin/
|
|
68
|
+
~/.cargo/registry/index/
|
|
69
|
+
~/.cargo/registry/cache/
|
|
70
|
+
~/.cargo/git/db/
|
|
71
|
+
target/
|
|
72
|
+
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
|
|
73
|
+
restore-keys: |
|
|
74
|
+
${{ runner.os }}-cargo-clippy-
|
|
75
|
+
|
|
76
|
+
- name: Run clippy
|
|
77
|
+
run: cargo clippy -- -D warnings
|
|
78
|
+
|
|
79
|
+
build:
|
|
80
|
+
name: Build
|
|
81
|
+
runs-on: ${{ matrix.os }}
|
|
82
|
+
strategy:
|
|
83
|
+
matrix:
|
|
84
|
+
os: [ubuntu-latest, macos-latest]
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
|
|
88
|
+
- name: Install Rust
|
|
89
|
+
uses: dtolnay/rust-toolchain@stable
|
|
90
|
+
|
|
91
|
+
- name: Cache cargo
|
|
92
|
+
uses: actions/cache@v4
|
|
93
|
+
with:
|
|
94
|
+
path: |
|
|
95
|
+
~/.cargo/bin/
|
|
96
|
+
~/.cargo/registry/index/
|
|
97
|
+
~/.cargo/registry/cache/
|
|
98
|
+
~/.cargo/git/db/
|
|
99
|
+
target/
|
|
100
|
+
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
|
101
|
+
restore-keys: |
|
|
102
|
+
${{ runner.os }}-cargo-build-
|
|
103
|
+
|
|
104
|
+
- name: Build
|
|
105
|
+
run: cargo build --release --verbose
|
|
106
|
+
|
|
107
|
+
python-tests:
|
|
108
|
+
name: Python Tests
|
|
109
|
+
runs-on: ubuntu-latest
|
|
110
|
+
steps:
|
|
111
|
+
- uses: actions/checkout@v4
|
|
112
|
+
|
|
113
|
+
- name: Install Rust
|
|
114
|
+
uses: dtolnay/rust-toolchain@stable
|
|
115
|
+
|
|
116
|
+
- uses: actions/setup-python@v5
|
|
117
|
+
with:
|
|
118
|
+
python-version: "3.12"
|
|
119
|
+
|
|
120
|
+
- name: Create venv and install dependencies
|
|
121
|
+
run: |
|
|
122
|
+
python -m venv .venv
|
|
123
|
+
source .venv/bin/activate
|
|
124
|
+
pip install maturin pytest
|
|
125
|
+
|
|
126
|
+
- name: Build and install Python package
|
|
127
|
+
run: |
|
|
128
|
+
source .venv/bin/activate
|
|
129
|
+
maturin develop --release
|
|
130
|
+
|
|
131
|
+
- name: Run Python tests
|
|
132
|
+
run: |
|
|
133
|
+
source .venv/bin/activate
|
|
134
|
+
pytest tests/test_python.py -v
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
# Build wheels for Linux
|
|
12
|
+
linux:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
target: [x86_64, aarch64]
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
- uses: PyO3/maturin-action@v1
|
|
23
|
+
with:
|
|
24
|
+
target: ${{ matrix.target }}
|
|
25
|
+
args: --release --out dist --features python -i python3.12
|
|
26
|
+
manylinux: auto
|
|
27
|
+
- uses: actions/upload-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
name: wheels-linux-${{ matrix.target }}
|
|
30
|
+
path: dist
|
|
31
|
+
|
|
32
|
+
# Build wheels for macOS
|
|
33
|
+
macos:
|
|
34
|
+
runs-on: ${{ matrix.runner }}
|
|
35
|
+
strategy:
|
|
36
|
+
matrix:
|
|
37
|
+
include:
|
|
38
|
+
- runner: macos-14
|
|
39
|
+
target: x86_64
|
|
40
|
+
- runner: macos-14
|
|
41
|
+
target: aarch64
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
- uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.12"
|
|
47
|
+
- uses: PyO3/maturin-action@v1
|
|
48
|
+
with:
|
|
49
|
+
target: ${{ matrix.target }}-apple-darwin
|
|
50
|
+
args: --release --out dist --features python
|
|
51
|
+
- uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: wheels-macos-${{ matrix.target }}
|
|
54
|
+
path: dist
|
|
55
|
+
|
|
56
|
+
# Build wheels for Windows
|
|
57
|
+
windows:
|
|
58
|
+
runs-on: windows-latest
|
|
59
|
+
strategy:
|
|
60
|
+
matrix:
|
|
61
|
+
target: [x64]
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
- uses: actions/setup-python@v5
|
|
65
|
+
with:
|
|
66
|
+
python-version: "3.12"
|
|
67
|
+
architecture: ${{ matrix.target }}
|
|
68
|
+
- uses: PyO3/maturin-action@v1
|
|
69
|
+
with:
|
|
70
|
+
args: --release --out dist --features python
|
|
71
|
+
- uses: actions/upload-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
name: wheels-windows-${{ matrix.target }}
|
|
74
|
+
path: dist
|
|
75
|
+
|
|
76
|
+
# Build source distribution
|
|
77
|
+
sdist:
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/checkout@v4
|
|
81
|
+
- uses: PyO3/maturin-action@v1
|
|
82
|
+
with:
|
|
83
|
+
command: sdist
|
|
84
|
+
args: --out dist
|
|
85
|
+
- uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: wheels-sdist
|
|
88
|
+
path: dist
|
|
89
|
+
|
|
90
|
+
# Publish everything to PyPI
|
|
91
|
+
publish:
|
|
92
|
+
name: Publish to PyPI
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
needs: [linux, macos, windows, sdist]
|
|
95
|
+
environment:
|
|
96
|
+
name: pypi
|
|
97
|
+
url: https://pypi.org/project/pdf-inspector/
|
|
98
|
+
permissions:
|
|
99
|
+
id-token: write
|
|
100
|
+
steps:
|
|
101
|
+
- uses: actions/download-artifact@v4
|
|
102
|
+
with:
|
|
103
|
+
pattern: wheels-*
|
|
104
|
+
merge-multiple: true
|
|
105
|
+
path: dist
|
|
106
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Rust build artifacts
|
|
2
|
+
/target/
|
|
3
|
+
debug/
|
|
4
|
+
*.pdb
|
|
5
|
+
|
|
6
|
+
# Cargo lock (optional for libraries)
|
|
7
|
+
Cargo.lock
|
|
8
|
+
|
|
9
|
+
# IDE
|
|
10
|
+
.idea/
|
|
11
|
+
.vscode/
|
|
12
|
+
*.swp
|
|
13
|
+
*.swo
|
|
14
|
+
*~
|
|
15
|
+
|
|
16
|
+
# OS
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
|
19
|
+
|
|
20
|
+
# Test files
|
|
21
|
+
*.pdf
|
|
22
|
+
!tests/fixtures/*.pdf
|
|
23
|
+
|
|
24
|
+
# Build cache
|
|
25
|
+
**/*.rs.bk
|
|
26
|
+
|
|
27
|
+
# Local samples and scripts
|
|
28
|
+
samples/
|
|
29
|
+
scripts/
|
|
30
|
+
|
|
31
|
+
# Test output
|
|
32
|
+
test_output/
|
|
33
|
+
|