Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

added ruff for import sorting of generated code #66

Merged
Merged
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
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pydantic-xml = "^2.9.0"
numpy = "^1.26.3"
pandas = "^2.1.4"
jinja2 = "^3.1.3"
black = "^23.12.1"
typer = "^0.9.0"
pyyaml = "^6.0.1"
toml = "^0.10.2"
Expand All @@ -31,12 +30,13 @@ markdown-it-py = "^3.0.0"
rich = "^13.7.0"
lxml = "^5.1.0"
python-frontmatter = "^1.1.0"
ruff = "^0.4.1"
black = "23.12.1"

[tool.poetry.group.dev.dependencies]
coverage = "^7.4.0"
pytest-cov = "^4.1.0"


[tool.poetry.group.hdf5.dependencies]
h5py = "^3.10.0"

Expand Down
21 changes: 18 additions & 3 deletions sdRDM/generator/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ def save_rendered_to_file(rendered: str, path: str, use_formatter: bool) -> None
[
sys.executable,
"-m",
"autoflake",
"--in-place",
"--remove-all-unused-imports",
"ruff",
"check",
"--fix",
"--select",
"I",
"--select",
"F",
path,
]
)
Expand Down Expand Up @@ -209,3 +213,14 @@ def _write_json_schemes(libpath: str, lib_name: str):

with open(path, "w") as f:
json.dump(cls.model_json_schema(), f, indent=2)


if __name__ == "__main__":
# Test the function
from sdRDM.generator import generate_python_api

generate_python_api(
path="/Users/max/Documents/GitHub/pyeed/specifications/sequence_record.md",
dirpath="/Users/max/Documents/GitHub/pyeed/pyeed_ontology",
libname="pyeedd",
)
Loading
Loading