Skip to content

Commit

Permalink
Clean up, release v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eli64s committed Feb 18, 2025
1 parent 89d40da commit 950ab9f
Show file tree
Hide file tree
Showing 11 changed files with 349 additions and 246 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ site/
# root
.pdflex/
docs/*.md
notebooks
test_merge_numeric_prefixed_pdfs.py
test_pdflex.py
test_search_for_pdf_files.py

# src.pdflex
src/pdflex/extractors/
src/pdflex/generators/
src/pdflex/modifiers/
src/pdflex/settings/
src/pdflex/config.py
src/pdflex/config.py'
# tests
tests/pdflex/extractors/
tests/pdflex/modifiers/
27 changes: 26 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

PYPROJECT_TOML := pyproject.toml
PYPI_VERSION := 0.1.0
PYPI_VERSION := 0.1.1
PYTHON_VERSION := 3.11
TARGET := src/pdflex tests
TARGET_TEST := tests
Expand Down Expand Up @@ -61,12 +61,15 @@ venv: ## Create a virtual environment

# -- Docs ---------------------------


.PHONY: docs
docs: ## Build documentation site using mkdocs
@echo -e "\n► Building documentation site... (not implemented)"


# -- Lint ---------------------------


.PHONY: format-toml
format-toml: ## Format TOML files using pyproject-fmt
uvx --isolated pyproject-fmt $(TOML_FILE) --indent 4
Expand All @@ -93,6 +96,28 @@ typecheck-pyright: ## Type-check Python files using Pyright
uv run pyright $(TARGET)


# -- Release ----------------------------


RELEASE_FILES ?= .
RELEASE_MSG ?= "Release version $(PYPI_VERSION)"
RELEASE_BRANCH ?= main
TAG_PREFIX ?= v

.PHONY: release
release: ## Create and push a new version release
ifndef version
$(error version parameter is required. Use 'make release version=X.Y.Z')
endif
# make release version=1.2.3 RELEASE_FILES="file1 file2" RELEASE_MSG="Custom release message" RELEASE_BRANCH=develop TAG_PREFIX=release-"
@echo "Creating release version $(version)..."
@git add $(RELEASE_FILES)
@git commit -m "$(RELEASE_MSG)"
@git tag -a $(TAG_PREFIX)$(version) -m "$(RELEASE_MSG)"
@git push origin $(RELEASE_BRANCH)
@git push origin $(TAG_PREFIX)$(version)


# -- Tests ----------------------------


Expand Down
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<div id="top" align="left">

<!-- HEADER -->
<<<<<<< Updated upstream
=======

>>>>>>> Stashed changes
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/eli64s/pdflex/1ecee046e6fe585309371b6df12e78845881d3de/docs/assets/logo-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/eli64s/pdflex/1ecee046e6fe585309371b6df12e78845881d3de/docs/assets/logo-light.svg">
<img alt="pdflex Logo" src="https://raw.githubusercontent.com/eli64s/pdflex/1ecee046e6fe585309371b6df12e78845881d3de/docs/assets/logo-light.svg" width="100%" style="max-width: 100%;">
</picture>
<<<<<<< Updated upstream
=======

>>>>>>> Stashed changes
<!-- BADGES -->
<div align="left">
Expand All @@ -16,20 +24,25 @@
<a href="https://app.codecov.io/gh/eli64s/pdflex">
<img src="https://img.shields.io/codecov/c/github/eli64s/pdflex?label=Coverage&style=flat&logo=codecov&logoColor=white&labelColor=2A2A2A&color=00F5FF" alt="Coverage" />
</a>
<!-- <a href="https://pypi.org/project/pdflex/">
<a href="https://pypi.org/project/pdflex/">
<img src="https://img.shields.io/pypi/v/pdflex?label=PyPI&style=flat&logo=pypi&logoColor=white&labelColor=2A2A2A&color=3d8be1" alt="PyPI Version" />
</a>
<a href="https://github.com/eli64s/pdflex">
<img src="https://img.shields.io/pypi/pyversions/pdflex?label=Python&style=flat&logo=python&logoColor=white&labelColor=2A2A2A&color=9b26d4" alt="Python Version" />
</a> -->
</a>
<a href="https://opensource.org/license/mit/">
<img src="https://img.shields.io/github/license/eli64s/pdflex?label=License&style=flat&logo=opensourceinitiative&logoColor=white&labelColor=2A2A2A&color=4B0082" alt="MIT License">
</a>
</p>
</div>

<<<<<<< Updated upstream
<div align="left">
<img src="https://raw.githubusercontent.com/eli64s/pdflex/d545ac98f5ad59ece892e638a7d3bdee593d8e88/docs/assets/line.svg" alt="thematic-break" width="100%" height="2px" style="margin: 20px 0;">
=======
<div align="center">
<img src="https://raw.githubusercontent.com/eli64s/pdflex/607d295f58914fc81a5b71fd994af90901b6433c/docs/assets/line.svg" alt="separator" width="100%" height="2px" style="margin: 20px 0;">
>>>>>>> Stashed changes
</div>
</div>
Expand Down Expand Up @@ -229,17 +242,22 @@ This project is built upon several awesome PDF open-source projects:

## License

PDFlex is released under the [MIT][mit-license] license.
PDFlex is released under the [MIT][mit-license] license. <br />
Copyright (c) 2020 to present [PDFlex][pdflex] and contributors.

<div align="left">
<a href="#top">
<img src="docs/assets/button.svg" width="100px" height="100px" alt="Return to Top">
<img src="https://raw.githubusercontent.com/eli64s/pdflex/607d295f58914fc81a5b71fd994af90901b6433c/docs/assets/button.svg" width="100px" height="100px" alt="Return to Top">
</a>
</div>

<<<<<<< Updated upstream
<div align="left">
<img src="https://raw.githubusercontent.com/eli64s/pdflex/d545ac98f5ad59ece892e638a7d3bdee593d8e88/docs/assets/line.svg" alt="thematic-break" width="100%" height="2px" style="margin: 20px 0;">
=======
<div align="center">
<img src="https://raw.githubusercontent.com/eli64s/pdflex/607d295f58914fc81a5b71fd994af90901b6433c/docs/assets/line.svg" alt="separator" width="100%" height="2px" style="margin: 20px 0;">
>>>>>>> Stashed changes
</div>
<!-- REFERENCE LINKS -->
Expand Down
50 changes: 50 additions & 0 deletions docs/assets/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/assets/logo-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added notebooks/.gitkeep
Empty file.
40 changes: 14 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pdflex"
version = "0.1.0"
version = "0.1.1"
description = "Python tools for PDF automation."
dynamic = ["readme"]
keywords = [
Expand Down Expand Up @@ -59,19 +59,12 @@ classifiers = [
"Natural Language :: English",
]
dependencies = [
"dacite",
"fitz",
"pdfplumber",
"pydantic-settings",
"pydantic",
"pymupdf",
"pypdf",
"pypdf2",
"pyyaml",
"reportlab",
"requests",
"rich",
"toml ; python_full_version < '3.11'",
]

optional-dependencies.docs = [
Expand All @@ -87,28 +80,23 @@ dev = [
"ipykernel",
]
test = [
"coverage[toml]>=7.6.9",
"pytest>=8.3.4",
"pytest-asyncio>=0.25",
"pytest-cov>=6",
"pytest-mock>=3.14.0",
"pytest-pretty>=1.2",
"pytest-randomly>=3.16",
"pytest-sugar>=1",
"pytest-xdist>=3.6.1",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"pytest-pretty",
"pytest-randomly",
"pytest-sugar",
"pytest-xdist",
]
docs = [
"mkdocs>=1.6.1",
"mkdocs-material>=9.5.47",
"mkdocs",
"mkdocs-material",
]
lint = [
"mypy>=1.14",
"pyright>=1.1.391",
"ruff>=0.8.4",
"types-aiofiles>=24.1.0.20241221",
"types-pyyaml>=6.0.12.20240917",
"types-requests>=2.32.0.20241016",
"types-toml>=0.10.8.20240310",
"mypy",
"pyright",
"ruff",
]

[tool.hatch.build]
Expand Down
2 changes: 1 addition & 1 deletion src/pdflex/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pathlib import Path
from typing import List

from PyPDF2 import PdfMerger
from pypdf import PdfMerger
from reportlab.lib.pagesizes import landscape as rl_landscape

# Import ReportLab modules to generate the separator page.
Expand Down
Loading

0 comments on commit 950ab9f

Please sign in to comment.