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

Switch to pyproject.toml (using hatchling) #1028

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: python -m pip install wheel
- name: Install Hatch
uses: pypa/hatch@install
- name: Build package
run: python setup.py sdist bdist_wheel
run: hatch build
- name: Generate changelog
run: sed '1,/## \[/d;/## \[/Q' CHANGELOG.md > ${{ github.workspace }}-CHANGELOG.md
- name: Publish package to PyPi
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `RecursionError` when corrupt PDF specifies a recursive /Pages object ([#998](https://github.com/pdfminer/pdfminer.six/pull/998))
- `TypeError` when corrupt PDF specifies text-positioning operators with invalid values ([#1000](https://github.com/pdfminer/pdfminer.six/pull/1000))
- inline image parsing fails when stream data contains "EI\n" ([#1008](https://github.com/pdfminer/pdfminer.six/issues/1008))
- Using `pyproject.toml` instead of `setup.py` ([#931](https://github.com/pdfminer/pdfminer.six/issues/931))

### Removed

Expand Down
36 changes: 0 additions & 36 deletions mypy.ini

This file was deleted.

4 changes: 1 addition & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import nox

PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
PYTHON_MODULES = ["fuzzing", "pdfminer", "tools", "tests", "noxfile.py", "setup.py"]
PYTHON_MODULES = ["fuzzing", "pdfminer", "tools", "tests", "noxfile.py"]


@nox.session
Expand Down Expand Up @@ -33,15 +33,13 @@ def types(session):
@nox.session(python=PYTHON_ALL_VERSIONS)
def tests(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[dev]")
session.run("pytest")


@nox.session
def docs(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[docs]")
session.run(
"python",
Expand Down
126 changes: 126 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "pdfminer.six"
dynamic = ["version"]
description = "PDF parser and analyzer"
readme = "README.md"
license = "MIT"
requires-python = ">=3.8"
authors = [
{ name = "Yusuke Shinyama + Philippe Guglielmetti", email = "[email protected]" },
]
keywords = [
"layout analysis",
"pdf converter",
"pdf parser",
"text mining",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Text Processing",
]
dependencies = [
"charset-normalizer >= 2.0.0",
"cryptography >= 36.0.0",
]

[project.optional-dependencies]
dev = [
"atheris; python_version < '3.12'",
"black",
"mypy == 0.931",
"nox",
"pytest",
]
docs = [
"sphinx",
"sphinx-argparse",
]
image = [
"Pillow",
]

[project.scripts]
"pdf2txt.py" = "tools.pdf2txt:main"
"dumppdf.py" = "tools.dumppdf:main"

[project.urls]
Homepage = "https://github.com/pdfminer/pdfminer.six"

[tool.hatch.version]
source = "vcs"
tag-pattern = '(\d\d\d\d\d\d\d\d)'

[tool.hatch.build.targets.wheel]
packages = ["pdfminer"]

[tool.ruff]
namespace-packages = ["pdfminer"]

[tool.ruff.lint]
extend-select = [
"W", # pycodestyle warnings
"I", # isort
"TID" # flake8 tidy imports
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.mypy]
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_return_any = true
no_implicit_reexport = true
strict_equality = true

# This seems impossible to turn on in a version-independent manner
warn_unused_ignores = false

[[tool.mypy.overrides]]
module = "pdfminer.*"
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = "cryptography.hazmat.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "setuptools.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "nox.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "charset_normalizer.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "atheris.*"
ignore_missing_imports = true
11 changes: 0 additions & 11 deletions ruff.toml

This file was deleted.

66 changes: 0 additions & 66 deletions setup.py

This file was deleted.

Loading