Skip to content

Commit

Permalink
fixed saved model location
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus committed Sep 5, 2022
1 parent 8795568 commit 002864b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion oarepo_model_builder/model_preprocessors/default_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def c():
self.set(settings, "model-name", lambda: settings.package_base)

# for outputting the model
self.set(settings, 'saved-model-file', lambda: os.path.join('models', 'model.json'))
self.set(settings, 'saved-model-file', lambda: settings.package_path / 'models' / 'model.json')
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = oarepo-model-builder
version = 1.0.0.dev21
version = 1.0.0.dev22
description = An utility library that generates OARepo required data model files from a JSON specification file
authors = Miroslav Bauer <[email protected]>, Miroslav Simek <[email protected]>
readme = README.md
Expand Down
7 changes: 3 additions & 4 deletions tests/test_model_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_model_saver():
'package-path': 'test',
'processing-order': ['settings', '*', 'model'],
'python': {'use_black': False, 'use_isort': False},
'saved-model-file': 'models/model.json',
'saved-model-file': 'test/models/model.json',
'schema-file': 'test/records/jsonschemas/test-1.0.0.json',
'schema-name': 'test-1.0.0.json',
'schema-server': 'http://localhost/schemas/',
Expand Down Expand Up @@ -87,9 +87,8 @@ def build(model, output_builder_components=None, property_preprocessors=None):
),
output_dir="",
)
json5.load(builder.filesystem.open(os.path.join("models", "model.json")))
return (
json5.load(builder.filesystem.open(os.path.join("models", "model.json"))),
builder.filesystem.read(os.path.join("models", "__init__.py")),
json5.load(builder.filesystem.open(os.path.join("test", "models", "model.json"))),
builder.filesystem.read(os.path.join("test", "models", "__init__.py")),
builder.filesystem.read("setup.cfg")
)

0 comments on commit 002864b

Please sign in to comment.