-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
3,587 additions
and
915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[run] | ||
source = PyPDF2 | ||
branch = True | ||
|
||
[report] | ||
# Regexes for lines to exclude from consideration | ||
exclude_lines = | ||
# Have to re-enable the standard pragma | ||
pragma: no cover | ||
@overload | ||
|
||
# Don't complain about missing debug-only code: | ||
def __repr__ | ||
def __str__ | ||
if self\.debug | ||
|
||
# Don't complain if tests don't hit defensive assertion code: | ||
raise AssertionError | ||
raise NotImplementedError | ||
|
||
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Report a bug | ||
about: Something broke! | ||
title: "" | ||
labels: Bug | ||
assignees: MartinThoma | ||
|
||
--- | ||
|
||
Replace this: What happened? What were you trying to achieve? | ||
|
||
## Environment | ||
|
||
Which environment were you using when you encountered the problem? | ||
|
||
```python | ||
$ python -m platform | ||
# TODO: Your output goes here | ||
|
||
$ python -c "import PyPDF2;print(PyPDF2.__version__)" | ||
# TODO: Your output goes here | ||
``` | ||
|
||
## Code | ||
|
||
This is a minimal, complete example that shows the issue: | ||
|
||
```python | ||
# TODO: Your code goes here | ||
``` | ||
|
||
|
||
Share here the PDF file(s) that cause the issue. The smaller they are, the | ||
better. Let us know if we may add them to our tests! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Request a Feature | ||
about: What do you think is missing in PyPDF2? | ||
title: "" | ||
labels: Feature Request | ||
assignees: MartinThoma | ||
--- | ||
|
||
## Explanation | ||
|
||
Explain briefly what you want to achive. | ||
|
||
## Code Example | ||
|
||
How would your feature be used? (Remove this if it is not applicable.) | ||
|
||
```python | ||
from PyPDF2 import PdfFileReader, PdfFileWriter | ||
... # your new feature in action! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
tests: | ||
name: pytest on ${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Upgrade pip | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Install requirements (Python 3) | ||
if: matrix.python-version != '2.7' | ||
run: | | ||
pip install -r requirements/ci.txt | ||
- name: Install requirements (Python 2) | ||
if: matrix.python-version == '2.7' | ||
run: | | ||
pip install pillow pytest coverage | ||
- name: Install PyPDF2 | ||
run: | | ||
pip install . | ||
- name: Test with flake8 | ||
run: | | ||
flake8 . --ignore=E203,W503,W504,E,F403,F405 --exclude build | ||
if: matrix.python-version != '2.7' | ||
- name: Test with pytest | ||
run: | | ||
python -m coverage run --parallel-mode -m pytest Tests -vv | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-data | ||
path: .coverage.* | ||
if-no-files-found: ignore | ||
|
||
package: | ||
name: Build & verify package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{env.PYTHON_LATEST}} | ||
|
||
- run: python -m pip install build twine check-wheel-contents | ||
- run: python -m build --sdist --wheel . | ||
- run: ls -l dist | ||
- run: check-wheel-contents dist/*.whl | ||
- name: Check long_description | ||
run: python -m twine check dist/* | ||
|
||
coverage: | ||
name: Combine & check coverage. | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
# Use latest Python, so it understands all syntax. | ||
python-version: ${{env.PYTHON_LATEST}} | ||
|
||
- run: python -m pip install --upgrade coverage[toml] | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: coverage-data | ||
|
||
- name: Combine coverage & create xml report | ||
run: | | ||
python -m coverage combine | ||
python -m coverage xml | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# pre-commit run --all-files | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.2.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-byte-order-marker | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- id: check-added-large-files | ||
args: ['--maxkb=1000'] | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
args: ["--ignore", "E,W,F"] | ||
# - repo: https://github.com/pre-commit/mirrors-mypy | ||
# rev: v0.942 | ||
# hooks: | ||
# - id: mypy | ||
# - repo: https://github.com/psf/black | ||
# rev: 22.3.0 | ||
# hooks: | ||
# - id: black | ||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v2.31.1 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: [--py36-plus] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: v1.12.1 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==22.1.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.6.15 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.