-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #892 from tsalo/schema-package
[SCHEMA] Reorganize schema code into a package
- Loading branch information
Showing
23 changed files
with
3,321 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
*.png -text | ||
*.jpg -text | ||
*.webm -text | ||
tools/schemacode/schemacode/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: "schemacode_ci" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
paths: | ||
- "tools/schemacode/**" | ||
- "src/schema/**" | ||
pull_request: | ||
branches: | ||
- "*" | ||
paths: | ||
- "tools/schemacode/**" | ||
- "src/schema/**" | ||
|
||
jobs: | ||
check_skip: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.result_step.outputs.ci-skip }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- id: result_step | ||
uses: mstachniuk/ci-skip@master | ||
with: | ||
commit-filter: "[skip ci];[ci skip];[skip github]" | ||
commit-filter-separator: ";" | ||
|
||
run_tests: | ||
needs: check_skip | ||
if: ${{ needs.check_skip.outputs.skip == 'false' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
name: ${{ matrix.os }} with Python ${{ matrix.python-version }} | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: "Set up Python" | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: "Display Python version" | ||
shell: bash {0} | ||
run: python -c "import sys; print(sys.version)" | ||
|
||
- name: "Install the schemacode package" | ||
shell: bash {0} | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install -e ./tools/schemacode[tests] | ||
- name: "Run tests" | ||
shell: bash {0} | ||
run: | | ||
python -m pytest --pyargs schemacode --cov=schemacode ./tools/schemacode/ | ||
- name: "Upload coverage to CodeCov" | ||
uses: codecov/codecov-action@v1 | ||
if: success() | ||
|
||
flake8-lint: | ||
runs-on: ubuntu-latest | ||
name: Lint schemacode | ||
steps: | ||
- name: Check out source repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python environment | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.7" | ||
|
||
- name: "Install the schemacode package" | ||
shell: bash {0} | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install -e ./tools/schemacode[tests] | ||
- name: "Run flake8" | ||
working-directory: ./tools/schemacode/ | ||
shell: bash {0} | ||
run: | | ||
flake8 . |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include versioneer.py | ||
include schemacode/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# schemacode | ||
|
||
A Python library for working with the BIDS schema. | ||
|
||
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) | ||
[![codecov](https://codecov.io/gh/bids-standard/bids-specification/branch/master/graph/badge.svg)](https://codecov.io/gh/bids-standard/bids-specification) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
|
||
[tool.black] | ||
line-length = 99 | ||
target-version = ['py37'] | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
( | ||
/( | ||
\.eggs # exclude a few common directories in the | ||
| \.git # root of the project | ||
| \.github | ||
| \.hg | ||
| \.pytest_cache | ||
| _build | ||
| build | ||
| dist | ||
)/ | ||
| versioneer.py | ||
| schemacode/_version.py | ||
) | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
multi_line_output = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""A Python package for working with the BIDS schema.""" | ||
from . import render, schema, utils | ||
|
||
__all__ = [ | ||
"render", | ||
"schema", | ||
"utils", | ||
] | ||
|
||
from . import _version | ||
|
||
__version__ = _version.get_versions()["version"] |
Oops, something went wrong.