From 2540ea4711d10e798f8a3d85e6a70e22a5d0652f Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 11:26:05 +0000 Subject: [PATCH 1/5] python 3.12 --- .github/workflows/c_actions.yml | 4 ++-- .github/workflows/python_actions.yml | 8 ++++---- doc/source/conf.py | 2 +- setup.cfg | 8 ++------ 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/c_actions.yml b/.github/workflows/c_actions.yml index 9a24941bdc..bdf13de1f6 100644 --- a/.github/workflows/c_actions.yml +++ b/.github/workflows/c_actions.yml @@ -29,11 +29,11 @@ jobs: with: repository: SpiNNakerManchester/SupportScripts path: support - - name: Set up Python 3.8 + - name: Set up Python 3.12 # Note: Python is needed for spinn_utilities.make_tools when building uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.12 - name: Install Ubuntu dependencies uses: ./support/actions/apt-get-install with: diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index f70ac57d17..6881afc675 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -30,7 +30,7 @@ jobs: timeout-minutes: 10 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: - name: Checkout @@ -78,7 +78,7 @@ jobs: uses: ./support/actions/pytest with: tests: unittests - coverage: ${{ matrix.python-version == 3.8 }} + coverage: ${{ matrix.python-version == 3.12 }} cover-packages: ${{ env.BASE_PKG }} coveralls-token: ${{ secrets.GITHUB_TOKEN }} @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8"] + python-version: [3.12] steps: - name: Checkout uses: actions/checkout@v4 @@ -143,7 +143,7 @@ jobs: with: base-path: ${{ env.BASE_PKG }} - - name: Build documentation with sphinx (3.8 only) + - name: Build documentation with sphinx (3.12 only) uses: ./support/actions/sphinx with: directory: doc/source diff --git a/doc/source/conf.py b/doc/source/conf.py index f01eed8930..7119f34e0c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -58,7 +58,7 @@ spinnaker_doc_version = "latest" intersphinx_mapping = { - 'python': ('https://docs.python.org/3.8', None), + 'python': ('https://docs.python.org/3.12', None), 'numpy': ("https://numpy.org/doc/1.20/", None), 'matplotlib': ('https://matplotlib.org', None), 'pynn': ("https://neuralensemble.github.io/docs/PyNN/", None), diff --git a/setup.cfg b/setup.cfg index 1f551380a8..6ad79cc886 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,11 +30,11 @@ classifiers = Operating System :: Microsoft :: Windows Operating System :: MacOS Programming Language :: Python :: 3 - 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 + Programming Language :: Python :: 3.12 maintainer = SpiNNakerTeam maintainer_email = spinnakerusers@googlegroups.com keywords = @@ -42,7 +42,7 @@ keywords = pynn [options] -python_requires = >=3.7, <4 +python_requires = >=3.8, <4 packages = find: zip_safe = True include_package_data = True @@ -54,10 +54,6 @@ install_requires = pynn >= 0.11, != 0.12.0; python_version >= '3.8' neo; python_version >= '3.8' lazyarray; python_version >= '3.8' - # python 3.7 is no longer officially supported - pynn >= 0.9.1, < 0.10.0; python_version == '3.7' - neo >= 0.5.2, < 0.10.0; python_version == '3.7' - lazyarray >= 0.2.9, <= 0.4.0; python_version == '3.7' # below may fail for read the docs scipy csa From 3b8265a9e6c4cc5feb5d37c22d86e16289362a98 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 11:29:40 +0000 Subject: [PATCH 2/5] from collections.abc import Sized --- .../neural_projections/connectors/pool_dense_connector.py | 4 ++-- .../spike_source/spike_source_poisson_machine_vertex.py | 3 ++- .../pyNN/models/spike_source/spike_source_poisson_vertex.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py index 7e1af06728..286d0c54d3 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py @@ -15,13 +15,13 @@ # limitations under the License. from __future__ import annotations -from collections.abc import Iterable +from collections.abc import Iterable, Sized import numpy from numpy import integer, floating, float64, uint16, uint32 from numpy.typing import ArrayLike, NDArray from pyNN.random import RandomDistribution from typing import ( - Optional, Tuple, Union, cast, TYPE_CHECKING, Sized) + Optional, Tuple, Union, cast, TYPE_CHECKING) from spinn_utilities.overrides import overrides from pacman.model.graphs.common import Slice from spinn_front_end_common.utilities.constants import ( diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py index 7854a52970..b7d5409edc 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py @@ -12,12 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. from __future__ import annotations +from collections.abc import Sized from enum import IntEnum import numpy from numpy import uint16, uint32 import struct from typing import ( - Iterable, List, Optional, Sequence, Sized, TypeVar, Union, + Iterable, List, Optional, Sequence, TypeVar, Union, cast, TYPE_CHECKING) from spinn_utilities.overrides import overrides diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py index 7180edb9a4..8216acf70a 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py @@ -13,10 +13,11 @@ # limitations under the License. from __future__ import annotations from collections.abc import Sequence as Seq +from collections.abc import Sized import logging import math from typing import ( - Any, Collection, Dict, List, Optional, Sequence, Sized, Tuple, Union, + Any, Collection, Dict, List, Optional, Sequence, Tuple, Union, cast, TYPE_CHECKING) from typing_extensions import TypeGuard import numpy From 4ddab1469bbbeaa68b0a7198edfe4229ca4d7aff Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 13:06:35 +0000 Subject: [PATCH 3/5] packaging.version --- spynnaker/pyNN/setup_pynn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spynnaker/pyNN/setup_pynn.py b/spynnaker/pyNN/setup_pynn.py index a60dcfff9d..58a0f1d256 100644 --- a/spynnaker/pyNN/setup_pynn.py +++ b/spynnaker/pyNN/setup_pynn.py @@ -22,7 +22,7 @@ import os # TODO: switch to packaging.version -from distutils.version import StrictVersion as Version # pylint: disable=all +from packaging.version import Version import pyNN # The version of PyNN that we really want From a7435ba392a13e8e8abb7548862af4fefd08da7d Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 13:13:23 +0000 Subject: [PATCH 4/5] remove distutils --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index bb8feb390a..3592e5ffd8 100644 --- a/setup.py +++ b/setup.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import distutils.dir_util from setuptools import setup +import shutil import os import sys @@ -26,8 +26,8 @@ this_dir = os.path.dirname(os.path.abspath(__file__)) build_dir = os.path.join(this_dir, "build") if os.path.isdir(build_dir): - distutils.dir_util.remove_tree(build_dir) + shutil.rmtree(build_dir) egg_dir = os.path.join(this_dir, "sPyNNaker.egg-info") if os.path.isdir(egg_dir): - distutils.dir_util.remove_tree(egg_dir) + shutil.rmtree(egg_dir) setup() From f60db086eec25afef696490d58813f460af82584 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Jan 2024 14:13:00 +0000 Subject: [PATCH 5/5] no dependency capping by version --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 6ad79cc886..10233fa2f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,9 +51,9 @@ install_requires = matplotlib pyparsing>=2.2.1,<3.0.0 quantities - pynn >= 0.11, != 0.12.0; python_version >= '3.8' - neo; python_version >= '3.8' - lazyarray; python_version >= '3.8' + pynn >= 0.11, != 0.12.0 + neo + lazyarray # below may fail for read the docs scipy csa