Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced PDF Combine Utility with Flexible TOC Options #3

Merged
merged 18 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[run]
source = src/
omit =
src/__init__.py
tests/*

[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
if __name__ == .__main__.:
pass
raise ImportError
11 changes: 2 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Build PDF Combine Utility

on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
Expand All @@ -15,7 +13,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'
architecture: 'x64'

- name: Install dependencies
Expand All @@ -24,11 +22,6 @@ jobs:
pip install pyinstaller
pip install -r requirements.txt

- name: Create Directories
run: |
mkdir .img
mkdir .font

- name: Build with PyInstaller
run: |
pyinstaller main.spec
Expand All @@ -37,4 +30,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: pdf-combine-utility
path: dist/main.exe
path: dist/PDF Combine.exe
111 changes: 111 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: PDF Combine CI/CD

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
test:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.11']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov pytest-benchmark pytest-mock

- name: Run core tests
run: |
pytest tests/ -v -m "not benchmark and not win32" --cov=src/ --cov-report=xml --cov-report=html

- name: Run Windows-specific tests
if: runner.os == 'Windows'
run: |
pytest tests/ -v -m "win32" --cov=src/ --cov-report=xml --cov-report=html --cov-append

- name: Run benchmark tests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
pytest tests/ -v -m "benchmark" --benchmark-only

- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: unittests
name: codecov-pdf-combine
fail_ci_if_error: false

- name: Upload benchmark results
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: .benchmarks/

- name: Upload coverage HTML report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: htmlcov/

build:
needs: test
runs-on: windows-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller

- name: Build executable
run: python build.py

- name: Create release assets
run: |
mkdir release
copy "dist/PDF Combine.exe" release/
copy LICENSE release/
copy README.md release/

- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: pdf-combine-windows
path: release/

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: release/*
body_path: CHANGELOG.md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

*.html
*.pyc
*.exe
*.toc
*.pyc
*.xml
build/
pdf_comb_az/
dist/
__pycache__/
.idea
.coverage
htmlcov/
coverage.xml
Binary file removed .img/start.jpg
Binary file not shown.
51 changes: 51 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2024 PDF Combine Utility Contributors

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Additional Permissions

This program interacts with Microsoft Word through COM automation for RTF to PDF
conversion. This interaction and any resulting output files are not covered by
the terms of this license. Users must ensure they have appropriate licenses for
Microsoft Office products if using this functionality.

The logos and brand assets in the assets/images directory are not covered by
this license and may be subject to separate copyright and licensing terms.

For any questions about licensing or permissions, please contact the project
maintainers.

Disclaimer of Warranty

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

Limitation of Liability

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY
COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS
PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Loading
Loading