Skip to content

Commit

Permalink
backmerge main into #95
Browse files Browse the repository at this point in the history
  • Loading branch information
turbomam committed Mar 30, 2023
2 parents 7b35dbe + 30cfdaf commit 9cca9fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Jinja2 = "^3.0.3"
ontodev-cogs = "^0.3.3"
bioregistry = ">0.5.0, <0.7.0"


[tool.poetry.dev-dependencies]
pytest = "^7.2"
pytest-cov = "^4.0"
Expand Down
7 changes: 5 additions & 2 deletions schemasheets/schemamaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ def ensure_csvreader(self, file_name: str, delimiter=None) -> str:
type=click.File(mode="w"),
default=sys.stdout,
help="output file")
@click.option('-s', '--sort-keys',
default=False,
help="Sort keys in schema output? For example permissible values in an enumeration? Defaults to False.")
@click.option("-n", "--name",
help="name of the schema")
@click.option("-C", "--table-config-path",
Expand All @@ -619,7 +622,7 @@ def ensure_csvreader(self, file_name: str, delimiter=None) -> str:
help="Google sheets ID. If this is specified then the arguments MUST be sheet names")
@click.option("-v", "--verbose", count=True)
@click.argument('tsv_files', nargs=-1)
def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_path: str, use_attributes: bool, unique_slots: bool, verbose: int):
def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_path: str, use_attributes: bool, unique_slots: bool, verbose: int, sort_keys: bool):
"""
Convert schemasheets to a LinkML schema
Expand Down Expand Up @@ -649,7 +652,7 @@ def convert(tsv_files, gsheet_id, output: TextIO, name, repair, table_config_pat
if repair:
schema = sm.repair_schema(schema)
schema_dict = schema_as_dict(schema)
output.write(yaml.dump(schema_dict))
output.write(yaml.dump(schema_dict, sort_keys=sort_keys))
#output.write(yaml_dumper.dumps(schema))


Expand Down

0 comments on commit 9cca9fd

Please sign in to comment.