Skip to content

Commit

Permalink
Merge pull request #640 from genn-team/better_setuptools_fix
Browse files Browse the repository at this point in the history
Better setuptools fix
  • Loading branch information
neworderofjamie authored Nov 7, 2024
2 parents 134575e + 7813e7f commit d973817
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions pygenn/genn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit d973817

Please sign in to comment.