Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the package smaller #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
# we do *not* install the dedupe extra because its dependency on PyLBFGS requires an older version
# of Cython that is not available in python 3.11
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' && matrix.python-version == '3.11'
run: poetry install --no-interaction --no-root -E allegro -E brickify -E web -E orm -E reasonable -E persistence -E bacnet -E networkx
run: poetry install --no-interaction --no-root -E allegro -E brickify -E web -E orm -E reasonable -E persistence -E bacnet -E networkx -E topquadrant
- name: Install all dependencies for other Python versions
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' && matrix.python-version != '3.11'
run: poetry install --no-interaction --no-root --all-extras
Expand Down
14 changes: 12 additions & 2 deletions brickschema/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ def validate(
raise Exception(
"TopQuadrant SHACL validation requires Java to be installed and in the PATH"
)
from brickschema.topquadrant_shacl import validate
try:
from brick_tq_shacl.topquadrant_shacl import validate
except ImportError:
raise Exception(
"TopQuadrant SHACL validation requires installing brickschema with the 'topquadrant' option:\n\n\tpip install brickschema[topquadrant]"
)

if shape_graphs is not None and isinstance(shape_graphs, list):
for sg in shape_graphs:
Expand Down Expand Up @@ -270,7 +275,12 @@ def expand(
raise Exception(
"TopQuadrant SHACL validation requires Java to be installed and in the PATH"
)
from brickschema.topquadrant_shacl import infer
try:
from brick_tq_shacl.topquadrant_shacl import infer
except ImportError:
raise Exception(
"TopQuadrant SHACL inference requires installing brickschema with the 'topquadrant' option:\n\n\tpip install brickschema[topquadrant]"
)

# 'res' is a de-skolemized graph. We want to replace the contents
# of this graph with the de-skolemized version because topquadrant requires
Expand Down
Loading