Skip to content

Commit

Permalink
Move project config to pyproject.toml, remove BINDER support (#1202)
Browse files Browse the repository at this point in the history
* move project config to pyproject.toml

* remove BINDER support

* do not repeat deps in opt deps

* organize opt dep subgroups more DRY

* need defusedxml for some BrainVision ops

* Reformat pyproject.toml with Even better TOML extension

https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml

* defusedxml only for doc, not proj

* ignore .ruff_cache

---------

Co-authored-by: Richard Höchenberger <[email protected]>
  • Loading branch information
sappelhoff and hoechenberger authored Dec 7, 2023
1 parent aaa9a3a commit a34274d
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 192 deletions.
18 changes: 7 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
# restore cache from last build. Unless __init__.py has changed since then
- restore_cache:
keys:
- data-cache-5-{{ checksum "./mne_bids/__init__.py" }}
- data-cache-0-{{ checksum "./mne_bids/__init__.py" }}

# Also restore pip cache to speed up installations
- restore_cache:
keys:
- pip-cache-1-{{ checksum "./test_requirements.txt" }}-{{ checksum "./doc/requirements.txt" }}
- pip-cache-0-{{ checksum "./pyproject.toml" }}

- run:
name: Setup Python3 environment
Expand All @@ -41,10 +41,8 @@ jobs:
name: Install Python packages
command: |
python -m pip install --upgrade --progress-bar off pip
python -m pip install --upgrade --progress-bar off -r test_requirements.txt
python -m pip install --upgrade --progress-bar off -r doc/requirements.txt
python -m pip install --upgrade https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
python -m pip install -e .
python -m pip install -e .[test,doc]
- run:
name: Build the documentation
Expand All @@ -62,13 +60,13 @@ jobs:

# Store the data cache
- save_cache:
key: data-cache-5-{{ checksum "./mne_bids/__init__.py" }}
key: data-cache-0-{{ checksum "./mne_bids/__init__.py" }}
paths:
- ~/mne_data

# Store pip cache
- save_cache:
key: pip-cache-1-{{ checksum "./test_requirements.txt" }}-{{ checksum "./doc/requirements.txt" }}
key: pip-cache-0-{{ checksum "./pyproject.toml" }}
paths:
- ~/.cache/pip

Expand Down Expand Up @@ -112,7 +110,7 @@ jobs:

- restore_cache:
keys:
- pip-cache-1-{{ checksum "./test_requirements.txt" }}-{{ checksum "./doc/requirements.txt" }}
- pip-cache-0-{{ checksum "./pyproject.toml" }}

- run:
name: Setup Python3 environment
Expand All @@ -124,10 +122,8 @@ jobs:
name: Install Python packages
command: |
python -m pip install --upgrade --progress-bar off pip
python -m pip install --upgrade --progress-bar off -r test_requirements.txt
python -m pip install --upgrade --progress-bar off -r doc/requirements.txt
python -m pip install --upgrade https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
python -m pip install -e .
python -m pip install -e .[test,doc]
- run:
name: Check links
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
branches: ['**']
pull_request:
branches: ['**']
create:
branches: [main]
tags: ['**']
schedule:
- cron: "0 4 * * *"

Expand All @@ -32,7 +29,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: style-0-${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test_requirements.txt') }}
key: style-0-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -60,7 +57,7 @@ jobs:
- uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: build-2-${{ env.pythonLocation }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test_requirements.txt') }}
key: build-0-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}

- name: Install dependencies
run: |
Expand Down Expand Up @@ -177,12 +174,13 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: test-1-${{ env.pythonLocation }}-${{ env.os }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('test_requirements.txt') }}
key: test-0-${{ env.pythonLocation }}-${{ env.os }}-${{ hashFiles('pyproject.toml') }}

- name: Install Python dependencies using pip
# This would be nicer once this feature is implemented: https://github.com/pypa/pip/issues/11440
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade -r test_requirements.txt
python -m pip install -e .[test]
- name: Install MNE (stable)
if: matrix.mne-version == 'mne-stable'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build
coverage
*.xml
.venv
.ruff_cache

# Sphinx documentation
doc/_build/
Expand Down
14 changes: 1 addition & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,13 @@ Then, `git clone` your fork and install it in "editable" mode.
```Shell
git clone https://github.com/<your-GitHub-username>/mne-bids
cd ./mne-bids
pip install -e .[full]
pip install -e .[dev]
git config --local blame.ignoreRevsFile .git-blame-ignore-revs
```

The last command is needed for `git diff` to work properly.
You should now have both the `mne` and `mne-bids` development versions available in your Python environment.

### Install additional Python packages required for development

Navigate to the root of the `mne-bids` repository and call:

```Shell
pip install -r test_requirements.txt
pip install -r doc/requirements.txt
```

This will install several packages for running tests and building the documentation for `mne-bids`.

### Install the BIDS validator

For a complete development setup of `mne-bids`, it is necessary to install the
Expand Down Expand Up @@ -137,7 +126,6 @@ We suggest installing our git pre-commit hooks to automatically run style
checks before a commit is created:

```Shell
pip install pre-commit
pre-commit install
```

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ exclude Makefile
exclude CONTRIBUTING.md
exclude *.yml
exclude .mailmap
exclude test_requirements.txt
exclude .gitignore
exclude .pre-commit-config.yaml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test:
--doctest-modules \
--cov=mne_bids mne_bids/tests/ mne_bids/commands/tests/ \
--cov-report=xml \
--cov-config=setup.cfg \
--cov-config=pyproject.toml \
--verbose \
--ignore mne-python \
--ignore examples
Expand Down
23 changes: 0 additions & 23 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,6 @@
}
intersphinx_timeout = 5

# Resolve binder filepath_prefix. From the docs:
# "A prefix to append to the filepath in the Binder links. You should use this
# if you will store your built documentation in a sub-folder of a repository,
# instead of in the root."
# we will store dev docs in a `dev` subdirectory and all other docs in a
# directory "v" + version_str. E.g., "v0.3"
if "dev" in version:
filepath_prefix = "dev"
else:
filepath_prefix = "v{}".format(version)

sphinx_gallery_conf = {
"doc_module": "mne_bids",
"reference_url": {
Expand All @@ -193,16 +182,4 @@
"within_subsection_order": ExampleTitleSortKey,
"gallery_dirs": "auto_examples",
"filename_pattern": "^((?!sgskip).)*$",
"binder": {
# Required keys
"org": "mne-tools",
"repo": "mne-bids",
"branch": "gh-pages", # noqa: E501 Can be any branch, tag, or commit hash. Use a branch that hosts your docs.
"binderhub_url": "https://mybinder.org", # noqa: E501 Any URL of a binderhub deployment. Must be full URL (e.g. https://mybinder.org).
"filepath_prefix": filepath_prefix, # noqa: E501 A prefix to prepend to any filepaths in Binder links.
"dependencies": [
"../test_requirements.txt",
"./requirements.txt",
],
},
}
1 change: 0 additions & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Optional:
* ``EDFlib-Python`` (>=1.0.6, for writing EDF data with ``mne`` versions <1.7)
* ``edfio`` (>=0.2.1, for writing EDF data)


We recommend installing ``mne-bids`` into an isolated Python environment,
for example created via ``conda``
(may be obtained through `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_).
Expand Down
12 changes: 0 additions & 12 deletions doc/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions examples/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ Examples
--------

The following examples demonstrate some common use-cases of MNE-BIDS.
Each example has a badge called "Binder" at the end. By clicking on that badge,
you can interactively run the examples in your browser.

The examples are loosely ordered from basic to more advanced use cases.
Loading

0 comments on commit a34274d

Please sign in to comment.