From bd70f2a77089f24ad65ee71b746d5f8f9cb9ac65 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Wed, 9 Oct 2024 09:08:26 +0100 Subject: [PATCH 1/2] better setuptools 74.0 fix --- pygenn/genn_model.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pygenn/genn_model.py b/pygenn/genn_model.py index d6229ac9a..eebc4fbe7 100644 --- a/pygenn/genn_model.py +++ b/pygenn/genn_model.py @@ -31,7 +31,6 @@ from os import path, environ from platform import system from psutil import cpu_count -from setuptools import msvc from shutil import which from subprocess import check_call # to call make from textwrap import dedent @@ -70,9 +69,17 @@ # If we're on windows if system() == "Windows": + # Try import the helper to get Visual C++ environment from setuptools + # **NOTE** this was removed in version 74.0 + try: + from setuptools.msvc import msvc14_get_vc_env as _get_vc_env + # If this fails, import from distutils + except ImportError: + from distutils._msvccompiler import _get_vc_env + # Get environment and cache in class, convertings # all keys to upper-case for consistency - _msvc_env = msvc.msvc14_get_vc_env("x86_amd64") + _msvc_env = _get_vc_env("x86_amd64") _msvc_env = {k.upper(): v for k, v in _msvc_env.items()} # Update process's environment with this From 7813e7f0b901de35ab497c056e78c703012b480c Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Wed, 9 Oct 2024 09:08:55 +0100 Subject: [PATCH 2/2] removed pin --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index df63b9bb3..046668b07 100644 --- a/setup.py +++ b/setup.py @@ -290,7 +290,7 @@ python_requires=">=3.6", install_requires=["numpy>=1.17", "psutil", "importlib-metadata>=1.0;python_version<'3.8'", - "setuptools<74.0"], + "setuptools"], extras_require={ "doc": ["sphinx", "sphinx-gallery", "sphinx-argparse"], "userproject": ["mnist", "tqdm", "scipy", "matplotlib"],