setup: Switch to PEP 517 build system.

This commit is contained in:
Brett Smith 2021-03-31 16:42:29 -04:00
parent 789992afa1
commit 6109187286
5 changed files with 84 additions and 75 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
build/
.cache/
dist/
*.egg
*.egg-info/
.eggs

View file

@ -24,18 +24,18 @@ Running unit tests
Run::
./setup.py test
pytest
Type checking
-------------
Most of the code is typed, except for very dynamic loader methods. To run the type checker::
./setup.py typecheck
mypy conservancy_beancount
This is expected to pass just like the unit tests.
Legal
-----
Copyright © 2020, 2021 Brett Smith and others. Licensed under the GNU Affero General Public License, either version 3 of the License, or (at your option) any later version; with an additional permission. Refer to ``LICENSE.txt`` for details.
Refer to ``LICENSE.txt`` for details.

3
pyproject.toml Normal file
View file

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"

View file

@ -1,6 +1,21 @@
[aliases]
test=pytest
typecheck=pytest --addopts="--mypy conservancy_beancount"
[metadata]
name = conservancy_beancount
version = 1.19.7
author = Software Freedom Conservancy
author_email = info@sfconservancy.org
description = Plugin, library, and reports for reading Conservancys books
license = AGPLv3-or-later WITH Beancount-Plugin-Additional-Permission-1.0
license_files =
LICENSE.txt
AGPLv3.txt
long_description = file: README.rst
long_description_content_type = text/x-rst; charset=UTF-8
project_urls =
Source = %(url)s
url = https://k.sfconservancy.org/NPO-Accounting/conservancy_beancount
[bdist_wheel]
universal = 1
[mypy]
disallow_any_unimported = False
@ -13,18 +28,64 @@ warn_return_any = True
warn_unreachable = True
warn_unused_configs = True
[options]
include_package_data = True
install_requires =
babel>=2.6
beancount>=2.2
GitPython>=2.0
odfpy>=1.4.0,!=1.4.1
pdfminer.six>=20200101
python-dateutil>=2.7
PyYAML>=3.0
regex
rt>=2.0
packages = find:
python_requires = >=3.6
[options.entry_points]
console_scripts =
accrual-report = conservancy_beancount.reports.accrual:entry_point
assemble-audit-reports = conservancy_beancount.tools.audit_report:entry_point
balance-sheet-report = conservancy_beancount.reports.balance_sheet:entry_point
budget-report = conservancy_beancount.reports.budget:entry_point
bean-sort = conservancy_beancount.tools.sort_entries:entry_point
extract-odf-links = conservancy_beancount.tools.extract_odf_links:entry_point
fund-report = conservancy_beancount.reports.fund:entry_point
ledger-report = conservancy_beancount.reports.ledger:entry_point
opening-balances = conservancy_beancount.tools.opening_balances:entry_point
pdfform-extract = conservancy_beancount.pdfforms.extract:entry_point
pdfform-extract-irs990scheduleA = conservancy_beancount.pdfforms.extract.irs990scheduleA:entry_point
pdfform-fill = conservancy_beancount.pdfforms.fill:entry_point
query-report = conservancy_beancount.reports.query:entry_point
reconcile-paypal = conservancy_beancount.reconcile.paypal:entry_point
reconcile-statement = conservancy_beancount.reconcile.statement:entry_point
split-ods-links = conservancy_beancount.tools.split_ods_links:entry_point
[options.package_data]
* = py.typed
[options.packages.find]
exclude =
tests
[testenv]
deps =
mypy>=0.770
pytest>=3.0
pytest-mypy
# Beancount includes type declarations but not the `py.typed` flag file mypy
# is looking for to know that. Create it ourselves.
commands_pre = python -c 'import beancount, pathlib; pathlib.Path(beancount.__file__).with_name("py.typed").touch()'
commands =
pytest
pytest --mypy conservancy_beancount
[tool:pytest]
filterwarnings =
ignore::DeprecationWarning:^socks$
[tox:tox]
envlist = py36,py37
[testenv]
# Beancount includes type declarations but not the `py.typed` flag file mypy
# is looking for to know that. Create it ourselves.
commands_pre = python -c 'import beancount, pathlib; pathlib.Path(beancount.__file__).with_name("py.typed").touch()'
commands =
./setup.py test
./setup.py typecheck

View file

@ -1,63 +1,7 @@
#!/usr/bin/env python3
"""setup.py - setuptools compatibility shim"""
from setuptools import setup
import setuptools
setup(
name='conservancy_beancount',
description="Plugin, library, and reports for reading Conservancy's books",
version='1.19.6',
author='Software Freedom Conservancy',
author_email='info@sfconservancy.org',
license='GNU AGPLv3+',
install_requires=[
'babel>=2.6', # Debian:python3-babel
'beancount>=2.2', # Debian:beancount
'GitPython>=2.0', # Debian:python3-git
# 1.4.1 crashes when trying to save some documents.
'odfpy>=1.4.0,!=1.4.1', # Debian:python3-odf
'pdfminer.six>=20200101',
'python-dateutil>=2.7', # Debian:python3-dateutil
'PyYAML>=3.0', # Debian:python3-yaml
'regex', # Debian:python3-regex
'rt>=2.0',
],
setup_requires=[
'pytest-mypy',
'pytest-runner', # Debian:python3-pytest-runner
],
tests_require=[
'mypy>=0.770', # Debian:python3-mypy
'pytest', # Debian:python3-pytest
],
packages=[
'conservancy_beancount',
'conservancy_beancount.pdfforms',
'conservancy_beancount.pdfforms.extract',
'conservancy_beancount.plugin',
'conservancy_beancount.reconcile',
'conservancy_beancount.reports',
'conservancy_beancount.tools',
],
entry_points={
'console_scripts': [
'accrual-report = conservancy_beancount.reports.accrual:entry_point',
'assemble-audit-reports = conservancy_beancount.tools.audit_report:entry_point',
'balance-sheet-report = conservancy_beancount.reports.balance_sheet:entry_point',
'budget-report = conservancy_beancount.reports.budget:entry_point',
'bean-sort = conservancy_beancount.tools.sort_entries:entry_point',
'extract-odf-links = conservancy_beancount.tools.extract_odf_links:entry_point',
'fund-report = conservancy_beancount.reports.fund:entry_point',
'ledger-report = conservancy_beancount.reports.ledger:entry_point',
'opening-balances = conservancy_beancount.tools.opening_balances:entry_point',
'pdfform-extract = conservancy_beancount.pdfforms.extract:entry_point',
'pdfform-extract-irs990scheduleA = conservancy_beancount.pdfforms.extract.irs990scheduleA:entry_point',
'pdfform-fill = conservancy_beancount.pdfforms.fill:entry_point',
'query-report = conservancy_beancount.reports.query:entry_point',
'reconcile-paypal = conservancy_beancount.reconcile.paypal:entry_point',
'reconcile-statement = conservancy_beancount.reconcile.statement:entry_point',
'split-ods-links = conservancy_beancount.tools.split_ods_links:entry_point',
],
},
)
if __name__ == "__main__":
setuptools.setup()