Skip to content
Closed
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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ scipy>=1.1.0
matplotlib
pyqt5>=5.10,<5.14; platform_system == "Darwin"
pyqt5>=5.10,!=5.15.2,!=5.15.3; platform_system == "Linux"
pyqt5>=5.10,!=5.15.3; platform_system != "Linux" and platform_system != "Darwin"
pyqt5>=5.10,!=5.15.3; platform_system == "Windows"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an unrelated change, but elsewhere in requirements.txt we do use platform_system == "Windows" so it seems cleaner to also use it here... unless I'm missing something?

pyqt5-sip
sip
scikit-learn
Expand Down
45 changes: 36 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@

import os
import os.path as op
import re

from setuptools import setup


def parse_requirements_file(fname):
requirements = list()
with open(fname, 'r') as fid:
for line in fid:
req = line.strip()
if req.startswith('#'):
continue
# strip end-of-line comments
req = req.split('#', maxsplit=1)[0].strip()
requirements.append(req)
return requirements


# get the version (don't import mne here, so dependencies are not needed)
version = None
with open(op.join('mne', '_version.py'), 'r') as fid:
Expand All @@ -19,10 +34,8 @@
raise RuntimeError('Could not determine version')


descr = """MNE python project for MEG and EEG data analysis."""

DISTNAME = 'mne'
DESCRIPTION = descr
DESCRIPTION = 'MNE-Python project for MEG and EEG data analysis.'
MAINTAINER = 'Alexandre Gramfort'
MAINTAINER_EMAIL = 'alexandre.gramfort@inria.fr'
URL = 'https://mne.tools/dev/'
Expand All @@ -49,14 +62,22 @@ def package_tree(pkgroot):
long_description = fid.read()

hard_dependencies = ('numpy', 'scipy')
data_dependencies = ('pooch', 'tqdm')
full_install_requires = parse_requirements_file('requirements.txt')
install_requires = list()
with open('requirements.txt', 'r') as fid:
for line in fid:
req = line.strip()
for hard_dep in hard_dependencies:
if req.startswith(hard_dep):
install_requires.append(req)
data_requires = list()
for req in full_install_requires:
pkg = re.split(r'[<>=!;]', req, maxsplit=1)[0]
if pkg in hard_dependencies:
install_requires.append(req)
elif pkg in data_dependencies:
data_requires.append(req)
for req in install_requires:
full_install_requires.remove(req)

doc_requires = parse_requirements_file('requirements_doc.txt')
test_requires = (parse_requirements_file('requirements_testing.txt') +
parse_requirements_file('requirements_testing_extra.txt'))
setup(name=DISTNAME,
maintainer=MAINTAINER,
include_package_data=True,
Expand Down Expand Up @@ -90,6 +111,12 @@ def package_tree(pkgroot):
platforms='any',
python_requires='>=3.7',
install_requires=install_requires,
extras_require={
'doc': doc_requires,
'data': data_requires,
'test': test_requires,
'full': full_install_requires
},
packages=package_tree('mne'),
package_data={'mne': [
op.join('data', 'eegbci_checksums.txt'),
Expand Down