oxidize-pdf 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.
Files changed (35) hide show
  1. oxidize_pdf-0.1.0/.github/workflows/ci.yml +107 -0
  2. oxidize_pdf-0.1.0/.github/workflows/release.yml +118 -0
  3. oxidize_pdf-0.1.0/.gitignore +36 -0
  4. oxidize_pdf-0.1.0/Cargo.lock +1213 -0
  5. oxidize_pdf-0.1.0/Cargo.toml +17 -0
  6. oxidize_pdf-0.1.0/LICENSE +21 -0
  7. oxidize_pdf-0.1.0/PKG-INFO +233 -0
  8. oxidize_pdf-0.1.0/PUBLISHING.md +67 -0
  9. oxidize_pdf-0.1.0/README.md +202 -0
  10. oxidize_pdf-0.1.0/pyproject.toml +51 -0
  11. oxidize_pdf-0.1.0/python/oxidize_pdf/__init__.py +80 -0
  12. oxidize_pdf-0.1.0/python/oxidize_pdf/__init__.pyi +27 -0
  13. oxidize_pdf-0.1.0/python/oxidize_pdf/_oxidize_pdf.pyi +399 -0
  14. oxidize_pdf-0.1.0/python/oxidize_pdf/py.typed +0 -0
  15. oxidize_pdf-0.1.0/src/document.rs +106 -0
  16. oxidize_pdf-0.1.0/src/errors.rs +36 -0
  17. oxidize_pdf-0.1.0/src/graphics.rs +5 -0
  18. oxidize_pdf-0.1.0/src/lib.rs +30 -0
  19. oxidize_pdf-0.1.0/src/operations.rs +136 -0
  20. oxidize_pdf-0.1.0/src/page.rs +207 -0
  21. oxidize_pdf-0.1.0/src/parser.rs +214 -0
  22. oxidize_pdf-0.1.0/src/security.rs +130 -0
  23. oxidize_pdf-0.1.0/src/text.rs +144 -0
  24. oxidize_pdf-0.1.0/src/types.rs +338 -0
  25. oxidize_pdf-0.1.0/tests/conftest.py +19 -0
  26. oxidize_pdf-0.1.0/tests/test_document.py +161 -0
  27. oxidize_pdf-0.1.0/tests/test_errors.py +94 -0
  28. oxidize_pdf-0.1.0/tests/test_graphics.py +155 -0
  29. oxidize_pdf-0.1.0/tests/test_import.py +23 -0
  30. oxidize_pdf-0.1.0/tests/test_operations.py +285 -0
  31. oxidize_pdf-0.1.0/tests/test_parser.py +134 -0
  32. oxidize_pdf-0.1.0/tests/test_security.py +167 -0
  33. oxidize_pdf-0.1.0/tests/test_text.py +143 -0
  34. oxidize_pdf-0.1.0/tests/test_types.py +186 -0
  35. oxidize_pdf-0.1.0/tests/test_typing.py +221 -0
@@ -0,0 +1,107 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [develop, main]
6
+ pull_request:
7
+ branches: [develop, main]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ test:
14
+ name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ os: [ubuntu-latest, macos-latest, windows-latest]
20
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+
29
+ - uses: dtolnay/rust-toolchain@stable
30
+
31
+ - uses: Swatinem/rust-cache@v2
32
+ with:
33
+ key: ${{ matrix.os }}-py${{ matrix.python-version }}
34
+
35
+ - name: Create virtualenv
36
+ run: python -m venv .venv
37
+
38
+ - name: Install dependencies (Unix)
39
+ if: runner.os != 'Windows'
40
+ run: |
41
+ source .venv/bin/activate
42
+ pip install maturin pytest mypy
43
+
44
+ - name: Install dependencies (Windows)
45
+ if: runner.os == 'Windows'
46
+ run: |
47
+ .venv\Scripts\activate
48
+ pip install maturin pytest mypy
49
+
50
+ - name: Build (debug, Unix)
51
+ if: runner.os != 'Windows'
52
+ run: |
53
+ source .venv/bin/activate
54
+ maturin develop
55
+
56
+ - name: Build (debug, Windows)
57
+ if: runner.os == 'Windows'
58
+ run: |
59
+ .venv\Scripts\activate
60
+ maturin develop
61
+
62
+ - name: Run tests (Unix)
63
+ if: runner.os != 'Windows'
64
+ run: |
65
+ source .venv/bin/activate
66
+ pytest tests/ -v
67
+
68
+ - name: Run tests (Windows)
69
+ if: runner.os == 'Windows'
70
+ run: |
71
+ .venv\Scripts\activate
72
+ pytest tests/ -v
73
+
74
+ - name: Type check
75
+ if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
76
+ run: |
77
+ source .venv/bin/activate
78
+ mypy python/oxidize_pdf/
79
+
80
+ build-check:
81
+ name: Release build check
82
+ needs: test
83
+ runs-on: ubuntu-latest
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+
87
+ - uses: actions/setup-python@v5
88
+ with:
89
+ python-version: "3.13"
90
+
91
+ - uses: dtolnay/rust-toolchain@stable
92
+
93
+ - uses: Swatinem/rust-cache@v2
94
+
95
+ - name: Create virtualenv and install maturin
96
+ run: |
97
+ python -m venv .venv
98
+ source .venv/bin/activate
99
+ pip install maturin
100
+
101
+ - name: Build release wheel
102
+ run: |
103
+ source .venv/bin/activate
104
+ maturin build --release
105
+
106
+ - name: Verify wheel exists
107
+ run: ls -la target/wheels/*.whl
@@ -0,0 +1,118 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+ attestations: write
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+
16
+ jobs:
17
+ build-wheels:
18
+ name: Build wheels (${{ matrix.target }} on ${{ matrix.os }})
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ include:
24
+ # Linux x86_64
25
+ - os: ubuntu-latest
26
+ target: x86_64
27
+ manylinux: manylinux_2_28
28
+ # Linux aarch64 (cross-compiled)
29
+ - os: ubuntu-latest
30
+ target: aarch64
31
+ manylinux: manylinux_2_28
32
+ # macOS arm64 (native on macos-14)
33
+ - os: macos-14
34
+ target: aarch64-apple-darwin
35
+ manylinux: "off"
36
+ # macOS x86_64 (cross-compiled from arm64)
37
+ - os: macos-14
38
+ target: x86_64-apple-darwin
39
+ manylinux: "off"
40
+ # Windows x86_64
41
+ - os: windows-latest
42
+ target: x86_64
43
+ manylinux: "off"
44
+
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: "3.x"
51
+
52
+ - uses: dtolnay/rust-toolchain@stable
53
+
54
+ - uses: Swatinem/rust-cache@v2
55
+ with:
56
+ key: release-${{ matrix.os }}-${{ matrix.target }}
57
+
58
+ - name: Build wheels
59
+ uses: PyO3/maturin-action@v1
60
+ with:
61
+ command: build
62
+ args: --release --out dist --find-interpreter
63
+ target: ${{ matrix.target }}
64
+ manylinux: ${{ matrix.manylinux }}
65
+
66
+ - name: Upload wheels
67
+ uses: actions/upload-artifact@v4
68
+ with:
69
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
70
+ path: dist/*.whl
71
+ if-no-files-found: error
72
+
73
+ build-sdist:
74
+ name: Build source distribution
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - uses: actions/checkout@v4
78
+
79
+ - name: Build sdist
80
+ uses: PyO3/maturin-action@v1
81
+ with:
82
+ command: sdist
83
+ args: --out dist
84
+
85
+ - name: Upload sdist
86
+ uses: actions/upload-artifact@v4
87
+ with:
88
+ name: sdist
89
+ path: dist/*.tar.gz
90
+ if-no-files-found: error
91
+
92
+ publish:
93
+ name: Publish to PyPI
94
+ needs: [build-wheels, build-sdist]
95
+ runs-on: ubuntu-latest
96
+ environment:
97
+ name: pypi
98
+ url: https://pypi.org/project/oxidize-pdf/
99
+
100
+ steps:
101
+ - name: Download wheels
102
+ uses: actions/download-artifact@v4
103
+ with:
104
+ pattern: wheels-*
105
+ path: dist
106
+ merge-multiple: true
107
+
108
+ - name: Download sdist
109
+ uses: actions/download-artifact@v4
110
+ with:
111
+ name: sdist
112
+ path: dist
113
+
114
+ - name: List distribution files
115
+ run: ls -la dist/
116
+
117
+ - name: Publish to PyPI
118
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,36 @@
1
+ # Rust
2
+ /target/
3
+ Cargo.lock
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.pyc
8
+ *.pyo
9
+ *.egg-info/
10
+ dist/
11
+ build/
12
+ *.so
13
+ *.dylib
14
+ *.dll
15
+
16
+ # Virtual environments
17
+ .venv/
18
+ venv/
19
+
20
+ # IDE
21
+ .idea/
22
+ .vscode/
23
+ *.swp
24
+ *.swo
25
+
26
+ # maturin
27
+ *.whl
28
+
29
+ # Debug symbols
30
+ *.dSYM/
31
+
32
+ # Test artifacts
33
+ .pytest_cache/
34
+ .mypy_cache/
35
+ htmlcov/
36
+ .coverage