Skip to content

Commit

Permalink
Switch to requirements files
Browse files Browse the repository at this point in the history
Supposedly fixes #177

See comment in pyproject.toml for rationale.
  • Loading branch information
mara004 committed Feb 23, 2023
1 parent 58a5cbf commit 36f6fbd
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 49 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build_packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ jobs:
repository: ${{ github.repository }}
fetch-depth: 0

- name: Install dependencies & pypdfium2
run: |
python3 -m pip install -U pip setuptools
python3 -m pip install -U .[setup,utilities,test,converters]
- name: Install/update dependencies
run: python3 -m pip install -U -r req/default.txt -r req/utilities.txt

- name: Install pypdfium2
run: python3 -m pip install --no-build-isolation -e .

- name: Run test suite
run: make test
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/gh_pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ jobs:
python-version: '3.10'
- name: Checkout
uses: actions/checkout@v3
- name: Install library
run: python3 -m pip install -U .[docs]
- name: Install deps & pypdfium2
run: |
python3 -m pip install -r req/docs.txt
python3 -m pip install -e .
- name: Build documentation
run: make docs-build
- name: Remove unnecessary files
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,26 @@ jobs:
uses: actions/checkout@v3
with:
repository: ${{ github.repository }}

- name: Install deps + Setup (default)
run: |
python3 -m pip install -U pip
python3 -m pip install -U .[setup,converters,test,docs]

# FIXME Should we run the test suite after each way of installing?

- name: Setup (default, no isolation)
run: python3 -m pip install --no-build-isolation .
- name: Setup (default)
run: python3 -m pip install .

- name: Setup (editable)
run: python3 -m pip install -e .

- name: Install/update deps for non-isolated setup
run: python3 -m pip install -U -r req/default.txt -r req/docs.txt

- name: Setup (default, no isolation)
run: python3 -m pip install --no-build-isolation .

- name: Setup (editable, no isolation)
run: python3 -m pip install --no-build-isolation -e .

- name: Build documentation
run: make docs-build

- name: Run Test Suite
- name: Run test suite
run: make test
4 changes: 1 addition & 3 deletions .github/workflows/test_sourcebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ jobs:
repository: ${{ github.repository }}

- name: Install deps
run: |
python3 -m pip install -U pip
python3 -m pip install -U .[setup,converters,test]
run: python3 -m pip install -U -r req/default.txt

- name: Build PDFium
run: python3 ./setupsrc/pl_setup/build_pdfium.py
Expand Down
5 changes: 4 additions & 1 deletion .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,12 @@ Comment:
Obtained from: https://github.com/bblanchon/pdfium-binaries/tree/master/patches
For reuse, see https://github.com/bblanchon/pdfium-binaries/issues/55


Files: sourcebuild/patches/syslibs_sourcebuild.patch
Copyright: 2023 geisserml <[email protected]>
License: CC-BY-4.0
Comment:
pypdfium2 specific sourcebuild patches

Files: req/*.txt
Copyright: 2023 geisserml <[email protected]>
License: CC-BY-4.0
35 changes: 4 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,10 @@ changelog = "https://pypdfium2.readthedocs.io/en/stable/changelog.html"
[project.scripts]
pypdfium2 = "pypdfium2.__main__:cli_main"

[project.optional-dependencies]
converters = [
"pillow",
"numpy",
]
setup = [
"ctypesgen @ git+https://github.com/mara004/ctypesgen@pypdfium2", # FIXME BUG(177)
"wheel", # !=0.38.0,!=0.38.1
"build",
]
docs = [
"sphinx >= 4.4.0",
"sphinx-rtd-theme >= 1.0",
"sphinxcontrib-programoutput",
"myst-parser",
"docutils >= 0.17",
]
test = [
"pytest",
"wheel", # !=0.38.0,!=0.38.1
]
utilities = [
"autoflake",
"codespell",
"reuse",
"check-wheel-contents",
"twine",
]
autocomplete = [
"argcomplete",
]
# NOTE using requirements files instead - rationale:
# - installation is independent of pypdfium2 (allows to install setup deps beforehand and then use --no-build-isolation)
# - initial motivation: work around BUG(177 - PyPI upload refused due to custom dependency)
# [project.optional-dependencies]

[tool.setuptools]
license-files = [
Expand Down
2 changes: 2 additions & 0 deletions req/converters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pillow
numpy
3 changes: 3 additions & 0 deletions req/default.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r setup.txt
-r test.txt
-r converters.txt
5 changes: 5 additions & 0 deletions req/docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx >= 4.4.0
sphinx-rtd-theme >= 1.0
sphinxcontrib-programoutput
myst-parser
docutils >= 0.17
5 changes: 5 additions & 0 deletions req/setup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pip
setuptools
build
wheel # !=0.38.0,!=0.38.1
ctypesgen @ git+https://github.com/mara004/ctypesgen@pypdfium2
2 changes: 2 additions & 0 deletions req/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest
wheel # !=0.38.0,!=0.38.1
5 changes: 5 additions & 0 deletions req/utilities.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
autoflake
codespell
reuse
check-wheel-contents
twine

0 comments on commit 36f6fbd

Please sign in to comment.