From 14e3bbf5e8fc628ca4a112a4059906972233f8c5 Mon Sep 17 00:00:00 2001 From: Stella <30465823+stellaprins@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:55:28 +0000 Subject: [PATCH] Add pre-commit configuration and pyproject.toml and update gitignore --- .gitignore | 1 + .pre-commit-config.yaml | 50 +++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 24 ++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index e837a44d..0b8437e8 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ arm64 /SBML/ex9.csv /SBML/hr.csv /test_suite/semantic/ +/test_suite/SBML_test_suite/ /test_suite/semantic_tests_with_sedml_and_graphs.v*.zip* .vscode /BioModels/cache diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..67bb961e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,50 @@ +# Formatting shouldn't be applied to auto generated files, +# or files taken verbatim from external resources. +exclude: |- + (?x)^( + LEMS/.*| + Brian/.*| + NEURON/.*| + NeuroML2/.*| + tellurium/simple.py*| + .*\.xml$| + .*\.sedml$| + .*\.sbml$| + .*\.omex$| + .*\.json$| + .*\.md$| + )$ + +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.8.1 + hooks: + - id: ruff + - id: ruff-format + - repo: https://github.com/pappasam/toml-sort + rev: v0.24.2 + hooks: + - id: toml-sort-fix + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v3.1.0 + hooks: + - id: prettier + args: + - --quote-props=as-needed + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-case-conflict + - id: check-docstring-first + - id: check-merge-conflict + - id: check-toml + - id: end-of-file-fixer + - id: mixed-line-ending + args: + - --fix=lf + - id: trailing-whitespace + + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.10.1 + hooks: + - id: isort diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..ba965d1b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "SBMLShowcase" +dynamic = ["version"] +requires-python = ">=3.9" +dependencies = [ + "pyNeuroML[annotations]", + "python-libsedml", + "tellurium", + "pymetadata>=0.4.2", + "docker", + "requests<2.32.0" +] + +[project.optional-dependencies] +dev = [ + "pre-commit" +] + +[tool.setuptools] +packages = []