Skip to content

Commit 9085f1e

Browse files
Fix issue #545: migrate to pyproject.toml (#547)
* enable editable mode via pyproject.toml * fix issue #545 migrate to pyproject.toml * fix license field and fix min python version * Remove version from apispec.yaml * remove gramps_webpi/_version.py from git cache --------- Co-authored-by: David Straub <[email protected]>
1 parent df1e6d2 commit 9085f1e

File tree

8 files changed

+78
-194
lines changed

8 files changed

+78
-194
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,6 @@ dmypy.json
144144

145145
# Pyre type checker
146146
.pyre/
147+
148+
# Generated by setuptools_scm, should be ignored by VCS
149+
gramps_webapi/_version.py

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-isort
3-
rev: v5.4.2
3+
rev: v5.10.1
44
hooks:
55
- id: isort
66
args: ["--profile", "black"]
77
- repo: https://github.com/psf/black
8-
rev: 22.8.0
8+
rev: 24.8.0
99
hooks:
1010
- id: black
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v0.782
12+
rev: v1.11.2
1313
hooks:
1414
- id: mypy
1515
args: [--ignore-missing-imports]
1616
- repo: https://github.com/PyCQA/pylint
17-
rev: pylint-2.5.3
17+
rev: v3.2.7
1818
hooks:
1919
- id: pylint
2020
stages: [commit]
2121
args:
2222
- --score=n
2323
- repo: https://github.com/PyCQA/pydocstyle
24-
rev: 5.0.2
24+
rev: 6.3.0
2525
hooks:
2626
- id: pydocstyle
2727
stages: [commit]

.pylintrc

Lines changed: 4 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ suggestion-mode=yes
4444
# active Python interpreter and may run arbitrary code.
4545
unsafe-load-any-extension=no
4646

47-
4847
[MESSAGES CONTROL]
4948

5049
# Only show warnings with the listed confidence levels. Leave empty to show
@@ -60,87 +59,14 @@ confidence=
6059
# --enable=similarities". If you want to run only the classes checker, but have
6160
# no Warning level messages displayed, use "--disable=all --enable=classes
6261
# --disable=W".
63-
disable=print-statement,
64-
parameter-unpacking,
65-
unpacking-in-except,
66-
old-raise-syntax,
67-
backtick,
68-
long-suffix,
69-
old-ne-operator,
70-
old-octal-literal,
71-
import-star-module-level,
72-
non-ascii-bytes-literal,
73-
raw-checker-failed,
62+
disable=raw-checker-failed,
7463
bad-inline-option,
7564
locally-disabled,
7665
file-ignored,
7766
suppressed-message,
7867
useless-suppression,
7968
deprecated-pragma,
80-
use-symbolic-message-instead,
81-
apply-builtin,
82-
basestring-builtin,
83-
buffer-builtin,
84-
cmp-builtin,
85-
coerce-builtin,
86-
execfile-builtin,
87-
file-builtin,
88-
long-builtin,
89-
raw_input-builtin,
90-
reduce-builtin,
91-
standarderror-builtin,
92-
unicode-builtin,
93-
xrange-builtin,
94-
coerce-method,
95-
delslice-method,
96-
getslice-method,
97-
setslice-method,
98-
no-absolute-import,
99-
old-division,
100-
dict-iter-method,
101-
dict-view-method,
102-
next-method-called,
103-
metaclass-assignment,
104-
indexing-exception,
105-
raising-string,
106-
reload-builtin,
107-
oct-method,
108-
hex-method,
109-
nonzero-method,
110-
cmp-method,
111-
input-builtin,
112-
round-builtin,
113-
intern-builtin,
114-
unichr-builtin,
115-
map-builtin-not-iterating,
116-
zip-builtin-not-iterating,
117-
range-builtin-not-iterating,
118-
filter-builtin-not-iterating,
119-
using-cmp-argument,
120-
eq-without-hash,
121-
div-method,
122-
idiv-method,
123-
rdiv-method,
124-
exception-message-attribute,
125-
invalid-str-codec,
126-
sys-max-int,
127-
bad-python3-import,
128-
deprecated-string-function,
129-
deprecated-str-translate-call,
130-
deprecated-itertools-function,
131-
deprecated-types-field,
132-
next-method-defined,
133-
dict-items-not-iterating,
134-
dict-keys-not-iterating,
135-
dict-values-not-iterating,
136-
deprecated-operator-function,
137-
deprecated-urllib-function,
138-
xreadlines-attribute,
139-
deprecated-sys-function,
140-
exception-escape,
141-
comprehension-escape,
142-
bad-whitespace,
143-
bad-continuation
69+
use-symbolic-message-instead
14470

14571
# Enable the message, report, category or checker with the given id(s). You can
14672
# either give multiple identifier separated by comma (,) or put this option
@@ -588,5 +514,5 @@ valid-metaclass-classmethod-first-arg=cls
588514

589515
# Exceptions that will emit a warning when being caught. Defaults to
590516
# "BaseException, Exception".
591-
overgeneral-exceptions=BaseException,
592-
Exception
517+
overgeneral-exceptions=builtins.BaseException,
518+
builtins.Exception

gramps_webapi/_version.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

gramps_webapi/data/apispec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ info:
88
99
1010
* More about Gramps and the numerous features it provides for genealogists can be found at https://gramps-project.org
11-
version: "2.4.2" # make sure to match this version with the one in _version.py
1211
license:
1312
name: "GNU Affero General Public License v3.0"
1413
url: "http://www.gnu.org/licenses/agpl-3.0.html"

pyproject.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[project]
2+
name = "gramps-webapi"
3+
description = "A RESTful web API for the Gramps genealogical database."
4+
authors = [
5+
{ name = "Gramps Development Team" },
6+
{ name = "David M. Straub", email = "[email protected]" }
7+
]
8+
license = { text = "AGPL-3.0-or-later" }
9+
readme = "README.md"
10+
dynamic = ["version"]
11+
keywords = ["RESTful", "web API", "genealogy", "Gramps"]
12+
classifiers = [
13+
"Programming Language :: Python :: 3",
14+
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
15+
"Operating System :: OS Independent",
16+
]
17+
requires-python = ">=3.8"
18+
dependencies = [
19+
"gramps-desktop[GUI,i18n]==5.2.*",
20+
"Click>=7.0",
21+
"Flask>=2.1.0",
22+
"Flask-Caching>=2.0.0",
23+
"Flask-Compress",
24+
"Flask-Cors",
25+
"Flask-JWT-Extended>=4.2.1,!=4.4.0,!=4.4.1",
26+
"Flask-Limiter>=2.9.0",
27+
"Flask-SQLAlchemy",
28+
"marshmallow>=3.13.0",
29+
"webargs",
30+
"SQLAlchemy",
31+
"pdf2image",
32+
"Pillow",
33+
"bleach[css]>=5.0.0",
34+
"jsonschema",
35+
"ffmpeg-python",
36+
"boto3",
37+
"alembic",
38+
"celery[redis]",
39+
"Unidecode",
40+
"pytesseract",
41+
"gramps-ql>=0.3.0",
42+
"sifts>=0.8.3",
43+
]
44+
45+
[project.urls]
46+
homepage = "https://github.com/gramps-project/gramps-web-api"
47+
repository = "https://github.com/gramps-project/gramps-web-api"
48+
49+
50+
[build-system]
51+
requires = ["setuptools>=64.0", "setuptools_scm[toml]>=6.2", "wheel"]
52+
build-backend = "setuptools.build_meta"
53+
54+
[tool.isort]
55+
profile = "black"
56+
57+
[tool.setuptools_scm]
58+
# NOTE: Using a version file avoids some overhead
59+
#
60+
# This file is explicitly ignored by version control.
61+
write_to = "gramps_webapi/_version.py"
62+
63+
[tool.setuptools.packages.find]
64+
include = ["gramps_webapi", "gramps_webapi.*"]

setup.py

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,54 +19,6 @@
1919

2020
"""The setup script."""
2121

22-
from setuptools import find_packages, setup
22+
from setuptools import setup # pylint: disable=E0401
2323

24-
with open("README.md") as readme_file:
25-
README = readme_file.read()
26-
27-
with open("gramps_webapi/_version.py") as version_file:
28-
exec(version_file.read())
29-
30-
31-
REQUIREMENTS = [
32-
"gramps-desktop[GUI,i18n]==5.2.*",
33-
"Click>=7.0",
34-
"Flask>=2.1.0",
35-
"Flask-Caching>=2.0.0",
36-
"Flask-Compress",
37-
"Flask-Cors",
38-
"Flask-JWT-Extended>=4.2.1, !=4.4.0, !=4.4.1",
39-
"Flask-Limiter>=2.9.0",
40-
"Flask-SQLAlchemy",
41-
"marshmallow>=3.13.0",
42-
"webargs",
43-
"SQLAlchemy",
44-
"pdf2image",
45-
"Pillow",
46-
"bleach[css]>=5.0.0",
47-
"jsonschema",
48-
"ffmpeg-python",
49-
"boto3",
50-
"alembic",
51-
"celery[redis]",
52-
"Unidecode",
53-
"pytesseract",
54-
"gramps-ql>=0.3.0",
55-
"sifts>=0.8.3",
56-
]
57-
58-
setup(
59-
author="Gramps Development Team",
60-
url="https://github.com/gramps-project/web-api",
61-
python_requires=">=3.8",
62-
description="A RESTful web API for the Gramps genealogical database.",
63-
license="AGPL v3 or greater",
64-
install_requires=REQUIREMENTS,
65-
long_description=README,
66-
long_description_content_type="text/markdown",
67-
include_package_data=True,
68-
name="gramps-webapi",
69-
packages=find_packages(include=["gramps_webapi", "gramps_webapi.*"]),
70-
version=__version__,
71-
zip_safe=False,
72-
)
24+
setup()

tests/test_version.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)