Skip to content

Commit

Permalink
correct optional dep for publishing on PyPi (#205)
Browse files Browse the repository at this point in the history
* correct optional dep for publishing on PyPi

* update poetry lock

* putting tdlda in dev dependency

* updating workflow, do not install dev for test and remove extras for docs

* correct bug if tests is run while ~/mne_data exists

* correct test if Shin dataset already downloaded
  • Loading branch information
Sylvain Chevallier authored Jun 15, 2021
1 parent 2c1322e commit f87932f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
- name: Install dependencies
if: steps.cached-dataset-docs.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root -E external
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction -E external
run: poetry install --no-interaction

- name: Build docs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
if: |
(runner.os != 'Windows') &&
(steps.cached-poetry-dependencies.outputs.cache-hit != 'true')
run: poetry install --no-interaction --no-root
run: poetry install --no-interaction --no-root --no-dev

- name: Install library
run: poetry install --no-interaction
run: poetry install --no-interaction --no-dev

- name: Run tests
run: |
Expand Down
10 changes: 5 additions & 5 deletions moabb/tests/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

_ = mne.set_log_level("CRITICAL")

# List of dataset that requires to accept licence term:
dataset_w_accept = [Shin2017A(), Shin2017B()]


def _run_tests_on_dataset(d):
for s in d.subject_list:
Expand Down Expand Up @@ -65,5 +62,8 @@ def test_fake_dataset(self):

def test_dataset_accept(self):
"""verify that accept licence is working"""
for ds in dataset_w_accept:
self.assertRaises(AttributeError, ds.get_data, [1])
# Only Shin2017 (bbci_eeg_fnirs) for now
for ds in [Shin2017A(), Shin2017B()]:
# if the data is already downloaded:
if mne.get_config("MNE_DATASETS_BBCIFNIRS_PATH") is None:
self.assertRaises(AttributeError, ds.get_data, [1])
3 changes: 2 additions & 1 deletion moabb/tests/evaluations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
pipelines = OrderedDict()
pipelines["C"] = make_pipeline(Covariances("oas"), CSP(8), LDA())
dataset = FakeDataset(["left_hand", "right_hand"], n_subjects=2)
os.makedirs(osp.join(osp.expanduser("~"), "mne_data"))
if not osp.isdir(osp.join(osp.expanduser("~"), "mne_data")):
os.makedirs(osp.join(osp.expanduser("~"), "mne_data"))


class Test_WithinSess(unittest.TestCase):
Expand Down
9 changes: 3 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ PyYAML = "^5.0.0"
pooch = "^1.3.0"
requests = "^2.15.1"

tdlda = {git = "https://github.com/jsosulski/tdlda.git", rev = "0.1.0", optional = true}

[tool.poetry.dev-dependencies]
Sphinx = "^3.3"
sphinx-gallery = "^0.8.2"
sphinx-bootstrap-theme = "^0.7.1"
numpydoc = "^1.1.0"
m2r2 = "^0.2.7"
pre-commit = "^2.11.1"

[tool.poetry.extras]
external = ["tdlda"]
tdlda = {git = "https://github.com/jsosulski/tdlda.git", rev = "0.1.0"}

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit f87932f

Please sign in to comment.