Skip to content
Snippets Groups Projects
  • Benjamin Cumming's avatar
    More robust Python installation (#971) · b43cd07e
    Benjamin Cumming authored
    Improve the Python wrapper generation and installation:
      - install a proper module that can be extended with Python code;
      - give the user more control over where to install the module (e.g. as a user package or in a virtualenv).
    
    During building, the following sub-directory is built in the build director (`CMAKE_BINARY_DIR`)
    ```
    └── python
        └── arbor
                ├── __init__.py
                ├── arbor.so
                └── VERSION
    ```
    This path can then be copied VERBATIM to the target installation path. By default this will be in `CMAKE_INSTALL_PREFIX/lib/python%d.%d/site-packages`.
    An additional CMake parameter `ARB_PYTHON_PREFIX` can be used to specify an alternative destination for installing the Python module.
    
    The Python part of the wrapper, implemented in `__init__.py` is currently very limited, only providing `__version__` and `__config__` variables.
    
    The installation guide was updated to cover the Python installation.
    Unverified
    b43cd07e
setup.py 1.22 KiB
import setuptools
import os

here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'arbor/VERSION')) as version_file:
    version_ = version_file.read().strip()

setuptools.setup(
    name='arbor',
    packages=['arbor'],
    version=version_,
    author='CSCS and FSJ',
    url='https://github.com/arbor-sim/arbor',
    description='High performance simulation of networks of multicompartment neurons.',
    long_description='',
    classifiers=[
        'Development Status :: 4 - Beta', # Upgrade to "5 - Production/Stable" on release.
        'Intended Audience :: Science/Research',
        'Topic :: Scientific/Engineering :: Build Tools',
        'License :: OSI Approved :: BSD License'
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
    ],
    project_urls={
        'Source': 'https://github.com/arbor-sim/arbor',
        'Documentation': 'https://arbor.readthedocs.io',
        'Bug Reports': 'https://github.com/arbor-sim/arbor/issues',
    },
    package_data={
        'arbor': ['VERSION', '_arbor.*.so'],
    },
    python_requires='>=3.6',
    install_requires=[],
    setup_requires=[],
    zip_safe=False,
)