diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 39fa7d4..0000000 --- a/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -exclude = NeuroML2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef404cc..34dcad1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: python-version: ["3.7", "3.9", "3.10", "3.11"] - runs-on: [ubuntu-latest, windows-latest] + runs-on: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 4e6d7db..b266466 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ doc/_build comp_* /lems/test/hhcell_resaved3.xml /lems/__init__$py.class -/PyLEMS.egg-info +*PyLEMS.egg-info /dist *ken.sh +*.whl diff --git a/MANIFEST.in b/MANIFEST.in index f8d036b..8b34167 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,4 @@ include README.md include examples/*.xml include examples/*.py include LICENSE.lesser +recursive-include man *.1 diff --git a/Makefile b/Makefile index 9f172b0..07bb5cf 100644 --- a/Makefile +++ b/Makefile @@ -18,46 +18,46 @@ clean: rm -rf doc/epydoc/* example1: - ./pylems examples/example1.xml + pylems examples/example1.xml example2: - ./pylems examples/example2.xml + pylems examples/example2.xml example3: - ./pylems examples/example3.xml + pylems examples/example3.xml example4: - ./pylems examples/example4.xml + pylems examples/example4.xml example5: - ./pylems examples/example5.xml + pylems examples/example5.xml example6: - ./pylems examples/example6.xml + pylems examples/example6.xml example7: - ./pylems examples/example7.xml + pylems examples/example7.xml example8: - ./pylems examples/example8.xml + pylems examples/example8.xml example9: - ./pylems examples/example9.xml + pylems examples/example9.xml ex0: - ./pylems examples/LEMS_NML2_Ex0.xml + pylems examples/LEMS_NML2_Ex0.xml nmlex0: - ./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex0_IaF.xml + pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex0_IaF.xml nmlex1: - ./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex1_HH.xml + pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex1_HH.xml nmlex2: - ./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex2_Izh.xml + pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex2_Izh.xml nmlex3: - ./pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex3_Net.xml + pylems ../NeuroML2/NeuroML2CoreTypes/LEMS_NML2_Ex3_Net.xml run: example1 diff --git a/README.md b/README.md index 92e9545..73e5187 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,13 @@ A stable version of PyLEMS is [available on PyPI](https://pypi.python.org/pypi/P pip install pylems -To install as root: - - sudo pip install pylems - Alternatively, you can obtain the latest version with git clone https://github.com/LEMS/pylems.git cd pylems git checkout development # optional - sudo python setup.py install + pip install . + ### Usage as a LEMS model simulator diff --git a/ci/run-apitest.sh b/ci/run-apitest.sh index 7dfa607..48666b1 100755 --- a/ci/run-apitest.sh +++ b/ci/run-apitest.sh @@ -12,6 +12,10 @@ python examples/loadtest.py # Update NeuroML2 path for CI if [ "$CI" = "true" ]; then - sed -i 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py + if [ "$RUNNER_OS" = "macOS" ]; then + sed -i '' 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py; + else + sed -i 's|../NeuroML2|./NeuroML2|g' lems/dlems/exportdlems.py; + fi fi -python lems/dlems/exportdlems.py +python lems/dlems/exportdlems.py \ No newline at end of file diff --git a/ci/run-examples-ghactions.sh b/ci/run-examples-ghactions.sh index f46124b..dcdfb8b 100755 --- a/ci/run-examples-ghactions.sh +++ b/ci/run-examples-ghactions.sh @@ -10,33 +10,33 @@ mkdir results ### Try running "standard" LEMS examples echo "Running standard LEMS examples" -./pylems examples/example1.xml -nogui -./pylems examples/example2.xml -nogui -./pylems examples/example3.xml -nogui -#./pylems examples/example4.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) -#./pylems examples/example5.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) -./pylems examples/example6.xml -nogui -./pylems examples/bounce-conditional.xml -nogui +pylems examples/example1.xml -nogui +pylems examples/example2.xml -nogui +pylems examples/example3.xml -nogui +#pylems examples/example4.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) +#pylems examples/example5.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) +pylems examples/example6.xml -nogui +pylems examples/bounce-conditional.xml -nogui # Rest of examples require an update to the element, i.e. use not , to work in PyLEMS ### Try running NeuroML 2 examples echo "Running NeuroML2 examples" -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex0_IaF.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex1_HH.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex3_Net.xml -nogui -#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex4_KS.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex7_STP.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex8_AdEx.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex9_FN.xml -nogui -#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex10_Q10.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex11_STDP.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex0_IaF.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex1_HH.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex3_Net.xml -nogui +#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex4_KS.xml -nogui # Not working (Unsupported in PyLEMS: KSChannel) +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex5_DetCell.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex6_NMDA.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex7_STP.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex8_AdEx.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex9_FN.xml -nogui +#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex10_Q10.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex11_STDP.xml -nogui -./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex13_Instances.xml -nogui +pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex13_Instances.xml -nogui -#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex15_CaDynamics.xml -nogui +#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex15_CaDynamics.xml -nogui -#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex17_Tissue.xml -nogui -#./pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex18_GHK.xml -nogui # Mismatch... +#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex17_Tissue.xml -nogui +#pylems -I NeuroML2/NeuroML2CoreTypes/ NeuroML2/LEMSexamples/LEMS_NML2_Ex18_GHK.xml -nogui # Mismatch... diff --git a/lems/__init__.py b/lems/__init__.py index 0a1782d..b7040f9 100644 --- a/lems/__init__.py +++ b/lems/__init__.py @@ -4,11 +4,15 @@ """ import logging +try: + import importlib.metadata + __version__ = importlib.metadata.version("PyLEMS") +except ImportError: + import importlib_metadata + __version__ = importlib_metadata.version("PyLEMS") logger = logging.getLogger("LEMS") -__version__ = "0.6.2" - __schema_version__ = "0.7.6" __schema_branch__ = "development" __schema_location__ = ( diff --git a/pylems b/pylems deleted file mode 100755 index f15939e..0000000 --- a/pylems +++ /dev/null @@ -1,13 +0,0 @@ -#! /usr/bin/env python -""" -PyLEMS command line startup script. - -@author: Gautham Ganapathy -@organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) -@contact: gautham@lisphacker.org -""" - -from lems.run import main - -if __name__ == '__main__': - main() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 72248c8..58c8c02 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,42 @@ +[metadata] +name = PyLEMS +version = 0.6.3 +author = PyLEMS authors and contributors +author_email = gautham@lisphacker.org, p.gleeson@gmail.com +maintainer_email = p.gleeson@gmail.com +url = https://github.com/LEMS/pylems +description = A Python library for working with the Low Entropy Model Specification language (LEMS) +long_description = file: README.md, LICENSE.lesser +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.6 + 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 +license = LGPL-3.0-only + +[options] +install_requires = + lxml + typing; python_version<"3.5" + +packages = find: + +[options.packages.find] +where = . +include = lems* + +[options.entry_points] +console_scripts = + pylems = lems.run:main + + [flake8] # ignore: # spacing around operators, comment blocks, in argument lists diff --git a/setup.py b/setup.py deleted file mode 100644 index 1e1be44..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- - -from setuptools import setup - -long_description = open("README.md").read() - -import lems - -version = lems.__version__ - -setup( - name="PyLEMS", - version=version, - packages=[ - "lems", - "lems.base", - "lems.model", - "lems.parser", - "lems.sim", - "lems.dlems", - ], - scripts=["pylems"], - data_files=[("man/man1", ["man/man1/pylems.1"])], - author="PyLEMS authors and contributors", - author_email="gautham@lisphacker.org, p.gleeson@gmail.com", - description="A Python library for working with the Low Entropy Model Specification language (LEMS)", - long_description=long_description, - long_description_content_type="text/markdown", - install_requires=["lxml", 'typing; python_version<"3.5"'], - license="LGPL", - url="https://github.com/LEMS/pylems", - 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.6", - "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", - ], -)