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

Setuptools fix #591

Merged
merged 2 commits into from
May 25, 2023
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
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ for(b = 0; b < builderNodes.size(); b++) {

python setup.py clean --all
python setup.py bdist_wheel -d . 1>> "${uniqueMsg}" 2>> "${uniqueMsg}"
python setup.py bdist_wheel -d . 1>> "${uniqueMsg}" 2>> "${uniqueMsg}"
"""

def wheelStatusCode = sh script:script, returnStatus:true
Expand Down
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from platform import system, uname
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from distutils.command.build import build as _build
from shutil import copytree, rmtree
from generate_swig_interfaces import generateConfigs

Expand Down Expand Up @@ -124,7 +125,7 @@
opencl_library_dir = os.path.join(opencl_path, "lib", "x64")
else:
opencl_library_dir = os.path.join(opencl_path, "lib64")

# Add backend
# **NOTE** on Mac OS X, a)runtime_library_dirs doesn't work b)setting rpath is required to find CUDA
backends.append(("opencl", "OpenCL",
Expand Down Expand Up @@ -192,11 +193,19 @@
with open(os.path.join(genn_path, "version.txt")) as version_file:
version = version_file.read().strip()

# Create custom build command which build extensions BEFORE collecting Python modules
# https://stackoverflow.com/a/26556654
class build(_build):
sub_commands = [("build_ext", _build.has_ext_modules),
("build_py", _build.has_pure_modules),
("build_clib", _build.has_c_libraries),
("build_scripts", _build.has_scripts)]

setup(name = "pygenn",
version = version,
packages = find_packages(),
package_data={"pygenn": package_data},

cmdclass = {"build": build},
url="https://github.com/genn-team/genn",
author="University of Sussex",
description="Python interface to the GeNN simulator",
Expand Down