serpentype 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 (95) hide show
  1. serpentype-0.1.0/.github/workflows/wheels.yml +39 -0
  2. serpentype-0.1.0/.gitignore +5 -0
  3. serpentype-0.1.0/Cargo.lock +1017 -0
  4. serpentype-0.1.0/Cargo.toml +24 -0
  5. serpentype-0.1.0/LICENSE +21 -0
  6. serpentype-0.1.0/PKG-INFO +9 -0
  7. serpentype-0.1.0/README.md +43 -0
  8. serpentype-0.1.0/benchmark-results.jsonl +2 -0
  9. serpentype-0.1.0/benchmarks/page_definition_stress.py +496 -0
  10. serpentype-0.1.0/benchmarks/verify_page_definition_stress.py +165 -0
  11. serpentype-0.1.0/benchmarks.py +97 -0
  12. serpentype-0.1.0/docs/architecture.md +18 -0
  13. serpentype-0.1.0/docs/benchmark.md +33 -0
  14. serpentype-0.1.0/docs/capabilities.md +28 -0
  15. serpentype-0.1.0/docs/dependencies.md +7 -0
  16. serpentype-0.1.0/docs/weasyprint_compat.md +34 -0
  17. serpentype-0.1.0/examples/invoice.py +19 -0
  18. serpentype-0.1.0/output/benchmark/page_definition_stress/assets/chart.jpg +0 -0
  19. serpentype-0.1.0/output/benchmark/page_definition_stress/assets/qr.png +0 -0
  20. serpentype-0.1.0/output/benchmark/page_definition_stress/comparison.md +54 -0
  21. serpentype-0.1.0/output/benchmark/page_definition_stress/fixture_manifest.json +56 -0
  22. serpentype-0.1.0/output/benchmark/page_definition_stress/load.csv +7 -0
  23. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/compat_qr_placeholder.png +0 -0
  24. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/margin_boxes_six_demo_page1.png +0 -0
  25. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/margin_boxes_six_demo_page2.png +0 -0
  26. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-01.png +0 -0
  27. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-02.png +0 -0
  28. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-03.png +0 -0
  29. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-04.png +0 -0
  30. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-05.png +0 -0
  31. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-06.png +0 -0
  32. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-07.png +0 -0
  33. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-08.png +0 -0
  34. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-09.png +0 -0
  35. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-10.png +0 -0
  36. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-11.png +0 -0
  37. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-12.png +0 -0
  38. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-13.png +0 -0
  39. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-14.png +0 -0
  40. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-15.png +0 -0
  41. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-16.png +0 -0
  42. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-17.png +0 -0
  43. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype-18.png +0 -0
  44. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_contact.png +0 -0
  45. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_first_detail.png +0 -0
  46. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_landscape_detail.png +0 -0
  47. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_landscape_kk_detail.png +0 -0
  48. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_last_detail.png +0 -0
  49. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/serpentype_section5_detail.png +0 -0
  50. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-01.png +0 -0
  51. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-02.png +0 -0
  52. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-03.png +0 -0
  53. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-04.png +0 -0
  54. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-05.png +0 -0
  55. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-06.png +0 -0
  56. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-07.png +0 -0
  57. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-08.png +0 -0
  58. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-09.png +0 -0
  59. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-10.png +0 -0
  60. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-11.png +0 -0
  61. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-12.png +0 -0
  62. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-13.png +0 -0
  63. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-14.png +0 -0
  64. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-15.png +0 -0
  65. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint-16.png +0 -0
  66. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint_contact.png +0 -0
  67. serpentype-0.1.0/output/benchmark/page_definition_stress/qa/weasyprint_landscape_detail.png +0 -0
  68. serpentype-0.1.0/output/benchmark/page_definition_stress/rendered_page_definition.css +213 -0
  69. serpentype-0.1.0/output/benchmark/page_definition_stress/results.json +340 -0
  70. serpentype-0.1.0/output/benchmark/page_definition_stress/runs.csv +13 -0
  71. serpentype-0.1.0/output/benchmark/page_definition_stress/serpentype_stderr.log +0 -0
  72. serpentype-0.1.0/output/benchmark/page_definition_stress/stress_template.html +1 -0
  73. serpentype-0.1.0/output/benchmark/page_definition_stress/validation.json +258 -0
  74. serpentype-0.1.0/output/benchmark/page_definition_stress/weasyprint_stderr.log +0 -0
  75. serpentype-0.1.0/pyproject.toml +19 -0
  76. serpentype-0.1.0/serpentype/__init__.py +13 -0
  77. serpentype-0.1.0/serpentype/assets/NotoSans-Bold.ttf +0 -0
  78. serpentype-0.1.0/serpentype/assets/NotoSans-Regular.ttf +0 -0
  79. serpentype-0.1.0/serpentype/assets/OFL.txt +94 -0
  80. serpentype-0.1.0/serpentype/compat.py +317 -0
  81. serpentype-0.1.0/serpentype/text/__init__.py +1 -0
  82. serpentype-0.1.0/serpentype/text/fonts.py +5 -0
  83. serpentype-0.1.0/src/css.rs +971 -0
  84. serpentype-0.1.0/src/font.rs +236 -0
  85. serpentype-0.1.0/src/html.rs +234 -0
  86. serpentype-0.1.0/src/layout.rs +1134 -0
  87. serpentype-0.1.0/src/lib.rs +30 -0
  88. serpentype-0.1.0/src/pdf.rs +346 -0
  89. serpentype-0.1.0/src/python.rs +142 -0
  90. serpentype-0.1.0/tests/dom.rs +26 -0
  91. serpentype-0.1.0/tests/fixtures/blue.jpg +0 -0
  92. serpentype-0.1.0/tests/fixtures/blue.png +0 -0
  93. serpentype-0.1.0/tests/page_definition.rs +238 -0
  94. serpentype-0.1.0/tests/test_api.py +234 -0
  95. serpentype-0.1.0/tests/test_weasy_compat.py +89 -0
@@ -0,0 +1,39 @@
1
+ name: wheels
2
+ on:
3
+ push:
4
+ pull_request:
5
+ workflow_dispatch:
6
+ jobs:
7
+ build:
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ include:
12
+ - os: ubuntu-22.04
13
+ interpreter: python3.10
14
+ - os: macos-15
15
+ interpreter: python
16
+ - os: macos-15-intel
17
+ interpreter: python
18
+ - os: windows-2022
19
+ interpreter: python
20
+ runs-on: ${{ matrix.os }}
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: '3.13'
26
+ - uses: PyO3/maturin-action@v1
27
+ with:
28
+ command: build
29
+ args: --release --locked -i ${{ matrix.interpreter }}
30
+ manylinux: '2_28'
31
+ - name: Install and smoke test wheel
32
+ shell: bash
33
+ run: |
34
+ python -c 'import glob, subprocess, sys; wheels=glob.glob("target/wheels/*.whl"); assert wheels; subprocess.check_call([sys.executable,"-m","pip","install","--no-deps",wheels[0]])'
35
+ python -I -c 'import serpentype; f=serpentype.FontRegistry(); f.register_file(serpentype.bundled_font_path(),family="Noto Sans"); d=serpentype.Renderer(fonts=f).layout("<p>Привет</p>"); assert d.page_count==1 and d.to_pdf().startswith(b"%PDF")'
36
+ - uses: actions/upload-artifact@v4
37
+ with:
38
+ name: wheels-${{ matrix.os }}
39
+ path: target/wheels/*.whl
@@ -0,0 +1,5 @@
1
+ /target/
2
+ /.venv/
3
+ *.pdf
4
+ __pycache__/
5
+ *.egg-info/