diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ff044a..b43b1b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,9 +33,7 @@ jobs: - name: Install NeuroMLlite and extra requirements run: | pip install . - pip install -r requirements-extra.txt - - #pip install 'numpy<=1.23.0' # temp fix, see https://github.com/OpenSourceBrain/osb-model-validation/issues/91 + pip install .[dev] - name: Lint with flake8 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..94bde9e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-added-large-files + args: [ "--maxkb=5000"] +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.4.1 + hooks: + - id: ruff + args: [ "--select", "I", "--fix" ] + - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..67fe177 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,12 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.ruff] + +exclude = [ + "examples", + ] + +[tool.ruff.lint] +ignore = ["F403", "F405"] diff --git a/requirements-extra.txt b/requirements-extra.txt deleted file mode 100644 index 83c7838..0000000 --- a/requirements-extra.txt +++ /dev/null @@ -1,9 +0,0 @@ -pyNN -bmtk -matplotlib -PyQt5 -pyneuroml -pyelectro -neuron -h5py -graphviz diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b4383c2 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,85 @@ +[metadata] +name = neuromllite +version = 0.6.1 +author = Padraig Gleeson +author_email = p.gleeson@gmail.com +url = https://github.com/NeuroML/NeuroMLlit +license = LGPL-3.0-only +description = A common JSON/YAML based format for compact network specification, closely tied to NeuroML v2 +long_description = file: README.md +long_description_content_type = text/markdown +classifiers = + Intended Audience :: Science/Research + Natural Language :: English + Operating System :: OS Independent + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 + Topic :: Scientific/Engineering + +[options] +install_requires = + libNeuroML>=0.5.1 + pyyaml + numpy + tables + h5py + modelspec>=0.2.6 + ppft[dill] + +packages = find: + +[options.packages.find] +include = + neuromllite + neuromllite.sweep + neuromllite.gui + +[options.entry_points] +console_scripts = + nmllite-ui = neuromllite.gui.NMLliteUI:main + +[options.extras_require] +extras = + pyNN + bmtk + matplotlib + PyQt5 + pyneuroml + pyelectro + neuron + h5py + graphviz + + +all = + neuromllite[extras] + +dev = + neuromllite[all] + neuromllite[doc] + pytest + pytest-xdist + pre-commit + + +doc = + sphinxcontrib-bibtex + #pyNN + bmtk + matplotlib + PyQt5 + pyneuroml + pyelectro + numpy + neuron + h5py + graphviz + pylems + tables + arbor + +[flake8] +extend-ignore = E501, E502, F403, F405, W503, W504 diff --git a/setup.py b/setup.py deleted file mode 100644 index 1b8e1ff..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -from setuptools import setup - -version = "" -for aline in open("neuromllite/__init__.py"): - if "__version__ =" in aline: - version = aline.split('"')[1] - -setup( - name="neuromllite", - version=version, - author="Padraig Gleeson", - author_email="p.gleeson@gmail.com", - packages=["neuromllite", "neuromllite.sweep", "neuromllite.gui"], - entry_points={ - "console_scripts": ["nmllite-ui = neuromllite.gui.NMLliteUI:main"] - }, - url="https://github.com/NeuroML/NeuroMLlite", - license="LICENSE.lesser", - description="A common JSON/YAML based format for compact network specification, closely tied to NeuroML v2", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - install_requires=[ - "libNeuroML>=0.5.1", - "pyyaml", - "numpy<2.0.0", - "tables", - "h5py", - "modelspec>=0.2.6", - "ppft" - ], - classifiers=[ - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering", - ], -)