From efaa94b722da306c59c89fd81bcb404e8a7175bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 10:00:26 +0200 Subject: [PATCH 1/6] Migrating from setup.py to pyproject.toml Change-Id: I6cc804f09d928fa238442f52fa3d66f40e478416 --- .github/workflows/build.yml | 4 +-- .pylintrc | 2 ++ pyproject.toml | 47 +++++++++++++++++++++++++ setup.py | 70 ------------------------------------- 4 files changed, 51 insertions(+), 72 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebe5d88..6449e6e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,8 +35,8 @@ jobs: - name: Build a source tarball and wheel run: | - pip install wheel - python setup.py sdist bdist_wheel + pip install build + python -m build - name: Get and store tag from 'Bump version and push tag' step if: ${{ !startsWith(github.ref, 'refs/tags/') }} diff --git a/.pylintrc b/.pylintrc index 4ae4328..dabfc58 100644 --- a/.pylintrc +++ b/.pylintrc @@ -8,6 +8,8 @@ max-line-length=100 [DESIGN] # Maximum number of arguments for function / method max-args=8 +# Maximum number of positional arguments for function / method +max-positional-arguments=8 # Argument names that match this expression will be ignored. Default to name # with leading underscore ignored-argument-names=_.* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..abff92c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +requires = ["setuptools >= 64", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "currentscape" +authors = [ + {name = "Blue Brain Project, EPFL"}, +] +description="Module to easily plot currentscape." +readme = "README.rst" +license = {file = "LICENSE.txt"} +requires-python = ">= 3.8" +dynamic = ["version"] +dependencies = [ + "numpy", + "matplotlib", + "palettable", +] +classifiers=[ + "Development Status :: 5 - Stable", + "Intended Audience :: Education", + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Bio-Informatics", +] + +[project.optional-dependencies] +docs = ["sphinx", "sphinx-bluebrain-theme"] +example = ["scipy", "bluepyopt", "emodelrunner>=1.1.5"] + + +[project.urls] +Homepage = "https://github.com/BlueBrain/Currentscape" + +[tool.setuptools.packages.find] +exclude = ["tests",] + +[tool.setuptools_scm] +version_scheme = "python-simplified-semver" +local_scheme = "no-local-version" diff --git a/setup.py b/setup.py deleted file mode 100644 index f5b08d0..0000000 --- a/setup.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2023 Blue Brain Project / EPFL - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import sys - -from setuptools import setup, find_packages - -if sys.version_info < (3, 8): - sys.exit("Sorry, Python < 3.8 is not supported") - -# read the contents of the README file -with open("README.rst", encoding="utf-8") as f: - README = f.read() - -EXTRA_EXAMPLE = ["scipy", "bluepyopt", "emodelrunner>=1.1.5"] - -setup( - name="currentscape", - author="Blue Brain Project, EPFL", - use_scm_version={ - "version_scheme": "python-simplified-semver", - "local_scheme": "no-local-version", - }, - setup_requires=["setuptools_scm"], - description="Module to easily plot currentscape.", - long_description=README, - long_description_content_type="text/x-rst", - url="https://github.com/BlueBrain/Currentscape", - project_urls={ - "Tracker": "https://github.com/BlueBrain/Currentscape", - "Source": "https://github.com/BlueBrain/Currentscape", - }, - license="Apache 2.0", - install_requires=[ - "numpy", - "matplotlib", - "palettable", - ], - packages=find_packages(exclude=["tests"]), - python_requires=">=3.8", - extras_require={ - "docs": ["sphinx", "sphinx-bluebrain-theme"], - "example": EXTRA_EXAMPLE, - }, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Education", - "Intended Audience :: Science/Research", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Scientific/Engineering :: Bio-Informatics", - ], -) From 4060db227e4a9f2bdf8e9e333f56a1c5abb10b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 10:01:58 +0200 Subject: [PATCH 2/6] add py312 test Change-Id: Ic9a420598da162d0a21d5339e1c77c32cbc184ed --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9422514..a7319e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 From c22b589afd8b2985df122402ee504fb489c78fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 13:51:25 +0200 Subject: [PATCH 3/6] make currentscape compatible with latest EModelRunner and BPO Change-Id: Ief9725d599b2d425b84188cd08c37a7e860772ac --- README.rst | 2 +- examples/use_case/run.py | 2 ++ pyproject.toml | 6 +++++- tox.ini | 10 ++++------ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 832070c..e2ce906 100644 --- a/README.rst +++ b/README.rst @@ -241,7 +241,7 @@ The part of the code in this repository developed by the EPFL Blue Brain Project :target: https://github.com/BlueBrain/Currentscape/blob/main/LICENSE.txt :alt: license -.. |build| image:: https://github.com/BlueBrain/Currentscape/workflows/Test/badge.svg?branch=main +.. |build| image:: https://github.com/BlueBrain/Currentscape/workflows/test.yml/badge.svg?branch=main :target: https://github.com/BlueBrain/Currentscape/actions :alt: actions build status diff --git a/examples/use_case/run.py b/examples/use_case/run.py index b7876a1..428895e 100644 --- a/examples/use_case/run.py +++ b/examples/use_case/run.py @@ -46,6 +46,8 @@ def create_cell(): morph = SSCXNrnFileMorphology( morphology_path=morph_path, do_replace_axon=True, + axon_stub_length=60, + axon_nseg_frequency=15, ) return ephys.models.CellModel( diff --git a/pyproject.toml b/pyproject.toml index abff92c..dd227ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,11 +33,15 @@ classifiers=[ [project.optional-dependencies] docs = ["sphinx", "sphinx-bluebrain-theme"] -example = ["scipy", "bluepyopt", "emodelrunner>=1.1.5"] +example = ["scipy", "bluepyopt", "emodelrunner>=1.2.4"] [project.urls] Homepage = "https://github.com/BlueBrain/Currentscape" +Source = "https://github.com/BlueBrain/Currentscape" +Repository = "https://github.com/BlueBrain/Currentscape.git" +Tracker = "https://github.com/BlueBrain/Currentscape/issues" +Documentation = "https://currentscape.readthedocs.io/en/latest" [tool.setuptools.packages.find] exclude = ["tests",] diff --git a/tox.ini b/tox.ini index 5de1886..e5ae6f8 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,11 @@ ignore_basepython_conflict = true [gh-actions] python = - 3.7: py3 3.8: py3 3.9: py3 3.10: py3 - 3.11: check-packaging, lint, docs, coverage + 3.11: py3 + 3.12: check-packaging, lint, docs, coverage [testenv] basepython=python @@ -49,10 +49,10 @@ commands = do_release.py -p . check-version [testenv:check-packaging] deps = - wheel + build twine commands = - python setup.py sdist bdist_wheel -d {envtmpdir}/dist + python-m build -o {envtmpdir}/dist twine check {envtmpdir}/dist/* [testenv:lint] @@ -67,14 +67,12 @@ commands = pylint {[base]name} black --diff --check {[base]name} black --diff --check tests - black --diff --check setup.py [testenv:format] deps = black commands = black {[base]name} black tests - black setup.py [testenv:coverage] extras = example From 69c6d71cdff9157692dc4f9cb5c488693ed55d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 14:19:54 +0200 Subject: [PATCH 4/6] fix classifier in pyproject Change-Id: I2a4fcdbd64aa0645e10f8d93f6edc13acba300da --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dd227ac..fc009d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "palettable", ] classifiers=[ - "Development Status :: 5 - Stable", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Education", "Intended Audience :: Science/Research", "Programming Language :: Python", From 8ebf4c092001eb1ca21aad983807472b585582fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 16:08:45 +0200 Subject: [PATCH 5/6] update emodelrunner version in pyproject Change-Id: I30819cf02587490d46fbbd010c4f87060cb4dc6c --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc009d3..f7cc0d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers=[ [project.optional-dependencies] docs = ["sphinx", "sphinx-bluebrain-theme"] -example = ["scipy", "bluepyopt", "emodelrunner>=1.2.4"] +example = ["scipy", "bluepyopt", "emodelrunner>=1.2.5"] [project.urls] From 7b85200cb3aad37e9b35f7db5f47bfdb83331e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaquier=20Aur=C3=A9lien=20Tristan?= Date: Wed, 2 Oct 2024 16:18:01 +0200 Subject: [PATCH 6/6] fix typo in tox Change-Id: I75139cd6dc1368038056481af130227c355ae3ba --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index e5ae6f8..3a271bd 100644 --- a/tox.ini +++ b/tox.ini @@ -52,7 +52,7 @@ deps = build twine commands = - python-m build -o {envtmpdir}/dist + python -m build -o {envtmpdir}/dist twine check {envtmpdir}/dist/* [testenv:lint]