Skip to content

Commit d7e2ed8

Browse files
authored
Merge pull request #1180 from samuelgarcia/pyproject
Move from setup.py to pyproject.toml
2 parents d2fb213 + 9ea34c6 commit d7e2ed8

File tree

13 files changed

+116
-107
lines changed

13 files changed

+116
-107
lines changed

.github/workflows/io-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
# "macos-latest", "windows-latest"
2121
os: ["ubuntu-latest", ]
22-
python-version: ['3.8', ]
22+
python-version: ['3.9', ]
2323
defaults:
2424
# by default run in bash mode (required for conda usage)
2525
run:
@@ -59,7 +59,7 @@ jobs:
5959
id: cache-conda-env
6060
with:
6161
path: /usr/share/miniconda/envs/neo-test-env
62-
key: ${{ runner.os }}-conda-env-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_testing.txt') }}-${{ hashFiles('**/environment_testing.txt') }}-${{ steps.date.outputs.date }}
62+
key: ${{ runner.os }}-conda-env-${{ hashFiles('**/pyproject.toml') }}-${{ steps.date.outputs.date }}
6363

6464
- name: Install testing dependencies
6565
# testing environment is only installed if no cache was found
@@ -75,6 +75,7 @@ jobs:
7575
- name: Install neo
7676
run: |
7777
pip install --upgrade -e .
78+
pip install .[test]
7879
7980
- name: Test with pytest
8081
run: |

.readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ python:
1212
install:
1313
- method: pip
1414
path: .
15-
- requirements: doc/requirements_docs.txt
15+
extra_requirements:
16+
- docs
17+

doc/requirements_docs.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/source/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313

1414
import os
1515
import sys
16+
import re
1617

1718
from packaging.version import Version
1819

19-
with open("../../neo/version.py") as fp:
20-
d = {}
21-
exec(fp.read(), d)
22-
neo_release = d['version']
20+
with open('../../pyproject.toml', mode='r') as f:
21+
txt = f.read()
22+
neo_release = re.findall('version = "(\S+)"', txt)[0]
2323

2424
neo_version = '.'.join((str(e) for e in Version(neo_release).release[:2]))
2525

26-
2726
AUTHORS = 'Neo authors and contributors <[email protected]>'
2827

2928
# If extensions (or modules to document with autodoc) are in another directory,

environment_testing.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ channels:
44
dependencies:
55
- datalad
66
- pip
7-
- pip:
8-
- -r requirements_testing.txt

neo/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
Neo is a package for representing electrophysiology data in Python,
33
together with support for reading a wide range of neurophysiology file formats
44
'''
5+
import importlib.metadata
6+
# this need to be at the begining because some sub module will need the version
7+
__version__ = importlib.metadata.version("neo")
58

69
import logging
710

@@ -10,4 +13,3 @@
1013
from neo.core import *
1114
from neo.io import *
1215

13-
from neo.version import version as __version__

neo/io/nixio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
IrregularlySampledSignal, Epoch, Event, SpikeTrain,
3838
ImageSequence, ChannelView, Group)
3939
from ..io.proxyobjects import BaseProxy
40-
from ..version import version as neover
40+
from .. import __version__ as neover
4141

4242

4343
datetime_types = (date, time, datetime)

neo/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[project]
2+
name = "neo"
3+
version = "0.12.0.dev0"
4+
authors = [{name = "Neo authors and contributors"}]
5+
description = "Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats"
6+
readme = "README.rst"
7+
requires-python = ">=3.8"
8+
license = {text = "BSD 3-Clause License"}
9+
classifiers = [
10+
"Development Status :: 4 - Beta",
11+
"Programming Language :: Python :: 3",
12+
"Operating System :: OS Independent",
13+
"Intended Audience :: Science/Research",
14+
"Natural Language :: English",
15+
"Topic :: Scientific/Engineering",
16+
"License :: OSI Approved :: BSD License",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3 :: Only",
22+
]
23+
24+
dependencies = [
25+
"packaging",
26+
"numpy>=1.19.5",
27+
"quantities>=0.14.0",
28+
]
29+
30+
[project.urls]
31+
homepage = "https://neuralensemble.org/neo"
32+
documentation = "http://neo.readthedocs.io/"
33+
repository = "https://github.com/NeuralEnsemble/python-neo"
34+
download = "http://pypi.python.org/pypi/neo"
35+
36+
37+
[build-system]
38+
requires = ["setuptools>=62.0"]
39+
build-backend = "setuptools.build_meta"
40+
41+
[project.optional-dependencies]
42+
43+
test = [
44+
"pytest",
45+
"pytest-cov",
46+
# datalad # this dependency is covered by conda (environment_testing.yml)
47+
"scipy>=1.0.0",
48+
"pyedflib",
49+
"h5py",
50+
"igor",
51+
"klusta",
52+
"tqdm",
53+
"nixio",
54+
"matplotlib",
55+
"ipython",
56+
"coverage",
57+
"coveralls",
58+
"pillow",
59+
"sonpy",
60+
"pynwb",
61+
"probeinterface",
62+
]
63+
64+
docs = [
65+
"docutils<0.18",
66+
]
67+
68+
igorproio = ["igor"]
69+
kwikio = ["klusta"]
70+
neomatlabio = ["scipy>=1.0.0"]
71+
nixio = ["nixio>=1.5.0"]
72+
stimfitio = ["stfio"]
73+
tiffio = ["pillow"]
74+
edf = ["pyedflib"]
75+
ced = ["sonpy"]
76+
nwb = ["pynwb"]
77+
maxwell = ["h5py"]
78+
biocam = ["h5py"]
79+
80+
all = [
81+
"coverage",
82+
"coveralls",
83+
"h5py",
84+
"igor",
85+
"ipython",
86+
"klusta",
87+
"matplotlib",
88+
"nixio>=1.5.0",
89+
"pillow",
90+
"probeinterface",
91+
"pyedflib",
92+
"pynwb",
93+
"pytest",
94+
"pytest-cov",
95+
"scipy>=1.0.0",
96+
"sonpy",
97+
"tqdm",
98+
]
99+
# we do not include 'stfio' in 'all' as it is not pip installable

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)