Skip to content

Commit 2d6c4f9

Browse files
committed
Initial setup
1 parent f43d43d commit 2d6c4f9

File tree

11 files changed

+238
-1
lines changed

11 files changed

+238
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,4 @@ cython_debug/
157157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
160+
.idea/

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
# See https://pre-commit.com/hooks.html
5+
hooks:
6+
- id: check-case-conflict
7+
- id: check-executables-have-shebangs
8+
- id: check-merge-conflict
9+
- id: check-symlinks
10+
- id: check-toml
11+
- id: check-xml
12+
- id: check-yaml
13+
- id: debug-statements
14+
- id: detect-private-key
15+
- id: end-of-file-fixer
16+
- id: mixed-line-ending
17+
- id: pretty-format-json
18+
- id: trailing-whitespace
19+
20+
- repo: https://github.com/psf/black
21+
rev: 23.1.0
22+
hooks:
23+
- id: black
24+
25+
- repo: https://github.com/PyCQA/isort
26+
rev: 5.12.0
27+
hooks:
28+
- id: isort
29+
args: [ --profile, black ]
30+
31+
- repo: https://github.com/PyCQA/flake8
32+
rev: 6.0.0
33+
hooks:
34+
- id: flake8
35+
36+
- repo: https://github.com/pre-commit/mirrors-mypy
37+
rev: v0.991
38+
hooks:
39+
- id: mypy
40+
files: ^arangoasync/
41+
additional_dependencies: ['types-requests', "types-setuptools"]

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributing
2+
3+
Set up dev environment:
4+
```shell
5+
cd ~/your/repository/fork # Activate venv if you have one (recommended)
6+
pip install -e .[dev] # Install dev dependencies (e.g. black, mypy, pre-commit)
7+
pre-commit install # Install git pre-commit hooks
8+
```
9+
10+
Run unit tests with coverage:
11+
12+
```shell
13+
pytest --cov=arango --cov-report=html # Open htmlcov/index.html in your browser
14+
```
15+
16+
To start and ArangoDB instance locally, run:
17+
18+
```shell
19+
./starter.sh # Requires docker
20+
```
21+
22+
Build and test documentation:
23+
24+
```shell
25+
python -m sphinx docs docs/_build # Open docs/_build/index.html in your browser
26+
```
27+
28+
Thank you for your contribution!

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# python-arango-async
2+
3+
Python driver for [ArangoDB](https://www.arangodb.com), a scalable multi-model
4+
database natively supporting documents, graphs and search.
5+
6+
This is the _asyncio_ alternative of the officially supported [python-arango](https://github.com/arangodb/python-arango)
7+
driver.
8+
9+
**Note**: This driver is still in development and not yet ready for production use.
10+
11+
## Requirements
12+
13+
- ArangoDB version 3.10+
14+
- Python version 3.9+

arangoasync/__init__.py

Whitespace-only changes.

docs/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
project = "python-arango-async"

pyproject.toml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
[build-system]
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-async"
10+
description = "Async Python Driver for ArangoDB"
11+
authors = [
12+
{name= "Alexandru Petenchea", email = "[email protected]" },
13+
{name = "Anthony Mahanna", email = "[email protected]"}
14+
]
15+
maintainers = [
16+
{name = "Alexandru Petenchea", email = "[email protected]"},
17+
{name = "Anthony Mahanna", email = "[email protected]"}
18+
]
19+
keywords = ["arangodb", "python", "driver", "async"]
20+
readme = "README.md"
21+
dynamic = ["version"]
22+
license = { file = "LICENSE" }
23+
requires-python = ">=3.9"
24+
25+
classifiers = [
26+
"Intended Audience :: Developers",
27+
"License :: OSI Approved :: MIT License",
28+
"Natural Language :: English",
29+
"Operating System :: OS Independent",
30+
"Programming Language :: Python :: 3",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Topic :: Documentation :: Sphinx",
36+
"Typing :: Typed",
37+
]
38+
39+
dependencies = [
40+
"packaging>=23.1",
41+
"setuptools>=42",
42+
]
43+
44+
[project.optional-dependencies]
45+
dev = [
46+
"black>=22.3.0",
47+
"flake8>=4.0.1",
48+
"isort>=5.10.1",
49+
"mypy>=0.942",
50+
"pre-commit>=2.17.0",
51+
"pytest>=7.1.1",
52+
"pytest-cov>=3.0.0",
53+
"sphinx",
54+
"sphinx_rtd_theme",
55+
"types-setuptools",
56+
]
57+
58+
[tool.setuptools.package-data]
59+
"arangoasync" = ["py.typed"]
60+
61+
[project.urls]
62+
homepage = "https://github.com/arangodb/python-arango"
63+
64+
[tool.setuptools]
65+
packages = ["arangoasync"]
66+
67+
68+
[tool.pytest.ini_options]
69+
addopts = "-s -vv -p no:warnings"
70+
minversion = "6.0"
71+
testpaths = ["tests"]
72+
73+
[tool.coverage.run]
74+
omit = [
75+
"arangoasync/version.py",
76+
"setup.py",
77+
]
78+
79+
[tool.isort]
80+
profile = "black"
81+
82+
[tool.mypy]
83+
warn_return_any = true
84+
warn_unused_configs = true
85+
ignore_missing_imports = true
86+
strict = true

setup.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203, E741, W503
4+
exclude =.git .idea .*_cache dist htmlcov venv
5+
per-file-ignores = __init__.py:F401

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from setuptools import setup
2+
3+
setup()

starter.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Starts a local ArangoDB server or cluster (community or enterprise).
4+
# Useful for testing the python-arango driver against a local ArangoDB setup.
5+
6+
# Usage:
7+
# ./starter.sh [single|cluster] [community|enterprise] [version]
8+
# Example:
9+
# ./starter.sh cluster enterprise 3.11.4
10+
11+
setup="${1:-single}"
12+
license="${2:-community}"
13+
version="${3:-latest}"
14+
15+
extra_ports=""
16+
if [ "$setup" == "single" ]; then
17+
echo ""
18+
elif [ "$setup" == "cluster" ]; then
19+
extra_ports="-p 8539:8539 -p 8549:8549"
20+
else
21+
echo "Invalid argument. Please provide either 'single' or 'cluster'."
22+
exit 1
23+
fi
24+
25+
image_name=""
26+
if [ "$license" == "community" ]; then
27+
image_name="arangodb"
28+
elif [ "$license" == "enterprise" ]; then
29+
image_name="enterprise"
30+
else
31+
echo "Invalid argument. Please provide either 'community' or 'enterprise'."
32+
exit 1
33+
fi
34+
35+
conf_file=""
36+
if [[ "${version%.*}" == "3.10" ]]; then
37+
conf_file="${setup}-3.10"
38+
else
39+
conf_file="${setup}"
40+
fi
41+
42+
docker run -d \
43+
--name arango \
44+
-p 8528:8528 \
45+
-p 8529:8529 \
46+
$extra_ports \
47+
-v "$(pwd)/tests/static/":/tests/static \
48+
-v /tmp:/tmp \
49+
"arangodb/$image_name:$version" \
50+
/bin/sh -c "arangodb --configuration=/tests/static/$conf_file.conf"
51+
52+
wget --quiet --waitretry=1 --tries=120 -O - http://localhost:8528/version | jq
53+
if [ $? -eq 0 ]; then
54+
echo "OK starter ready"
55+
exit 0
56+
else
57+
echo "ERROR starter not ready, giving up"
58+
exit 1
59+
fi

0 commit comments

Comments
 (0)