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

[ENH] Move to pyproject.toml #608

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8768c83
added metadata to pyproject.toml
Nov 21, 2023
80d8d8f
added dependencies
Nov 21, 2023
3ea8531
added build-system
Nov 21, 2023
f9199d1
fix formatting
Nov 21, 2023
444a7c3
build fim module using setup.py
Nov 21, 2023
9952f5c
remove description from CITATION.txt, leave reference to docs
Nov 22, 2023
2053676
fix formatting of pyproject.toml
Nov 22, 2023
51fe31e
use requirement files for dependencies
Nov 22, 2023
60933ee
add somesy config
Nov 22, 2023
210a994
update somesy config
Nov 22, 2023
c7bfe25
remove somesy config
Nov 22, 2023
b8a9f80
update license field
Nov 22, 2023
f60257a
add wheel to build dependencies
Nov 22, 2023
0db66d4
define packages for setuptools
Nov 22, 2023
e7e29f9
Merge branch 'NeuralEnsemble:master' into enh/pyproject.toml
Moritz-Alexander-Kern Apr 4, 2024
42c7664
Merge branch 'NeuralEnsemble:master' into enh/pyproject.toml
Moritz-Alexander-Kern Apr 4, 2024
0aad87a
Merge branch 'master' into enh/pyproject.toml
Moritz-Alexander-Kern Sep 4, 2024
f89e1cf
remove setup.py
Moritz-Alexander-Kern Sep 4, 2024
db354a2
update ci build wheel action
Moritz-Alexander-Kern Sep 4, 2024
d47ba19
update build wheel action
Moritz-Alexander-Kern Sep 4, 2024
beab2e4
update ci build wheel action
Moritz-Alexander-Kern Sep 4, 2024
b7e4fa0
update cibuildwheel action
Moritz-Alexander-Kern Sep 4, 2024
f6a043f
update os for building wheels
Moritz-Alexander-Kern Sep 4, 2024
24e225a
change compile args for linux
Moritz-Alexander-Kern Sep 4, 2024
158aa29
update python version for cibuildwheels
Moritz-Alexander-Kern Sep 4, 2024
3533692
update ci buildwheel action
Moritz-Alexander-Kern Sep 4, 2024
d5b929f
update compile args
Moritz-Alexander-Kern Sep 4, 2024
77069b8
re add setup.py
Moritz-Alexander-Kern Sep 4, 2024
83de7f2
update cibuildwheel version
Moritz-Alexander-Kern Sep 4, 2024
c0b4899
typo
Moritz-Alexander-Kern Sep 4, 2024
571605d
typo
Moritz-Alexander-Kern Sep 4, 2024
8140864
build wheels
Moritz-Alexander-Kern Sep 16, 2024
eebdb06
update python version
Moritz-Alexander-Kern Sep 16, 2024
5c3fb6e
update cibuildwheel
Moritz-Alexander-Kern Sep 16, 2024
650edf2
Merge branch 'master' into enh/pyproject.toml
Moritz-Alexander-Kern Dec 10, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -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"

Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ env/
.pytest_cache/
**/*/__pycache__
*.vscode

.mypy_cache
.ruff_cache
.venv
# Compiled source #
###################
*.a
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
56 changes: 4 additions & 52 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
# -*- coding: utf-8 -*-
import os.path
import platform
import sys

from setuptools import setup, Extension
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',
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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": "[email protected]",
"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}
Expand Down
Loading