Skip to content

Commit

Permalink
Merge pull request #73 from LEMS/chore/remove-setup.py
Browse files Browse the repository at this point in the history
feat: migrate away from deprecated setup.py
  • Loading branch information
pgleeson authored Jun 16, 2023
2 parents 3345bab + 5e16adc commit 80c45c4
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 108 deletions.
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include README.md
include examples/*.xml
include examples/*.py
include LICENSE.lesser
recursive-include man *.1
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions ci/run-apitest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
46 changes: 23 additions & 23 deletions ci/run-examples-ghactions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Simulation> element, i.e. use <Simulation...> not <SimulationSet...>, 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...
8 changes: 6 additions & 2 deletions lems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = (
Expand Down
13 changes: 0 additions & 13 deletions pylems

This file was deleted.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
39 changes: 39 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
[metadata]
name = PyLEMS
version = 0.6.3
author = PyLEMS authors and contributors
author_email = [email protected], [email protected]
maintainer_email = [email protected]
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
Expand Down
45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

0 comments on commit 80c45c4

Please sign in to comment.