Skip to content

Commit

Permalink
Move to PEP518 compliant packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Jul 17, 2024
1 parent ca74896 commit dfb1e0c
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 95 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.x, 3.11]
python-version: [3.8, 3.9, 3.10.x, 3.11, 3.12]
os: [ubuntu-latest]

steps:
Expand All @@ -25,8 +25,6 @@ jobs:
- name: Install testing dependencies
run: |
pip install -U wheel pip
pip install -U ".[test]"
- name: Lint with flake8
run: flake8
pip install --editable ".[test]"
- name: Test with pytest
run: pytest
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE.txt
include README.rst
include requirements.txt
recursive-include src/invoice2data/extract/templates/ *.yml
include README.md
# include requirements.txt
recursive-include src/invoice2data/extract/templates/ *.*
105 changes: 105 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
[build-system]
requires = ["setuptools >= 61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "invoice2data"
authors = [
{name = "Manuel Riel"},
]
description = "Python parser to extract data from pdf invoice"
version = "0.4.6"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["python", "data-mining", "accounting", "invoice", "pdf", "parcing"]
license = {text = "MIT"}
classifiers = [
"Framework :: Django",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"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 :: Office/Business :: Financial",
"Topic :: Office/Business :: Financial :: Accounting",
"Environment :: Console",
"Intended Audience :: Financial and Insurance Industry",
"Intended Audience :: Developers",
"Topic :: Office/Business :: Financial :: Accounting",
"Topic :: Office/Business :: Financial",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"poppler-utils",
"pyyaml",
"dateparser",
]
# dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/invoice-x/invoice2data"
"Bug Tracker" = "https://github.com/invoice-x/invoice2data/issues"


[project.optional-dependencies]
ocr = ["imagemagick", "ghostscript", "tesseract-ocr"]
pdfplumber = ["pdfplumber"]
pdfminer = ["pdfminer.six"]
ocrmypdf = ["ocrmypdf"]
test = ["pytest", "pytest-cov", "flake8", "pdfminer.six", "pdfplumber", "tox", "setuptools"]

[options.extras_require]
test = ["pytest", "pytest-cov", "flake8", "pdfminer.six", "pdfplumber", "tox"]

# pyproject.toml
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vs --cov invoice2data"
testpaths = [
"tests"
]

[tool.flake8]
ignore = ["E231", "E241", "E203"]
per-file-ignores = [
"__init__.py:F401",
]
exclude = [
"build", "dist", ".git", ".idea", ".cache", ".tox", ".eggs"
]
max-line-length = 120
count = true

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py38,py39,py310,py312,flake8
skip_missing_interpreters = True
[testenv]
deps = pytest >= 3.0.0, <4
commands = pytest
extras = test
[testenv:flake8]
commands=flake8 src tests
extras = test
"""

[project.entry-points."invoice2data"]
console_scripts = "invoice2data.main:main"

[tool.setuptools.dynamic]
readme = {file = ["README.md"]}

[tool.setuptools.packages.find]
where = ["src"]
include = ["invoice2data.extract.templates*"]
namespaces = false

[tool.setuptools.package-data]
mypkg = ["*.json", "*.yaml", "*.yml"]

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flake8
Flake8-pyproject
72 changes: 0 additions & 72 deletions setup.cfg

This file was deleted.

18 changes: 2 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
from setuptools import setup, find_packages
from setuptools import setup

setup(
include_package_data=True,
packages=find_packages('src'),
package_dir={'': 'src'},
license='MIT License',
package_data={
'invoice2data.extract': [
'templates/com/*.yml',
'templates/de/*.yml',
'templates/es/*.yml',
'templates/fr/*.yml',
'templates/nl/*.yml',
'templates/ch/*.yml'],
},
)
setup()

0 comments on commit dfb1e0c

Please sign in to comment.