From 558a2b02678d4d40a3c713309aaeaf031b1c5070 Mon Sep 17 00:00:00 2001 From: Marco Heinemann Date: Tue, 23 Jan 2024 21:41:34 +0100 Subject: [PATCH] Preparation for 0.1.0 (#33) * Preparation for 0.1.0 (changelog, version bump) * Updated contribution * oidc auth for pypi * Fix comments and ruff violations --- .github/dependabot.yml | 6 ++++++ .github/workflows/publish.yml | 9 ++++----- .readthedocs.yml | 2 +- docs/contents/changelog.rst | 9 ++++----- docs/contents/contribution.rst | 13 ++++--------- libpdf/__init__.py | 12 +++++------- libpdf/core.py | 3 +-- pyproject.toml | 2 +- 8 files changed, 26 insertions(+), 30 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1230149 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ce7a31..015c097 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,14 +10,16 @@ on: jobs: build-n-publish: runs-on: ubuntu-latest + permissions: + id-token: write steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.11 - name: Install poetry run: | @@ -30,6 +32,3 @@ jobs: - name: Publish package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.readthedocs.yml b/.readthedocs.yml index afed517..4ba854a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,7 +4,7 @@ sphinx: configuration: docs/conf.py python: - version: 3.8 + version: 3.11 install: - method: pip path: . diff --git a/docs/contents/changelog.rst b/docs/contents/changelog.rst index 0d19565..cec756c 100644 --- a/docs/contents/changelog.rst +++ b/docs/contents/changelog.rst @@ -6,16 +6,15 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_, and this project adheres to `Semantic Versioning `_. -__ https://github.com/useblocks/libpdf/compare/v0.0.1...HEAD +__ https://github.com/useblocks/libpdf/compare/v0.1.0...HEAD `Unreleased`__ -------------- -.. - __ https://github.com/useblocks/libpdf/compare/v0.0.1...v0.0.2 +__ https://github.com/useblocks/libpdf/compare/v0.0.1...v0.1.0 - `0.0.2`__ - 2020-09-30 - ---------------------- +`0.1.0`__ - 2024-01-23 +---------------------- Added ~~~~~ diff --git a/docs/contents/contribution.rst b/docs/contents/contribution.rst index 8a8f38f..9b4be12 100644 --- a/docs/contents/contribution.rst +++ b/docs/contents/contribution.rst @@ -15,16 +15,11 @@ Small changes like fixing a typo, contributing to the documentation commonly don Here are some things worth noting before uploading commits: * all code must follow the `black `_ code style -* black is configured to - - * a maximum line length of 120 chars and - * single quote string literals - +* ruff is used for formatting according to the black style with all defaults * pull requests are checked using tox * tox executes (for various Python versions) - * pytest - * flake8 with various plugins (see pyproject.toml) - * pylint - * black + * test cases + * ruff formatter check + * ruff linter check * the Sphinx documentation build diff --git a/libpdf/__init__.py b/libpdf/__init__.py index 6442077..1eb1a7d 100644 --- a/libpdf/__init__.py +++ b/libpdf/__init__.py @@ -8,17 +8,15 @@ :copyright: © 2020 by team useblocks :license: MIT, see LICENSE for more details -""" # needed for autodoc -try: - import importlib_metadata # Python 3.6 and 3.7 -except ImportError: - import importlib.metadata as importlib_metadata # Python 3.8, 3.9 +""" # noqa: D205, D400, D415 # needed for autodoc + +import importlib.metadata as importlib_metadata __version__: str = importlib_metadata.version("libpdf") __summary__: str = importlib_metadata.metadata("libpdf")["Summary"] -# below imports from libpdf.core cannot be at the top avoid circular import errors in core.py when -# importing __version__ and __summary__ +# below imports from libpdf.core cannot be at the top avoid circular import errors in +# core.py when importing __version__ and __summary__ import libpdf._import_forks # noqa: F401 from libpdf.core import main_api as load from libpdf.core import main_cli diff --git a/libpdf/core.py b/libpdf/core.py index fc7bac9..21a9c82 100644 --- a/libpdf/core.py +++ b/libpdf/core.py @@ -474,8 +474,7 @@ def handle_parse_result(self, ctx, opts, args): "--no-rects", is_flag=True, show_default=True, - help="Skip rects. rects will not be part of the output JSON/YAML structures and also not saved if" - " --save-rects is given.", + help="Skip rectangles. Rectangles will not be part of the output JSON/YAML structures.", ) @click.option("-vd", "--visual-debug", is_flag=True, help="Visual debug libpdf.") @click.option( diff --git a/pyproject.toml b/pyproject.toml index 899746d..d810eeb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "libpdf" -version = "0.0.1" +version = "0.1.0" description = "Extract structured data from PDFs." authors = [ "Marco Heinemann ",