pdfly 0.3.3__tar.gz → 0.5.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 (124) hide show
  1. pdfly-0.5.0/.all-contributorsrc +154 -0
  2. pdfly-0.5.0/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  3. pdfly-0.5.0/.github/ISSUE_TEMPLATE/config.yml +9 -0
  4. pdfly-0.5.0/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  5. pdfly-0.5.0/.github/ISSUE_TEMPLATE/question.md +14 -0
  6. pdfly-0.5.0/.github/pull_request_template.md +39 -0
  7. pdfly-0.5.0/.github/scripts/check_pr_title.py +37 -0
  8. pdfly-0.5.0/.github/workflows/check-gitignored-files.yml +30 -0
  9. {pdfly-0.3.3 → pdfly-0.5.0}/.github/workflows/create-github-release.yaml +5 -2
  10. {pdfly-0.3.3 → pdfly-0.5.0}/.github/workflows/github-ci.yaml +20 -18
  11. {pdfly-0.3.3 → pdfly-0.5.0}/.github/workflows/publish-to-pypi.yaml +3 -2
  12. {pdfly-0.3.3 → pdfly-0.5.0}/.github/workflows/release.yaml +1 -1
  13. pdfly-0.5.0/.github/workflows/title-check.yml +20 -0
  14. {pdfly-0.3.3 → pdfly-0.5.0}/.gitignore +4 -0
  15. {pdfly-0.3.3 → pdfly-0.5.0}/.pre-commit-config.yaml +8 -8
  16. {pdfly-0.3.3 → pdfly-0.5.0}/.readthedocs.yaml +1 -1
  17. pdfly-0.5.0/.typos.toml +6 -0
  18. pdfly-0.5.0/CHANGELOG.md +105 -0
  19. pdfly-0.5.0/CONTRIBUTORS.md +1 -0
  20. {pdfly-0.3.3 → pdfly-0.5.0}/Makefile +2 -2
  21. pdfly-0.5.0/PKG-INFO +157 -0
  22. pdfly-0.5.0/README.md +124 -0
  23. pdfly-0.5.0/dependabot.yml +12 -0
  24. {pdfly-0.3.3 → pdfly-0.5.0}/docs/conf.py +2 -1
  25. pdfly-0.5.0/docs/dev/intro.md +89 -0
  26. pdfly-0.5.0/docs/dev/testing.md +5 -0
  27. {pdfly-0.3.3 → pdfly-0.5.0}/docs/index.rst +22 -2
  28. {pdfly-0.3.3 → pdfly-0.5.0}/docs/meta/project-governance.md +3 -3
  29. {pdfly-0.3.3 → pdfly-0.5.0}/docs/user/installation.md +26 -12
  30. pdfly-0.5.0/docs/user/subcommand-2-up.md +32 -0
  31. pdfly-0.5.0/docs/user/subcommand-booklet.md +44 -0
  32. {pdfly-0.3.3 → pdfly-0.5.0}/docs/user/subcommand-cat.md +4 -1
  33. pdfly-0.5.0/docs/user/subcommand-check-sign.md +33 -0
  34. pdfly-0.5.0/docs/user/subcommand-compress.md +41 -0
  35. pdfly-0.5.0/docs/user/subcommand-extract-annotated-pages.md +44 -0
  36. pdfly-0.5.0/docs/user/subcommand-extract-images.md +36 -0
  37. pdfly-0.5.0/docs/user/subcommand-extract-text.md +31 -0
  38. pdfly-0.5.0/docs/user/subcommand-pagemeta.md +57 -0
  39. pdfly-0.5.0/docs/user/subcommand-rm.md +77 -0
  40. pdfly-0.5.0/docs/user/subcommand-rotate.md +81 -0
  41. pdfly-0.5.0/docs/user/subcommand-sign.md +49 -0
  42. pdfly-0.5.0/docs/user/subcommand-uncompress.md +25 -0
  43. pdfly-0.5.0/docs/user/subcommand-update-offsets.md +56 -0
  44. {pdfly-0.3.3 → pdfly-0.5.0}/docs/user/subcommand-x2pdf.md +1 -1
  45. {pdfly-0.3.3 → pdfly-0.5.0}/make_release.py +36 -19
  46. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/__init__.py +1 -0
  47. pdfly-0.5.0/pdfly/_version.py +1 -0
  48. pdfly-0.5.0/pdfly/booklet.py +156 -0
  49. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/cat.py +51 -23
  50. pdfly-0.5.0/pdfly/check_sign.py +48 -0
  51. pdfly-0.5.0/pdfly/cli.py +420 -0
  52. pdfly-0.5.0/pdfly/compress.py +48 -0
  53. pdfly-0.5.0/pdfly/extract_annotated_pages.py +39 -0
  54. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/metadata.py +50 -24
  55. pdfly-0.5.0/pdfly/pagemeta.py +82 -0
  56. pdfly-0.5.0/pdfly/rm.py +57 -0
  57. pdfly-0.5.0/pdfly/rotate.py +83 -0
  58. pdfly-0.5.0/pdfly/sign.py +168 -0
  59. pdfly-0.5.0/pdfly/uncompress.py +52 -0
  60. pdfly-0.5.0/pdfly/up2.py +34 -0
  61. pdfly-0.5.0/pdfly/update_offsets.py +286 -0
  62. pdfly-0.5.0/pdfly/x2pdf.py +50 -0
  63. {pdfly-0.3.3 → pdfly-0.5.0}/pyproject.toml +15 -16
  64. pdfly-0.5.0/renovate.json +6 -0
  65. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/ci.txt +14 -34
  66. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/dev.txt +58 -71
  67. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/docs.txt +15 -15
  68. pdfly-0.5.0/resources/b.pdf +0 -0
  69. pdfly-0.5.0/resources/c.pdf +0 -0
  70. pdfly-0.5.0/resources/demo2_ca.root.crt.pem +20 -0
  71. pdfly-0.5.0/resources/file-with-fixed-offsets.pdf +52 -0
  72. pdfly-0.5.0/resources/file-with-invalid-offsets.pdf +52 -0
  73. pdfly-0.5.0/resources/input8.pdf +0 -0
  74. pdfly-0.5.0/resources/sign_pkcs12.pdf +0 -0
  75. pdfly-0.5.0/resources/signing-certificate.crt +29 -0
  76. pdfly-0.5.0/resources/signing-certificate.p12 +0 -0
  77. {pdfly-0.3.3 → pdfly-0.5.0}/setup.py +2 -1
  78. {pdfly-0.3.3 → pdfly-0.5.0}/tests/conftest.py +11 -8
  79. pdfly-0.5.0/tests/test_booklet.py +121 -0
  80. {pdfly-0.3.3 → pdfly-0.5.0}/tests/test_cat.py +1 -3
  81. pdfly-0.5.0/tests/test_check_sign.py +131 -0
  82. pdfly-0.5.0/tests/test_compress.py +211 -0
  83. pdfly-0.5.0/tests/test_extract_annotated_pages.py +14 -0
  84. {pdfly-0.3.3 → pdfly-0.5.0}/tests/test_extract_images.py +0 -2
  85. pdfly-0.5.0/tests/test_rm.py +229 -0
  86. pdfly-0.5.0/tests/test_rotate.py +121 -0
  87. pdfly-0.5.0/tests/test_sign.py +102 -0
  88. pdfly-0.5.0/tests/test_uncompress.py +40 -0
  89. pdfly-0.5.0/tests/test_up2.py +63 -0
  90. pdfly-0.5.0/tests/test_update_offsets.py +101 -0
  91. pdfly-0.5.0/tests/test_x2pdf.py +86 -0
  92. pdfly-0.3.3/CHANGELOG.md +0 -67
  93. pdfly-0.3.3/CONTRIBUTORS.md +0 -41
  94. pdfly-0.3.3/PKG-INFO +0 -92
  95. pdfly-0.3.3/README.md +0 -63
  96. pdfly-0.3.3/pdfly/_version.py +0 -1
  97. pdfly-0.3.3/pdfly/cli.py +0 -227
  98. pdfly-0.3.3/pdfly/compress.py +0 -25
  99. pdfly-0.3.3/pdfly/pagemeta.py +0 -79
  100. pdfly-0.3.3/pdfly/up2.py +0 -29
  101. pdfly-0.3.3/pdfly/x2pdf.py +0 -54
  102. pdfly-0.3.3/tests/test_x2pdf.py +0 -31
  103. {pdfly-0.3.3 → pdfly-0.5.0}/.github/dependabot.yml +0 -0
  104. {pdfly-0.3.3 → pdfly-0.5.0}/.gitmodules +0 -0
  105. {pdfly-0.3.3 → pdfly-0.5.0}/.isort.cfg +0 -0
  106. {pdfly-0.3.3 → pdfly-0.5.0}/LICENSE +0 -0
  107. {pdfly-0.3.3 → pdfly-0.5.0}/docs/Makefile +0 -0
  108. {pdfly-0.3.3 → pdfly-0.5.0}/docs/make.bat +0 -0
  109. {pdfly-0.3.3 → pdfly-0.5.0}/docs/user/subcommand-meta.md +0 -0
  110. {pdfly-0.3.3 → pdfly-0.5.0}/mypy.ini +0 -0
  111. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/__main__.py +0 -0
  112. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/_utils.py +0 -0
  113. {pdfly-0.3.3 → pdfly-0.5.0}/pdfly/extract_images.py +0 -0
  114. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/ci.in +0 -0
  115. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/dev.in +0 -0
  116. {pdfly-0.3.3 → pdfly-0.5.0}/requirements/docs.in +0 -0
  117. {pdfly-0.3.3 → pdfly-0.5.0}/resources/GeoBase_NHNC1_Data_Model_UML_EN.pdf +0 -0
  118. {pdfly-0.3.3 → pdfly-0.5.0}/resources/baleines.jpg +0 -0
  119. {pdfly-0.3.3 → pdfly-0.5.0}/resources/box.pdf +0 -0
  120. {pdfly-0.3.3 → pdfly-0.5.0}/resources/jpeg.pdf +0 -0
  121. {pdfly-0.3.3 → pdfly-0.5.0}/resources/pythonknight.png +0 -0
  122. {pdfly-0.3.3 → pdfly-0.5.0}/setup.cfg +0 -0
  123. {pdfly-0.3.3 → pdfly-0.5.0}/tests/__init__.py +0 -0
  124. {pdfly-0.3.3 → pdfly-0.5.0}/tests/test_cli.py +0 -0
@@ -0,0 +1,154 @@
1
+ {
2
+ "projectName": "pdfly",
3
+ "projectOwner": "py-pdf",
4
+ "repoType": "github",
5
+ "repoHost": "https://github.com",
6
+ "files": [
7
+ "README.md"
8
+ ],
9
+ "imageSize": 100,
10
+ "commit": true,
11
+ "commitConvention": "eslint",
12
+ "contributors": [
13
+ {
14
+ "login": "MartinThoma",
15
+ "name": "Martin Thoma",
16
+ "avatar_url": "https://avatars.githubusercontent.com/u/1658117?v=4",
17
+ "profile": "http://martin-thoma.com/",
18
+ "contributions": [
19
+ "code",
20
+ "doc",
21
+ "ideas",
22
+ "infra",
23
+ "maintenance",
24
+ "projectManagement",
25
+ "tutorial"
26
+ ]
27
+ },
28
+ {
29
+ "login": "Lucas-C",
30
+ "name": "Lucas Cimon",
31
+ "avatar_url": "https://avatars.githubusercontent.com/u/925560?v=4",
32
+ "profile": "https://chezsoi.org/lucas/blog/",
33
+ "contributions": [
34
+ "bug",
35
+ "code",
36
+ "doc",
37
+ "maintenance"
38
+ ]
39
+ },
40
+ {
41
+ "login": "pastor-robert",
42
+ "name": "Rob Adams",
43
+ "avatar_url": "https://avatars.githubusercontent.com/u/35646090?v=4",
44
+ "profile": "https://github.com/pastor-robert",
45
+ "contributions": [
46
+ "code"
47
+ ]
48
+ },
49
+ {
50
+ "login": "Kaos599",
51
+ "name": "Harsh ",
52
+ "avatar_url": "https://avatars.githubusercontent.com/u/115716485?v=4",
53
+ "profile": "https://github.com/Kaos599",
54
+ "contributions": [
55
+ "code"
56
+ ]
57
+ },
58
+ {
59
+ "login": "srogmann",
60
+ "name": "Sascha Rogmann",
61
+ "avatar_url": "https://avatars.githubusercontent.com/u/59577610?v=4",
62
+ "profile": "https://github.com/srogmann",
63
+ "contributions": [
64
+ "code"
65
+ ]
66
+ },
67
+ {
68
+ "login": "ebotiab",
69
+ "name": "Enrique Botía",
70
+ "avatar_url": "https://avatars.githubusercontent.com/u/62219950?v=4",
71
+ "profile": "https://github.com/ebotiab",
72
+ "contributions": [
73
+ "code"
74
+ ]
75
+ },
76
+ {
77
+ "login": "kommade",
78
+ "name": "kommade",
79
+ "avatar_url": "https://avatars.githubusercontent.com/u/99523586?v=4",
80
+ "profile": "https://github.com/kommade",
81
+ "contributions": [
82
+ "code"
83
+ ]
84
+ },
85
+ {
86
+ "login": "Zingzy",
87
+ "name": "Zingzy",
88
+ "avatar_url": "https://avatars.githubusercontent.com/u/90309290?v=4",
89
+ "profile": "https://spoo.me/",
90
+ "contributions": [
91
+ "code"
92
+ ]
93
+ },
94
+ {
95
+ "login": "wolfram77",
96
+ "name": "Subhajit Sahu",
97
+ "avatar_url": "https://avatars.githubusercontent.com/u/3179612?v=4",
98
+ "profile": "https://wolfram77.github.io",
99
+ "contributions": [
100
+ "code"
101
+ ]
102
+ },
103
+ {
104
+ "login": "kianmeng",
105
+ "name": "Kian-Meng Ang",
106
+ "avatar_url": "https://avatars.githubusercontent.com/u/134518?v=4",
107
+ "profile": "https://www.kianmeng.org",
108
+ "contributions": [
109
+ "ideas"
110
+ ]
111
+ },
112
+ {
113
+ "login": "hwine",
114
+ "name": "Hal Wine",
115
+ "avatar_url": "https://avatars.githubusercontent.com/u/132412?v=4",
116
+ "profile": "https://github.com/hwine",
117
+ "contributions": [
118
+ "bug",
119
+ "code"
120
+ ]
121
+ },
122
+ {
123
+ "login": "philippesamuel",
124
+ "name": "philippesamuel",
125
+ "avatar_url": "https://avatars.githubusercontent.com/u/32560769?v=4",
126
+ "profile": "https://github.com/philippesamuel",
127
+ "contributions": [
128
+ "doc"
129
+ ]
130
+ },
131
+ {
132
+ "login": "marcobrb",
133
+ "name": "marcobrb",
134
+ "avatar_url": "https://avatars.githubusercontent.com/u/219329309?v=4",
135
+ "profile": "https://github.com/marcobrb",
136
+ "contributions": [
137
+ "doc"
138
+ ]
139
+ },
140
+ {
141
+ "login": "moormaster",
142
+ "name": "moormaster",
143
+ "avatar_url": "https://avatars.githubusercontent.com/u/2452695?v=4",
144
+ "profile": "https://github.com/moormaster",
145
+ "contributions": [
146
+ "doc",
147
+ "code"
148
+ ]
149
+ }
150
+ ],
151
+ "contributorsPerLine": 5,
152
+ "skipCi": false,
153
+ "commitType": "docs"
154
+ }
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report some unexpected behaviour to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+ <!--
9
+ Hi there! Thank you for wanting to make pdfly better 😉.
10
+
11
+ Please perform a quick search first, in order to check if your problem has already been reported:
12
+ https://github.com/py-pdf/pdfly/issues
13
+ -->
14
+
15
+ Describe the bug
16
+
17
+ **Error details**
18
+ If an exception is raised, it is very important that you provide the full error message.
19
+ Otherwise members of the `pdfly` community won't be able to help you with your problem.
20
+
21
+ **Environment**
22
+ Please provide the following information:
23
+ * **Operating System**: Windows, Mac OSX, Linux flavour...
24
+ * **Python version**: you can get this information with `python --version`
25
+ * **`pdfly` version used**: if you installed it with `pip`, you can get this information in `pip freeze` output
26
+
27
+ <!-- Bonus / recommended:
28
+
29
+ Often, there are bugfixes & other changes on pdfly git repo `master` branch
30
+ that have not been released yet. They are listed in the ChangeLog:
31
+ https://github.com/py-pdf/pdfly/blob/master/CHANGELOG.md
32
+
33
+ Hence, please check that your bug is still present using the latest version of pdfly from the git repository, by installing it this way:
34
+
35
+ pip install git+https://github.com/py-pdf/pdfly.git@master
36
+
37
+ -->
@@ -0,0 +1,9 @@
1
+ # Ref: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2
+ blank_issues_enabled: false
3
+ contact_links:
4
+ - name: 💬 Start a discussion
5
+ url: https://github.com/py-pdf/pdfly/discussions/new
6
+ about: Informal discussion about the project organization, considerations that do not expect a definitive answer, etc.
7
+ # - name: Security issue
8
+ # url: security@...
9
+ # about: Do not report security issues publicly. Email our security contact.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+ <!--
9
+ Hi there! Thank you for wanting to make pdfly better 😉.
10
+
11
+ Before you submit this, make sure that this feature wasn't already requested,
12
+ or if it is not already implemented in the master branch but not released yet:
13
+ https://github.com/py-pdf/pdfly/blob/master/CHANGELOG.md
14
+ -->
15
+
16
+ **Please explain your intent**
17
+ Describe what you want to achieve.
18
+
19
+ **Describe the solution you'd like**
20
+ A clear and concise description of what you want to happen.
21
+ Please also mention any alternative solutions or features you've considered.
22
+
23
+ **Additional context**
24
+ Add any other context, code snippet or screenshots about the feature request.
25
+ You can also mention if you are willing to contribute a PR yourself to provide this feature.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: I have a question
3
+ about: Anything that is not a bug report or a feature request
4
+ title: ''
5
+ labels: question
6
+ assignees: ''
7
+ ---
8
+ <!--
9
+ Hi there! Thank you for reaching out and stepping in pdfly users community 😉.
10
+
11
+ Before submitting your question, please check:
12
+ * that it is not covered by the documentation: https://pdfly.readthedocs.io/en/latest/
13
+ * that it has not already been asked: https://github.com/py-pdf/pdfly/issues
14
+ -->
@@ -0,0 +1,39 @@
1
+ <!--
2
+ Thanks for your interest in the project.
3
+ Bugs filed and PRs submitted are appreciated!
4
+
5
+ Some guidelines are provided like this, in HTML comments, to expedite the code review before merging your contribution.
6
+
7
+ First, please make sure that you have read the documentation page on pdfly development:
8
+ https://pdfly.readthedocs.io/en/latest/dev/intro.html
9
+
10
+ If you're new to contributing to open source projects,
11
+ you might find this free video course helpful: http://kcd.im/pull-request
12
+ -->
13
+
14
+ <!-- What changes are being made? (What feature/bug is being fixed here?) -->
15
+
16
+ e.g. Fixes #0 <!-- This will automatically close issue #0 once the PR is merged: https://help.github.com/en/articles/closing-issues-using-keywords -->
17
+
18
+ <!-- Have you done all of these things? -->
19
+ **Checklist**:
20
+
21
+ <!-- To check an item, place an "x" in the box like so: "- [x] Item description"
22
+ Add "N/A" to the end of each line that's irrelevant to your changes -->
23
+
24
+ - [ ] A unit test is covering the code added / modified by this PR
25
+
26
+ - [ ] In case of a new feature, docstrings have been added, with also some documentation in the `docs/` folder
27
+
28
+ - [ ] A mention of the change is present in `CHANGELOG.md`
29
+
30
+ - [ ] This PR is ready to be merged <!-- In your opinion, can this be merged as soon as it's reviewed? Else, this can be turned into a Draft PR -->
31
+
32
+ <!-- Feel free to add additional comments, and to ask questions if some of those guidelines are unclear to you! -->
33
+
34
+ <!--
35
+ Once a PR is merged, maintainers will add your name to the contributors table in README.md.
36
+ If they forget, or you do not wish this to happen, please mention it.
37
+ -->
38
+
39
+ By submitting this pull request, I confirm that my contribution is made under the terms of the [BSD 3-Clause license](https://github.com/py-pdf/pdfly/blob/master/LICENSE).
@@ -0,0 +1,37 @@
1
+ """Check that all PR titles follow the desired scheme."""
2
+
3
+ import os
4
+ import sys
5
+
6
+ KNOWN_PREFIXES = (
7
+ "SEC: ",
8
+ "BUG: ",
9
+ "ENH: ",
10
+ "DEP: ",
11
+ "PI: ",
12
+ "ROB: ",
13
+ "DOC: ",
14
+ "Docs: ", # MRs from Dependabot
15
+ "TST: ",
16
+ "DEV: ",
17
+ "STY: ",
18
+ "MAINT: ",
19
+ "REL: ",
20
+ )
21
+ PR_TITLE = os.getenv("PR_TITLE", "")
22
+
23
+ if (
24
+ not PR_TITLE.startswith(KNOWN_PREFIXES)
25
+ or not PR_TITLE.split(": ", maxsplit=1)[1]
26
+ ):
27
+ sys.stderr.write(
28
+ f"The PR title '{PR_TITLE}' does not follow the projects naming scheme: "
29
+ "https://pdfly.readthedocs.io/en/latest/dev/intro.html#commit-messages\n",
30
+ )
31
+ sys.stderr.write(
32
+ "If you do not know which one to choose or if multiple apply, make a best guess. "
33
+ "Nobody will complain if it does not quite fit :-)\n",
34
+ )
35
+ sys.exit(1)
36
+ else:
37
+ sys.stdout.write(f"PR title '{PR_TITLE}' appears to be valid.\n")
@@ -0,0 +1,30 @@
1
+ name: Check for Gitignored Files
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - '**' # Run on all branches
7
+ pull_request:
8
+
9
+ jobs:
10
+ check-gitignored-files:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout code
15
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
16
+
17
+ - name: Check for gitignored files in commit
18
+ run: |
19
+ # List all files in the commit
20
+ git diff --name-only --cached > committed_files.txt
21
+
22
+ # Check if any of the committed files are ignored by .gitignore
23
+ git check-ignore -v $(cat committed_files.txt) > ignored_files.txt || true
24
+
25
+ # Fail if there are any ignored files
26
+ if [[ -s ignored_files.txt ]]; then
27
+ echo "The following files are gitignored but committed:"
28
+ cat ignored_files.txt
29
+ exit 1
30
+ fi
@@ -15,11 +15,13 @@ permissions:
15
15
 
16
16
  jobs:
17
17
  build_and_publish:
18
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
18
19
  name: Create a GitHub release page
19
20
  runs-on: ubuntu-latest
20
21
  steps:
21
22
  - name: Checkout Repository
22
- uses: actions/checkout@v4
23
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24
+
23
25
  - name: Prepare variables
24
26
  id: prepare_variables
25
27
  run: |
@@ -31,8 +33,9 @@ jobs:
31
33
  echo "tag_body<<$EOF" >> "$GITHUB_ENV"
32
34
  git --no-pager tag -l "${latest_tag}" --format='%(contents:body)' >> "$GITHUB_ENV"
33
35
  echo "$EOF" >> "$GITHUB_ENV"
36
+
34
37
  - name: Create GitHub Release 🚀
35
- uses: softprops/action-gh-release@v1
38
+ uses: softprops/action-gh-release@6da8fa9354ddfdc4aeace5fc48d7f679b5214090 # v2.4.1
36
39
  with:
37
40
  tag_name: ${{ env.latest_tag }}
38
41
  name: Version ${{ env.latest_tag }}, ${{ env.date }}
@@ -6,31 +6,25 @@ name: CI
6
6
  on:
7
7
  push:
8
8
  branches: [ main ]
9
- paths-ignore:
10
- - '**/*.md'
11
- - '**/*.rst'
12
9
  pull_request:
13
10
  branches: [ main ]
14
- paths-ignore:
15
- - '**/*.md'
16
- - '**/*.rst'
17
11
  workflow_dispatch:
18
12
 
19
13
  jobs:
20
14
  tests:
21
15
  name: pytest on ${{ matrix.python-version }}
22
- runs-on: ubuntu-20.04
16
+ runs-on: ubuntu-latest
23
17
  strategy:
24
18
  matrix:
25
- python-version: ["3.8", "3.9", "3.10", "3.11"]
19
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
26
20
 
27
21
  steps:
28
22
  - name: Checkout Code
29
- uses: actions/checkout@v4
23
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
30
24
  with:
31
25
  submodules: 'recursive'
32
26
  - name: Setup Python ${{ matrix.python-version }}
33
- uses: actions/setup-python@v5
27
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
34
28
  with:
35
29
  python-version: ${{ matrix.python-version }}
36
30
 
@@ -39,22 +33,29 @@ jobs:
39
33
  - name: Install requirements (Python 3)
40
34
  run: pip install -r requirements/ci.txt -r requirements/dev.txt
41
35
  - name: Install pdfly
36
+ if: matrix.python-version != '3.8'
42
37
  run: pip install .
38
+ - name: Install pdfly using the minimal versions of the dependencies
39
+ if: matrix.python-version == '3.8'
40
+ run: |
41
+ # We ensure that those minimal versions remain compatible:
42
+ sed -i '/dependencies = \[/,/\]/s/>=/==/' pyproject.toml
43
+ pip install .
43
44
 
44
45
  - name: Run tests
45
46
  run: pytest -vv
46
47
 
47
48
  codestyle:
48
49
  name: Check code style issues
49
- runs-on: ubuntu-20.04
50
+ runs-on: ubuntu-latest
50
51
  steps:
51
52
  - name: Checkout Code
52
- uses: actions/checkout@v4
53
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53
54
  with:
54
55
  submodules: 'recursive'
55
56
  - name: Cache Downloaded Files
56
57
  id: cache-downloaded-files
57
- uses: actions/cache@v4
58
+ uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
58
59
  with:
59
60
  path: '**/tests/pdf_cache/*'
60
61
  key: cache-downloaded-files
@@ -71,17 +72,18 @@ jobs:
71
72
  - name: Lint with mypy
72
73
  run: mypy . --ignore-missing-imports --exclude build
73
74
  - name: Test with ruff
74
- run: |
75
- echo `ruff --version`
76
- ruff pdfly/
75
+ run: ruff check pdfly/
76
+
77
+ - name: Spell Check Repo
78
+ uses: crate-ci/typos@80c8a4945eec0f6d464eaf9e65ed98ef085283d1 # v1.38.1
77
79
 
78
80
  package:
79
81
  name: Build & verify package
80
82
  runs-on: ubuntu-latest
81
83
 
82
84
  steps:
83
- - uses: actions/checkout@v4
84
- - uses: actions/setup-python@v5
85
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
86
+ - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
85
87
  with:
86
88
  python-version: ${{env.PYTHON_LATEST}}
87
89
 
@@ -15,11 +15,12 @@ permissions:
15
15
 
16
16
  jobs:
17
17
  build_and_publish:
18
+ if: ${{ github.event.workflow_run.conclusion == 'success' }}
18
19
  name: Publish a new version
19
20
  runs-on: ubuntu-latest
20
21
  steps:
21
22
  - name: Set up Python
22
- uses: actions/setup-python@v5
23
+ uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
23
24
  with:
24
25
  python-version: 3.x
25
26
 
@@ -29,7 +30,7 @@ jobs:
29
30
  pip install flit
30
31
 
31
32
  - name: Checkout Repository
32
- uses: actions/checkout@v4
33
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33
34
 
34
35
  - name: Publish Package to PyPI🚀
35
36
  env:
@@ -19,7 +19,7 @@ jobs:
19
19
  if: "${{ startsWith(github.event.head_commit.message, 'REL: ') }}"
20
20
  steps:
21
21
  - name: Checkout Repository
22
- uses: actions/checkout@v4
22
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
23
23
 
24
24
  - name: Extract version from commit message
25
25
  id: extract_version
@@ -0,0 +1,20 @@
1
+ name: 'PR Title Check'
2
+ on:
3
+ pull_request:
4
+ # check when PR
5
+ # * is created,
6
+ # * title is edited, and
7
+ # * new commits are added (to ensure failing title blocks merging)
8
+ types: [opened, reopened, edited, synchronize]
9
+
10
+ jobs:
11
+ title-check:
12
+ name: Title check
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout Code
16
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17
+ - name: Check PR title
18
+ env:
19
+ PR_TITLE: ${{ github.event.pull_request.title }}
20
+ run: python .github/scripts/check_pr_title.py
@@ -103,6 +103,7 @@ celerybeat.pid
103
103
 
104
104
  # Environments
105
105
  .env
106
+ .envrc
106
107
  .venv
107
108
  env/
108
109
  venv/
@@ -114,6 +115,9 @@ venv.bak/
114
115
  .spyderproject
115
116
  .spyproject
116
117
 
118
+ # IntelliJ
119
+ .idea
120
+
117
121
  # Rope project settings
118
122
  .ropeproject
119
123
 
@@ -1,7 +1,7 @@
1
1
  # pre-commit run --all-files
2
2
  repos:
3
3
  - repo: https://github.com/pre-commit/pre-commit-hooks
4
- rev: v4.5.0
4
+ rev: v5.0.0
5
5
  hooks:
6
6
  - id: check-ast
7
7
  - id: check-byte-order-marker
@@ -18,34 +18,34 @@ repos:
18
18
  - id: check-added-large-files
19
19
  args: ['--maxkb=1000']
20
20
  - repo: https://github.com/psf/black
21
- rev: 23.12.0
21
+ rev: 25.1.0
22
22
  hooks:
23
23
  - id: black
24
24
  args: [--target-version, py36]
25
25
  - repo: https://github.com/asottile/blacken-docs
26
- rev: 1.16.0
26
+ rev: 1.19.1
27
27
  hooks:
28
28
  - id: blacken-docs
29
29
  additional_dependencies: [black==22.1.0]
30
30
  - repo: https://github.com/astral-sh/ruff-pre-commit
31
- rev: v0.1.8
31
+ rev: v0.9.5
32
32
  hooks:
33
33
  - id: ruff
34
34
  args: ['--fix']
35
35
  exclude: "tests/"
36
36
  - repo: https://github.com/asottile/pyupgrade
37
- rev: v3.15.0
37
+ rev: v3.19.1
38
38
  hooks:
39
39
  - id: pyupgrade
40
- args: [--py36-plus]
40
+ args: [--py38-plus]
41
41
  - repo: https://github.com/pycqa/flake8
42
- rev: 6.1.0
42
+ rev: 7.1.1
43
43
  hooks:
44
44
  - id: flake8
45
45
  args: ["--ignore", "E,W,F"]
46
46
 
47
47
  - repo: https://github.com/pre-commit/mirrors-mypy
48
- rev: 'v1.7.1'
48
+ rev: 'v1.15.0'
49
49
  hooks:
50
50
  - id: mypy
51
51
  files: ^pdfly/.*
@@ -5,7 +5,7 @@ version: 2
5
5
  build:
6
6
  os: ubuntu-22.04
7
7
  tools:
8
- python: "3.11"
8
+ python: "3.12"
9
9
 
10
10
  # Build documentation in the docs/ directory with Sphinx
11
11
  sphinx:
@@ -0,0 +1,6 @@
1
+ [default]
2
+ extend-ignore-identifiers-re = [
3
+ "FlateDecode",
4
+ # This typo appears in a .tex file in the sample-files git submodule:
5
+ "exampe"
6
+ ]