Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better setuptools fix #640

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Check warning on line 75 in pygenn/genn_model.py

View check run for this annotation

Codecov / codecov/patch

pygenn/genn_model.py#L74-L75

Added lines #L74 - L75 were not covered by tests
# If this fails, import from distutils
except ImportError:
from distutils._msvccompiler import _get_vc_env

Check warning on line 78 in pygenn/genn_model.py

View check run for this annotation

Codecov / codecov/patch

pygenn/genn_model.py#L77-L78

Added lines #L77 - L78 were not covered by tests

# 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")

Check warning on line 82 in pygenn/genn_model.py

View check run for this annotation

Codecov / codecov/patch

pygenn/genn_model.py#L82

Added line #L82 was not covered by tests
_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