Skip to content
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
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: tox

on:
release:
types:
- published

jobs:
publish:
name: Publish to PyPI registry
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pdfss
permissions:
id-token: write
steps:
- name: Switch to using Python 3.11 by default
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install build
run: python3 -m pip install --user build
- name: Check out src from Git
uses: actions/checkout@v2
- name: Build dists
run: python3 -m build
- name: Publish to pypi.org
uses: pypa/gh-action-pypi-publish@release/v1
140 changes: 31 additions & 109 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: tox

on:
create:
tags:
- "**"
push:
branches:
- "main"
- "main"
pull_request:
release:
types:
- published
schedule:
- cron: 0 0 1 * * # every month
- cron: 0 0 1 * * # every month

jobs:
build:
Expand All @@ -22,106 +16,34 @@ jobs:
fail-fast: false
matrix:
include:
- tox_env: check-manifest
- tox_env: lint
- tox_env: py39
- tox_env: py310
- tox_env: py311
- tox_env: lint
- tox_env: py39
- tox_env: py310
- tox_env: py311

steps:
- uses: actions/checkout@v2
- name: Find python version
id: py_ver
shell: python
if: ${{ contains(matrix.tox_env, 'py') }}
run: |
v = '${{ matrix.tox_env }}'.split('-')[0].lstrip('py')
print('::set-output name=version::{}.{}'.format(v[0],v[1:]))
- name: Install a default Python
uses: actions/setup-python@v2
if: ${{ ! contains(matrix.tox_env, 'py') }}
with:
python-version: 3.11
- name: Set up Python version
uses: actions/setup-python@v2
if: ${{ contains(matrix.tox_env, 'py') }}
with:
python-version: ${{ steps.py_ver.outputs.version }}
- name: Install tox
run: |
pip install tox
- name: Run tox -e ${{ matrix.tox_env }}
run: |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}

publish:
name: Publish to PyPI registry
needs:
- build
runs-on: ubuntu-latest

env:
PY_COLORS: 1

steps:
- name: Switch to using Python 3.11 by default
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install build
run: python3 -m pip install --user build
- name: Check out src from Git
uses: actions/checkout@v2
with:
# Get shallow Git history (default) for release events
# but have a complete clone for any other workflows.
# Both options fetch tags but since we're going to remove
# one from HEAD in non-create-tag workflows, we need full
# history for them.
fetch-depth: >-
${{
(
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
) ||
github.event_name == 'release'
) &&
1 || 0
}}
- name: Drop Git tags from HEAD for non-tag-create and non-release events
if: >-
(
github.event_name != 'create' ||
github.event.ref_type != 'tag'
) &&
github.event_name != 'release'
run: >-
git tag --points-at HEAD
|
xargs git tag --delete
- name: Build dists
run: python3 -m build
- name: Publish to test.pypi.org
if: >-
(
github.event_name == 'push' &&
github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
) ||
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
)
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
- uses: actions/checkout@v2
- name: Find python version
id: py_ver
shell: python
if: ${{ contains(matrix.tox_env, 'py') }}
run: |
v = '${{ matrix.tox_env }}'.split('-')[0].lstrip('py')
print('::set-output name=version::{0}.{1}'.format(v[0],v[1:]))
- name: Install a default Python
uses: actions/setup-python@v2
if: ${{ ! contains(matrix.tox_env, 'py') }}
with:
python-version: 3.11
- name: Set up Python version
uses: actions/setup-python@v2
if: ${{ contains(matrix.tox_env, 'py') }}
with:
python-version: ${{ steps.py_ver.outputs.version }}
- name: Install tox
run: |
pip install tox
- name: Run tox -e ${{ matrix.tox_env }}
run: |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
#
# Should more or less follow lint and typing settings as found is tox.ini
#
# Once pre-commit package is installed in your environnement, install hooks
# with `pre-commit install`
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: local
hooks:
- id: ruff-check
name: ruff-check
entry: ruff check
language: system
types: [python]
- id: ruff-format
name: ruff
entry: ruff format --check --diff
language: system
types: [python]
1 change: 0 additions & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,3 @@ The hypothetical commands `show w' and `show c' should show the appropriate part
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

5 changes: 4 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[mypy]
files = pdfss
files = .
exclude = test/data
show_error_codes = true
warn_unused_ignores = true
strict = true

[mypy-pdfminer.*]
ignore_missing_imports = True
Loading
Loading