Skip to content

Commit

Permalink
Migrate to pyproject.toml (#302)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aMahanna authored Dec 1, 2023
1 parent 3ca9ead commit 5e93203
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine setuptools-scm[toml]
pip install build twine
- name: Build distribution
run: python setup.py sdist bdist_wheel
run: python -m build

- name: Publish to PyPI Test
env:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pre-commit install # Install git pre-commit hooks
Run unit tests with coverage:

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

To start and ArangoDB instance locally, run:
Expand Down
2 changes: 1 addition & 1 deletion arango/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __init__(
pool_connections: int = DEFAULT_POOLSIZE,
pool_maxsize: int = DEFAULT_POOLSIZE,
pool_timeout: Union[int, float, None] = None,
**kwargs: Any
**kwargs: Any,
) -> None:
self._connection_timeout = connection_timeout
self._pool_timeout = pool_timeout
Expand Down
87 changes: 75 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,81 @@
[build-system]
requires = [
requires = ["setuptools>=42", "wheel", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
normalize = true

[project]
name = "python-arango"
description = "Python Driver for ArangoDB"
authors = [ {name= "Joohwan Oh", email = "[email protected]" }]
maintainers = [
{name = "Joohwan Oh", email = "[email protected]"},
{name = "Alexandru Petenchea", email = "[email protected]"},
{name = "Anthony Mahanna", email = "[email protected]"}
]
keywords = ["arangodb", "python", "driver"]
readme = "README.md"
dynamic = ["version"]
license = { file = "LICENSE" }
requires-python = ">=3.8"

classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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 :: Documentation :: Sphinx",
"Typing :: Typed",
]

dependencies = [
"urllib3>=1.26.0",
"requests",
"requests_toolbelt",
"PyJWT",
"setuptools>=42",
"setuptools_scm[toml]>=6.2",
"wheel",
"importlib_metadata>=4.7.1",
"packaging>=23.1",
]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
dev = [
"black>=22.3.0",
"flake8>=4.0.1",
"isort>=5.10.1",
"mypy>=0.942",
"mock",
"pre-commit>=2.17.0",
"pytest>=7.1.1",
"pytest-cov>=3.0.0",
"sphinx",
"sphinx_rtd_theme",
"types-pkg_resources",
"types-requests",
"types-setuptools",
]

[tool.setuptools.package-data]
"arango" = ["py.typed"]

[project.urls]
homepage = "https://github.com/ArangoDB-Community/python-arango"

[tool.setuptools]
packages = ["arango"]


[tool.pytest.ini_options]
addopts = "-s -vv -p no:warnings"
minversion = "6.0"
testpaths = ["tests"]

[tool.coverage.run]
omit = [
Expand All @@ -16,16 +87,8 @@ omit = [
[tool.isort]
profile = "black"

[tool.pytest.ini_options]
addopts = "-s -vv -p no:warnings"
minversion = "6.0"
testpaths = ["tests"]

[tool.mypy]
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
strict = true

[tool.setuptools_scm]
write_to = "arango/version.py"
57 changes: 2 additions & 55 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,3 @@
from setuptools import find_packages, setup
from setuptools import setup

with open("./README.md") as fp:
long_description = fp.read()

setup(
name="python-arango",
description="Python Driver for ArangoDB",
long_description=long_description,
long_description_content_type="text/markdown",
author="Joohwan Oh",
author_email="[email protected]",
url="https://github.com/ArangoDB-Community/python-arango",
keywords=["arangodb", "python", "driver"],
packages=find_packages(exclude=["tests"]),
package_data={"arango": ["py.typed"]},
include_package_data=True,
python_requires=">=3.8",
license="MIT",
install_requires=[
"urllib3>=1.26.0",
"requests",
"requests_toolbelt",
"PyJWT",
"setuptools>=42",
"importlib_metadata>=4.7.1",
"packaging>=23.1",
],
extras_require={
"dev": [
"black>=22.3.0",
"flake8>=4.0.1",
"isort>=5.10.1",
"mypy>=0.942",
"mock",
"pre-commit>=2.17.0",
"pytest>=7.1.1",
"pytest-cov>=3.0.0",
"sphinx",
"sphinx_rtd_theme",
"types-pkg_resources",
"types-requests",
"types-setuptools",
],
},
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Programming Language :: Python :: 3",
"Topic :: Documentation :: Sphinx",
],
)
setup()

0 comments on commit 5e93203

Please sign in to comment.