diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index b5dbea1f9..deaead7cb 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019] + os: [ubuntu-22.04, windows-2019] steps: - uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: - name: Install cibuildwheel run: | python -m pip install --upgrade pip - python -m pip install cibuildwheel==2.16.2 + python -m pip install cibuildwheel==2.21.0 - name: Install libomp if: runner.os == 'macOS' @@ -37,7 +37,7 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "cp27-* cp33-* cp34-* cp35-* cp36-* cp37-* pp*" + CIBW_SKIP: cp36-* cp37-* pp*" CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" CIBW_ARCHS: "auto64" diff --git a/.gitignore b/.gitignore index 6f6651146..f201f8a60 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,9 @@ env/ .pytest_cache/ **/*/__pycache__ *.vscode - +.mypy_cache +.ruff_cache +.venv # Compiled source # ################### *.a diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..bfc880eda --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +requires = ["setuptools >= 61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "elephant" +dynamic = [ + "version", + "dependencies", + "optional-dependencies"] +description = "Elephant (Electrophysiology Analysis Toolkit) is an open-source, community centered library for the analysis of electrophysiological data in the Python programming language. The focus of Elephant is on generic analysis functions for spike train data and time series recordings from electrodes, such as the local field potentials (LFP) or intracellular voltages.In addition to providing a common platform for analysis code from different laboratories, the Elephant project aims to provide a consistent and homogeneous analysis framework that is built on a modular foundation. \nElephant is the direct successor to Neurotools and maintains ties to complementary projects such as OpenElectrophy and spykeviewer." +license = {file = "LICENSE.txt"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Scientific/Engineering"] +keywords = ["neuroscience", "neurophysiology", "electrophysiology", "statistics", "data-analysis"] +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">= 3.8" + +[project.urls] +Homepage = "http://python-elephant.org" +Documentation = "https://elephant.readthedocs.io/en/latest/" +Repository = "https://github.com/NeuralEnsemble/elephant" +Issues = "https://github.com/NeuralEnsemble/elephant/issues" +Changelog = "https://github.com/NeuralEnsemble/elephant/releases" + +[tool.setuptools.dynamic.optional-dependencies] +docs = {file = ["requirements/requirements-docs.txt"]} +extras = {file = ["requirements/requirements-extras.txt"]} +opencl = {file = ["requirements/requirements-opencl.txt"]} +cuda = {file = ["requirements/requirements-cuda.txt"]} +tests = {file = ["requirements/requirements-tests.txt"]} +tutorials = {file = ["requirements/requirements-tutorials.txt"]} + +[tool.setuptools.dynamic] +version = {file = "elephant/VERSION"} +dependencies = {file = ["requirements/requirements.txt"]} + +[tool.setuptools] +packages = ["elephant", "elephant.test"] + +# This file was created following this guide: +# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml diff --git a/setup.py b/setup.py index a5abae0ed..9fc62c74b 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -import os.path import platform import sys @@ -7,19 +5,6 @@ from setuptools.command.install import install from setuptools.command.develop import develop -with open(os.path.join(os.path.dirname(__file__), - "elephant", "VERSION")) as version_file: - version = version_file.read().strip() - -with open("README.md") as f: - long_description = f.read() -with open('requirements/requirements.txt') as fp: - install_requires = fp.read().splitlines() -extras_require = {} -for extra in ['extras', 'docs', 'tests', 'tutorials', 'cuda', 'opencl']: - with open('requirements/requirements-{0}.txt'.format(extra)) as fp: - extras_require[extra] = fp.read() - if platform.system() == "Windows": fim_module = Extension( name='elephant.spade_src.fim', @@ -30,7 +15,7 @@ extra_compile_args=[ '-DMODULE_NAME=fim', '-DUSE_OPENMP', '-DWITH_SIG_TERM', '-Dfim_EXPORTS', '-fopenmp', '/std:c++17'], - optional=True + #optional=True ) elif platform.system() == "Darwin": fim_module = Extension( @@ -45,7 +30,7 @@ '-Weffc++', '-Wunused-result', '-Werror', '-Werror=return-type', '-Xpreprocessor', '-fopenmp', '-std=gnu++17'], - optional=True + #optional=True ) elif platform.system() == "Linux": fim_module = Extension( @@ -59,43 +44,10 @@ '-Dfim_EXPORTS', '-O3', '-pedantic', '-Wextra', '-Weffc++', '-Wunused-result', '-Werror', '-fopenmp', '-std=gnu++17'], - optional=True + #optional=True ) -setup_kwargs = { - "name": "elephant", - "version": version, - "packages": ['elephant', 'elephant.test'], - "include_package_data": True, - "install_requires": install_requires, - "extras_require": extras_require, - "author": "Elephant authors and contributors", - "author_email": "contact@python-elephant.org", - "description": "Elephant is a package for analysis of electrophysiology data in Python", # noqa - "long_description": long_description, - "long_description_content_type": "text/markdown", - "license": "BSD", - "url": 'http://python-elephant.org', - "project_urls": { - "Bug Tracker": "https://github.com/NeuralEnsemble/elephant/issues", - "Documentation": "https://elephant.readthedocs.io/en/latest/", - "Source Code": "https://github.com/NeuralEnsemble/elephant", - }, - "python_requires": ">=3.8", - "classifiers": [ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Scientific/Engineering'] -} +setup_kwargs = {} # no compile options and corresponding extensions options = {"--no-compile": None, "--no-compile-spade": fim_module}