Skip to content

Commit 3c54db9

Browse files
Update installation prerequisites (#233)
* Update installation prerequisites * Update with optional dependencies * Change docs generation instructions * Update README with optional dependencies * Add PyG installation --------- Co-authored-by: antepusic <ante.pusic@fer.hr>
1 parent 07f2981 commit 3c54db9

1 file changed

Lines changed: 54 additions & 18 deletions

File tree

README.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,68 @@
1414

1515
An Object Graph Mapper or OGM provides a developer-friendly workflow that allows for writing object-oriented notation to communicate with graph databases. Instead of writing Cypher queries, you will be able to write object-oriented code, which the OGM will automatically translate into Cypher queries.
1616

17+
## Installation
18+
1719
GQLAlchemy is built on top of Memgraph's low-level Python client `pymgclient`
1820
([PyPI](https://pypi.org/project/pymgclient/) /
1921
[Documentation](https://memgraph.github.io/pymgclient/) /
20-
[GitHub](https://github.com/memgraph/pymgclient)).
22+
[GitHub](https://github.com/memgraph/pymgclient)).
2123

22-
## Installation
24+
To install GQLAlchemy, you first need to install `pymgclient` [build prerequisites](https://memgraph.github.io/pymgclient/introduction.html#build-prerequisites).
2325

24-
Before you install `gqlalchemy`, make sure that you have `cmake` installed by running:
25-
```
26-
cmake --version
27-
```
28-
You can install `cmake` by following the [official instructions](https://cgold.readthedocs.io/en/latest/first-step/installation.html#).
26+
After you have installed the prerequisites, run the following command:
2927

30-
To install `gqlalchemy`, simply run the following command:
31-
```
32-
pip install gqlalchemy
28+
`pip install gqlalchemy`
29+
30+
With the above command, you get the basic GQLAlchemy capabilities. To add additional import/export capabilities, install GQLAlchemy with one of the following commands:
31+
32+
- `pip install gqlalchemy[arrow]` # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
33+
- `pip install gqlalchemy[dgl]` # DGL support (includes PyTorch)
34+
35+
- `pip install gqlalchemy[all]` # All of the above
36+
37+
If you intend to use GQLAlchemy with PyTorch Geometric support, that library must be installed manually:
38+
39+
```bash
40+
pip install gqlalchemy[torch_pyg] # prerequisite
41+
pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.13.0+cpu.html"
3342
```
3443
3544
If you are using [Conda](https://docs.conda.io/en/latest/) for Python environment management, you can install GQLAlchemy through pip.
3645
3746
## Build & Test
3847
39-
The project uses [Poetry](https://python-poetry.org/) to build the GQLAlchemy Python library. To build and run tests, execute the following command:
40-
`poetry install`
48+
The project uses [Poetry](https://python-poetry.org/) to build the library. Clone or download the [GQLAlchemy source code](https://github.com/memgraph/gqlalchemy) locally and run the following command to build it from source with Poetry:
49+
50+
```bash
51+
poetry install --all-extras
52+
```
4153
42-
Before starting the tests, make sure you have an active Memgraph instance running. Execute the following command:
43-
`poetry run pytest .`
54+
The ``poetry install --all-extras`` command installs GQLAlchemy with all extras
55+
(optional dependencies). Alternatively, you can use the ``-E`` option to define
56+
what extras to install:
57+
58+
```bash
59+
poetry install # No extras
60+
61+
poetry install -E arrow # Support for the CSV, Parquet, ORC and IPC/Feather/Arrow formats
62+
poetry install -E dgl # DGL support (also includes torch)
63+
```
64+
65+
To run the tests, make sure you have an [active Memgraph instance](/memgraph), and execute one of the following commands:
66+
67+
```bash
68+
poetry run pytest . -k "not slow" # If all extras installed
69+
70+
poetry run pytest . -k "not slow and not extras" # Otherwise
71+
```
72+
73+
If you’ve installed only certain extras, it’s also possible to run their associated tests:
74+
75+
```bash
76+
poetry run pytest . -k "arrow"
77+
poetry run pytest . -k "dgl"
78+
```
4479
4580
## GQLAlchemy capabilities
4681
@@ -235,10 +270,11 @@ Since Memgraph is an in-memory graph database, the GQLAlchemy library provides a
235270
If you want to learn more about OGM, query builder, managing streams, importing data from different source, managing Memgraph instances, managing database triggers and using on-disk storage, check out the GQLAlchemy [how-to guides](https://memgraph.com/docs/gqlalchemy/how-to-guides).
236271
237272
## Development (how to build)
238-
```
273+
274+
```bash
239275
poetry run flake8 .
240276
poetry run black .
241-
poetry run pytest . -k "not slow"
277+
poetry run pytest . -k "not slow and not extras"
242278
```
243279
244280
## Documentation
@@ -247,8 +283,8 @@ The GQLAlchemy documentation is available on [memgraph.com/docs/gqlalchemy](http
247283
248284
The documentation can be generated by executing:
249285
```
250-
pip3 install python-markdown
251-
python-markdown
286+
pip3 install pydoc-markdown
287+
pydoc-markdown
252288
```
253289
254290
## License

0 commit comments

Comments
 (0)