Skip to content

Commit 5e93203

Browse files
authored
Migrate to pyproject.toml (#302)
* migrate to `pyproject.toml` * `pytest` instead of `py.test` * run `black` * update build process in `pypi.yaml` (PEP518) * `pip install` before pre-commit check trying to see if this would resolve https://github.com/ArangoDB-Community/python-arango/actions/runs/6981788512/job/18999651142?pr=302 * revert 1f4d5f7 * add `args` to flake8 hook * bring back `setup.cfg` don't feel like fighting with https://github.com/ArangoDB-Community/python-arango/actions/runs/6981939895/job/19000084077?pr=302 * eof
1 parent 3ca9ead commit 5e93203

File tree

5 files changed

+81
-71
lines changed

5 files changed

+81
-71
lines changed

.github/workflows/pypi.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
- name: Install dependencies
3535
run: |
3636
python -m pip install --upgrade pip
37-
pip install setuptools wheel twine setuptools-scm[toml]
37+
pip install build twine
3838
3939
- name: Build distribution
40-
run: python setup.py sdist bdist_wheel
40+
run: python -m build
4141

4242
- name: Publish to PyPI Test
4343
env:

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pre-commit install # Install git pre-commit hooks
1010
Run unit tests with coverage:
1111

1212
```shell
13-
py.test --cov=arango --cov-report=html # Open htmlcov/index.html in your browser
13+
pytest --cov=arango --cov-report=html # Open htmlcov/index.html in your browser
1414
```
1515

1616
To start and ArangoDB instance locally, run:

arango/http.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(
100100
pool_connections: int = DEFAULT_POOLSIZE,
101101
pool_maxsize: int = DEFAULT_POOLSIZE,
102102
pool_timeout: Union[int, float, None] = None,
103-
**kwargs: Any
103+
**kwargs: Any,
104104
) -> None:
105105
self._connection_timeout = connection_timeout
106106
self._pool_timeout = pool_timeout

pyproject.toml

+75-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,81 @@
11
[build-system]
2-
requires = [
2+
requires = ["setuptools>=42", "wheel", "setuptools_scm"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
normalize = true
7+
8+
[project]
9+
name = "python-arango"
10+
description = "Python Driver for ArangoDB"
11+
authors = [ {name= "Joohwan Oh", email = "[email protected]" }]
12+
maintainers = [
13+
{name = "Joohwan Oh", email = "[email protected]"},
14+
{name = "Alexandru Petenchea", email = "[email protected]"},
15+
{name = "Anthony Mahanna", email = "[email protected]"}
16+
]
17+
keywords = ["arangodb", "python", "driver"]
18+
readme = "README.md"
19+
dynamic = ["version"]
20+
license = { file = "LICENSE" }
21+
requires-python = ">=3.8"
22+
23+
classifiers = [
24+
"Intended Audience :: Developers",
25+
"License :: OSI Approved :: MIT License",
26+
"Natural Language :: English",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Topic :: Documentation :: Sphinx",
35+
"Typing :: Typed",
36+
]
37+
38+
dependencies = [
39+
"urllib3>=1.26.0",
40+
"requests",
41+
"requests_toolbelt",
42+
"PyJWT",
343
"setuptools>=42",
4-
"setuptools_scm[toml]>=6.2",
5-
"wheel",
44+
"importlib_metadata>=4.7.1",
45+
"packaging>=23.1",
646
]
7-
build-backend = "setuptools.build_meta"
47+
48+
[project.optional-dependencies]
49+
dev = [
50+
"black>=22.3.0",
51+
"flake8>=4.0.1",
52+
"isort>=5.10.1",
53+
"mypy>=0.942",
54+
"mock",
55+
"pre-commit>=2.17.0",
56+
"pytest>=7.1.1",
57+
"pytest-cov>=3.0.0",
58+
"sphinx",
59+
"sphinx_rtd_theme",
60+
"types-pkg_resources",
61+
"types-requests",
62+
"types-setuptools",
63+
]
64+
65+
[tool.setuptools.package-data]
66+
"arango" = ["py.typed"]
67+
68+
[project.urls]
69+
homepage = "https://github.com/ArangoDB-Community/python-arango"
70+
71+
[tool.setuptools]
72+
packages = ["arango"]
73+
74+
75+
[tool.pytest.ini_options]
76+
addopts = "-s -vv -p no:warnings"
77+
minversion = "6.0"
78+
testpaths = ["tests"]
879

980
[tool.coverage.run]
1081
omit = [
@@ -16,16 +87,8 @@ omit = [
1687
[tool.isort]
1788
profile = "black"
1889

19-
[tool.pytest.ini_options]
20-
addopts = "-s -vv -p no:warnings"
21-
minversion = "6.0"
22-
testpaths = ["tests"]
23-
2490
[tool.mypy]
2591
warn_return_any = true
2692
warn_unused_configs = true
2793
ignore_missing_imports = true
2894
strict = true
29-
30-
[tool.setuptools_scm]
31-
write_to = "arango/version.py"

setup.py

+2-55
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,3 @@
1-
from setuptools import find_packages, setup
1+
from setuptools import setup
22

3-
with open("./README.md") as fp:
4-
long_description = fp.read()
5-
6-
setup(
7-
name="python-arango",
8-
description="Python Driver for ArangoDB",
9-
long_description=long_description,
10-
long_description_content_type="text/markdown",
11-
author="Joohwan Oh",
12-
author_email="[email protected]",
13-
url="https://github.com/ArangoDB-Community/python-arango",
14-
keywords=["arangodb", "python", "driver"],
15-
packages=find_packages(exclude=["tests"]),
16-
package_data={"arango": ["py.typed"]},
17-
include_package_data=True,
18-
python_requires=">=3.8",
19-
license="MIT",
20-
install_requires=[
21-
"urllib3>=1.26.0",
22-
"requests",
23-
"requests_toolbelt",
24-
"PyJWT",
25-
"setuptools>=42",
26-
"importlib_metadata>=4.7.1",
27-
"packaging>=23.1",
28-
],
29-
extras_require={
30-
"dev": [
31-
"black>=22.3.0",
32-
"flake8>=4.0.1",
33-
"isort>=5.10.1",
34-
"mypy>=0.942",
35-
"mock",
36-
"pre-commit>=2.17.0",
37-
"pytest>=7.1.1",
38-
"pytest-cov>=3.0.0",
39-
"sphinx",
40-
"sphinx_rtd_theme",
41-
"types-pkg_resources",
42-
"types-requests",
43-
"types-setuptools",
44-
],
45-
},
46-
classifiers=[
47-
"Intended Audience :: Developers",
48-
"License :: OSI Approved :: MIT License",
49-
"Natural Language :: English",
50-
"Operating System :: MacOS",
51-
"Operating System :: Microsoft :: Windows",
52-
"Operating System :: Unix",
53-
"Programming Language :: Python :: 3",
54-
"Topic :: Documentation :: Sphinx",
55-
],
56-
)
3+
setup()

0 commit comments

Comments
 (0)