Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ Remember that many community members have become regular contributors and some a

### Setting up the Development Environment
* Install Python 3.10+
* Install the requirements
* Install the requirements (needs pip 25.1+)
```bash
$ python3 -m pip install -U pip
$ python3 -m pip install -Ur requirements-dev.txt
# recommended to use a virtual environment
$ python3 -m venv .venv
$ source .venv/bin/activate
# make sure pip is up to date
$ pip install -U pip
# install all development dependencies and driver
$ pip install -U --group dev -e .
```
* Install pre-commit hooks to notice mistakes before the CI does it for you ;)
```bash
Expand Down
2 changes: 1 addition & 1 deletion bin/target_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

version="$1"; shift

sed -i "s/\"\(neo4j *== *\).*\"/\"\1$version\"/" pyproject.toml
sed -i "s/\"\(neo4j *\([\[0-9a-zA-Z, \]\+]\)\? *== *\).*\"/\"\1$version\"/" pyproject.toml
sed -i "s/\(version *= *\)\"[0-9]\+\.[0-9]\+\.[0-9]\+\(.*\)\"/\1\"$version.0\"/" pyproject.toml

cd driver
Expand Down
1 change: 1 addition & 0 deletions changelog.d/44.dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use dependency groups in `pyproject.toml` for development dependencies<ISSUES_LIST>.
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,40 @@ pyarrow = ["neo4j[pyarrow]"]
requires = ["maturin ~= 1.9.1"]
build-backend = "maturin"

[dependency-groups]
# To install all development dependencies as well as the driver with all optional dependencies,
# run `pip install --group dev -e .` inside repository root folder.
dev = [
# dev tools
{include-group = "dep-project-dependencies"},
{include-group = "tox"},
{include-group = "precommit"},
{include-group = "test"},
{include-group = "packaging"},
]
tox = [
"tox >= 4.25.0",
]
precommit = [
"pre-commit >= 4.2.0",
"isort >= 6.0.1",
]
test = [
"pytest >= 8.3.5",
"pytest-benchmark >= 5.1.0",
"pytest-mock >= 3.14.1",
]
packaging = [
"build",
"maturin ~= 1.9.1",
"towncrier >= 24.8.0",
]

# single dependencies and other include-groups (not really meant to be installed as a group, but to avoid duplication)
dep-project-dependencies = [
"neo4j[numpy,pandas,pyarrow] == 5.28.1",
]

[tool.maturin]
features = ["pyo3/extension-module", "pyo3/generate-import-lib"]
module-name = "neo4j._rust"
Expand Down
18 changes: 0 additions & 18 deletions requirements-dev.txt

This file was deleted.

15 changes: 14 additions & 1 deletion testkit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@

if __name__ == "__main__":
run_python(["-m", "pip", "install", "-U", "pip"])
run_python(["-m", "pip", "install", "-Ur", "requirements-dev.txt"])
run_python(["-m", "pip", "install", "-U", "--group", "packaging"])
run_python(["-m", "build", "."])
run_python(
[
"-m",
"pip",
"install",
"-U",
"--group",
"driver/pyproject.toml:testkit",
"-e",
".",
]
)
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
envlist = py{310,311,312,313}-{test}

[testenv]
deps = -r requirements-dev.txt
dependency_groups =
test
extras =
numpy
pandas
pyarrow
commands =
test: python -m pytest -v --benchmark-skip {posargs} tests