Skip to content

Commit

Permalink
Make stub generator installable (#1900)
Browse files Browse the repository at this point in the history
* make stub generator importable

* make stub gen useable in other projects

* add warning for missing return type

* fix some return type warnings

* fix some of the stub warnings

* make sure order of stub files is correct so we don't get problems with undefined class names

* type check raphtory package

* fix the mypy errors

* tidy
  • Loading branch information
ljeub-pometry authored Dec 20, 2024
1 parent 1539e7e commit eb66ede
Show file tree
Hide file tree
Showing 23 changed files with 6,381 additions and 6,297 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ deactivate-storage:
pull-storage: activate-storage
git submodule update --init --recursive

stubs:
cd python && ./scripts/gen-stubs.py && mypy python/raphtory/**/*.pyi
install-stub-gen:
python -mpip install ./python/scripts/stub_gen

stubs: install-stub-gen
cd python && ./scripts/gen-stubs.py && mypy -m raphtory

python-fmt:
cd python && black .
Expand Down
14 changes: 7 additions & 7 deletions python/python/raphtory/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import sys
import sys as _sys
from .raphtory import *

sys.modules["raphtory.node_state"] = node_state
sys.modules["raphtory.algorithms"] = algorithms
sys.modules["raphtory.graph_gen"] = graph_gen
sys.modules["raphtory.graph_loader"] = graph_loader
sys.modules["raphtory.vectors"] = vectors
sys.modules["raphtory.graphql"] = graphql
_sys.modules["raphtory.node_state"] = node_state
_sys.modules["raphtory.algorithms"] = algorithms
_sys.modules["raphtory.graph_gen"] = graph_gen
_sys.modules["raphtory.graph_loader"] = graph_loader
_sys.modules["raphtory.vectors"] = vectors
_sys.modules["raphtory.graphql"] = graphql

__doc__ = raphtory.__doc__
if hasattr(raphtory, "__all__"):
Expand Down
Loading

0 comments on commit eb66ede

Please sign in to comment.