-
Notifications
You must be signed in to change notification settings - Fork 2
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 #35 from nipype/src-dir
Adds fileformats sub-packages and refactors pyproject and github actions
- Loading branch information
Showing
14 changed files
with
329 additions
and
17 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 |
---|---|---|
|
@@ -10,6 +10,7 @@ __pycache__/ | |
.Python | ||
build/ | ||
develop-eggs/ | ||
_version.py | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
|
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 |
---|---|---|
|
@@ -3,15 +3,17 @@ requires = ["hatchling", "hatch-vcs"] | |
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "pydra-tasks-CHANGEME" | ||
name = "pydra-CHANGEME" | ||
description = "Pydra tasks package for CHANGEME" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"pydra >=0.22", | ||
"fileformats >=0.8.3", | ||
"fileformats-datascience >=0.1", | ||
"fileformats-medimage >=0.4.1"] | ||
"fileformats-medimage >=0.4.1", | ||
"fileformats-medimage-CHANGEME" | ||
] | ||
license = {file = "LICENSE"} | ||
authors = [{name = "Nipype developers", email = "[email protected]"}] | ||
maintainers = [{name = "Nipype developers", email = "[email protected]"}] | ||
|
@@ -51,6 +53,7 @@ test = [ | |
"fileformats-extras", | ||
"fileformats-datascience-extras", | ||
"fileformats-medimage-extras", | ||
"fileformats-medimage-CHANGEME-extras" | ||
] | ||
|
||
[tool.hatch.version] | ||
|
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,37 @@ | ||
import os | ||
import logging | ||
from pathlib import Path | ||
import tempfile | ||
import pytest | ||
|
||
# Set DEBUG logging for unittests | ||
|
||
log_level = logging.WARNING | ||
|
||
logger = logging.getLogger("fileformats") | ||
logger.setLevel(log_level) | ||
|
||
sch = logging.StreamHandler() | ||
sch.setLevel(log_level) | ||
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | ||
sch.setFormatter(formatter) | ||
logger.addHandler(sch) | ||
|
||
|
||
# For debugging in IDE's don't catch raised exceptions and let the IDE | ||
# break at it | ||
if os.getenv("_PYTEST_RAISE", "0") != "0": | ||
|
||
@pytest.hookimpl(tryfirst=True) | ||
def pytest_exception_interact(call): | ||
raise call.excinfo.value | ||
|
||
@pytest.hookimpl(tryfirst=True) | ||
def pytest_internalerror(excinfo): | ||
raise excinfo.value | ||
|
||
|
||
@pytest.fixture | ||
def work_dir(): | ||
work_dir = tempfile.mkdtemp() | ||
return Path(work_dir) |
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,13 @@ | ||
Copyright 2021 Nipype developers | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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,29 @@ | ||
FileFormats-CHANGEME Extras | ||
====================================== | ||
.. image:: https://github.com/nipype/pydra-freesurfer/actions/workflows/ci-cd.yaml/badge.svg | ||
:target: https://github.com/nipype/pydra-freesurfer/actions/workflows/ci-cd.yaml | ||
|
||
|
||
This is a extras module for the `fileformats-CHANGEME <https://github.com/nipype/pydra-freesurfer/>`__ | ||
fileformats extension package, which provides additional functionality to format classes (i.e. aside | ||
from basic identification and validation), such as conversion tools, metadata parsers, test data generators, etc... | ||
|
||
|
||
Quick Installation | ||
------------------ | ||
|
||
This extension can be installed for Python 3 using *pip*:: | ||
|
||
$ pip3 install fileformats-CHANGEME-extras | ||
|
||
This will install the core package and any other dependencies | ||
|
||
License | ||
------- | ||
|
||
This work is licensed under a | ||
`Creative Commons Attribution 4.0 International License <http://creativecommons.org/licenses/by/4.0/>`_ | ||
|
||
.. image:: https://i.creativecommons.org/l/by/4.0/88x31.png | ||
:target: http://creativecommons.org/licenses/by/4.0/ | ||
:alt: Creative Commons Attribution 4.0 International License |
1 change: 1 addition & 0 deletions
1
related-packages/fileformats-extras/fileformats/extras/medimage_CHANGEME/__init__.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 @@ | ||
from ._version import __version__ |
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,87 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "fileformats-medimage-CHANGEME-extras" | ||
description = "Extensions to add functionality to tool-specific *fileformats* classes" | ||
readme = "README.rst" | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"fileformats", | ||
"fileformats-medimage-CHANGEME", | ||
"pydra >= 0.23.0a" | ||
] | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Thomas G. Close", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "Thomas G. Close", email = "[email protected]"}, | ||
] | ||
keywords = [ | ||
"file formats", | ||
"data", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black", | ||
"pre-commit", | ||
"codespell", | ||
"flake8", | ||
"flake8-pyproject", | ||
] | ||
test = [ | ||
"pytest >=6.2.5", | ||
"pytest-env>=0.6.2", | ||
"pytest-cov>=2.12.1", | ||
"codecov", | ||
] | ||
|
||
converters = [ | ||
] | ||
|
||
[project.urls] | ||
repository = "https://github.com/nipype/pydra-CHANGEME" | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
raw-options = { root = "../.." } | ||
|
||
[tool.hatch.build.hooks.vcs] | ||
version-file = "fileformats/extras/medimage_CHANGEME/_version.py" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["fileformats"] | ||
|
||
[tool.black] | ||
target-version = ['py38'] | ||
exclude = "fileformats/extras/medimage_CHANGEME/_version.py" | ||
|
||
[tool.codespell] | ||
ignore-words = ".codespell-ignorewords" | ||
|
||
[tool.flake8] | ||
doctests = true | ||
per-file-ignores = [ | ||
"__init__.py:F401" | ||
] | ||
max-line-length = 88 | ||
select = "C,E,F,W,B,B950" | ||
extend-ignore = ['E203', 'E501', 'E129'] |
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,13 @@ | ||
Copyright 2021 Nipype developers | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
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,39 @@ | ||
How to customise this template | ||
============================== | ||
|
||
#. Rename the `related-packages/fileformats/CHANGEME` directory to the name of the fileformats subpackage (e.g. `medimage_fsl`) | ||
#. Search and replace "CHANGEME" with the name of the fileformats subpackage the extras are to be added | ||
#. Replace name + email placeholders in `pyproject.toml` for developers and maintainers | ||
#. Add the extension file-format classes | ||
#. Ensure that all the extension file-format classes are imported into the extras package root, i.e. `fileformats/CHANGEME` | ||
#. Delete these instructions | ||
|
||
... | ||
|
||
FileFormats Extension - CHANGEME | ||
==================================== | ||
.. image:: https://github.com/nipype/pydra-CHANGEME/actions/workflows/ci-cd.yml/badge.svg | ||
:target: https://github.com/nipype/pydra-CHANGEME/actions/workflows/ci-cd.yml | ||
|
||
This is the "CHANGEME" extension module for the | ||
`fileformats <https://github.com/ArcanaFramework/fileformats-core>`__ package | ||
|
||
|
||
Quick Installation | ||
------------------ | ||
|
||
This extension can be installed for Python 3 using *pip*:: | ||
|
||
$ pip3 install fileformats-CHANGEME | ||
|
||
This will install the core package and any other dependencies | ||
|
||
License | ||
------- | ||
|
||
This work is licensed under a | ||
`Creative Commons Attribution 4.0 International License <http://creativecommons.org/licenses/by/4.0/>`_ | ||
|
||
.. image:: https://i.creativecommons.org/l/by/4.0/88x31.png | ||
:target: http://creativecommons.org/licenses/by/4.0/ | ||
:alt: Creative Commons Attribution 4.0 International License |
1 change: 1 addition & 0 deletions
1
related-packages/fileformats/fileformats/medimage_CHANGEME/__init__.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 @@ | ||
from ._version import __version__ |
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,84 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "fileformats-medimage-CHANGEME" | ||
description = "Classes for representing different file formats in Python classes for use in type hinting in data workflows" | ||
readme = "README.rst" | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"fileformats", | ||
"fileformats-medimage" | ||
] | ||
license = {file = "LICENSE"} | ||
authors = [ | ||
{name = "Thomas G. Close", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "Thomas G. Close", email = "[email protected]"}, | ||
] | ||
keywords = [ | ||
"file formats", | ||
"data", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Scientific/Engineering", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black", | ||
"pre-commit", | ||
"codespell", | ||
"flake8", | ||
"flake8-pyproject", | ||
] | ||
test = [ | ||
"pytest >=6.2.5", | ||
"pytest-env>=0.6.2", | ||
"pytest-cov>=2.12.1", | ||
"codecov", | ||
"fileformats-medimage-CHANGME-extras", | ||
] | ||
|
||
[project.urls] | ||
repository = "https://github.com/nipype/pydra-CHANGEME" | ||
|
||
[tool.hatch.version] | ||
source = "vcs" | ||
raw-options = { root = "../.." } | ||
|
||
[tool.hatch.build.hooks.vcs] | ||
version-file = "fileformats/medimage_CHANGEME/_version.py" | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["fileformats"] | ||
|
||
[tool.black] | ||
target-version = ['py38'] | ||
exclude = "fileformats/medimage_CHANGEME/_version.py" | ||
|
||
[tool.codespell] | ||
ignore-words = ".codespell-ignorewords" | ||
|
||
[tool.flake8] | ||
doctests = true | ||
per-file-ignores = [ | ||
"__init__.py:F401" | ||
] | ||
max-line-length = 88 | ||
select = "C,E,F,W,B,B950" | ||
extend-ignore = ['E203', 'E501', 'E129'] |
Oops, something went wrong.