Skip to content

Commit 510bec6

Browse files
committed
moved fileformats sub-packages into separate sub-directories
1 parent 34a9a7b commit 510bec6

File tree

11 files changed

+258
-8
lines changed

11 files changed

+258
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ All tasks will be inserted into the `pydra.tasks.<yourtaskpackagename>` namespac
1313
1. One of the folders is called CHANGEME. This should also be renamed to your package
1414
name.
1515
1. Under the newly renamed package (i.e. formerly CHANGEME) there is a directory named "v1",
16-
`pydra/tasks/<package-name>/v1`, change this to valid Python package name starting with
16+
`src/pydra/tasks/<package-name>/v1`, change this to valid Python package name starting with
1717
'v' to indicate the version of the tool the Pydra interfaces will be designed for,
18-
e.g. FSL v6.0.2 could be `pydra/tasks/fsl/v6` or `pydra/tasks/fsl/v6_0` depending on
18+
e.g. FSL v6.0.2 could be `src/pydra/tasks/fsl/v6` or `src/pydra/tasks/fsl/v6_0` depending on
1919
how stable the CLI of the tool is between minor versions.
20-
1. Edit `pydra/tasks/<package-name>/latest.py` to update references to `v1` to the
20+
1. Edit `src/pydra/tasks/<package-name>/latest.py` to update references to `v1` to the
2121
tool target version
22-
1. Add tasks to the `pydra/tasks/<package-name>/v<package-version>` folder.
22+
1. Add tasks to the `src/pydra/tasks/<package-name>/v<package-version>` folder.
2323
1. You may want to initialize a [Sphinx] docs directory.
2424
1. Review the workflow in `.github/workflows/pythonpackage.yml`. Testing editable installations
2525
is probably not useful unless you are reconfiguring namespace packages.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import logging
3+
from pathlib import Path
4+
import tempfile
5+
import pytest
6+
7+
# Set DEBUG logging for unittests
8+
9+
log_level = logging.WARNING
10+
11+
logger = logging.getLogger("fileformats")
12+
logger.setLevel(log_level)
13+
14+
sch = logging.StreamHandler()
15+
sch.setLevel(log_level)
16+
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
17+
sch.setFormatter(formatter)
18+
logger.addHandler(sch)
19+
20+
21+
# For debugging in IDE's don't catch raised exceptions and let the IDE
22+
# break at it
23+
if os.getenv("_PYTEST_RAISE", "0") != "0":
24+
25+
@pytest.hookimpl(tryfirst=True)
26+
def pytest_exception_interact(call):
27+
raise call.excinfo.value
28+
29+
@pytest.hookimpl(tryfirst=True)
30+
def pytest_internalerror(excinfo):
31+
raise excinfo.value
32+
33+
34+
@pytest.fixture
35+
def work_dir():
36+
work_dir = tempfile.mkdtemp()
37+
return Path(work_dir)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ._version import __version__
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "fileformats-medimage-CHANGEME"
7+
description = "Classes for representing different file formats in Python classes for use in type hinting in data workflows"
8+
readme = "../README.rst"
9+
requires-python = ">=3.8"
10+
dependencies = [
11+
"fileformats >= 0.4",
12+
"fileformats-medimage > = 0.2"
13+
]
14+
license = {file = "../LICENSE"}
15+
authors = [
16+
{name = "Thomas G. Close", email = "[email protected]"},
17+
]
18+
maintainers = [
19+
{name = "Thomas G. Close", email = "[email protected]"},
20+
]
21+
keywords = [
22+
"file formats",
23+
"data",
24+
]
25+
classifiers = [
26+
"Development Status :: 3 - Alpha",
27+
"Environment :: Console",
28+
"Intended Audience :: Science/Research",
29+
"License :: OSI Approved :: Apache Software License",
30+
"Operating System :: MacOS :: MacOS X",
31+
"Operating System :: Microsoft :: Windows",
32+
"Operating System :: POSIX :: Linux",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
"Topic :: Scientific/Engineering",
38+
]
39+
dynamic = ["version"]
40+
41+
[project.optional-dependencies]
42+
dev = [
43+
"black",
44+
"pre-commit",
45+
"codespell",
46+
"flake8",
47+
"flake8-pyproject",
48+
]
49+
test = [
50+
"pytest >=6.2.5",
51+
"pytest-env>=0.6.2",
52+
"pytest-cov>=2.12.1",
53+
"codecov",
54+
"fileformats-medimage-CHANGME",
55+
]
56+
57+
[project.urls]
58+
repository = "https://github.com/nipype/pydra-freesurfer"
59+
60+
[tool.hatch.version]
61+
source = "vcs"
62+
raw-options = { root = ".." }
63+
64+
[tool.hatch.build.hooks.vcs]
65+
version-file = "fileformats/medimage_freesurfer/_version.py"
66+
67+
[tool.hatch.build.targets.wheel]
68+
packages = ["fileformats"]
69+
70+
[tool.black]
71+
target-version = ['py38']
72+
exclude = "fileformats/medimage_freesurfer/_version.py"
73+
74+
[tool.codespell]
75+
ignore-words = ".codespell-ignorewords"
76+
77+
[tool.flake8]
78+
doctests = true
79+
per-file-ignores = [
80+
"__init__.py:F401"
81+
]
82+
max-line-length = 88
83+
select = "C,E,F,W,B,B950"
84+
extend-ignore = ['E203', 'E501', 'E129']
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import logging
3+
from pathlib import Path
4+
import tempfile
5+
import pytest
6+
7+
# Set DEBUG logging for unittests
8+
9+
log_level = logging.WARNING
10+
11+
logger = logging.getLogger("fileformats")
12+
logger.setLevel(log_level)
13+
14+
sch = logging.StreamHandler()
15+
sch.setLevel(log_level)
16+
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
17+
sch.setFormatter(formatter)
18+
logger.addHandler(sch)
19+
20+
21+
# For debugging in IDE's don't catch raised exceptions and let the IDE
22+
# break at it
23+
if os.getenv("_PYTEST_RAISE", "0") != "0":
24+
25+
@pytest.hookimpl(tryfirst=True)
26+
def pytest_exception_interact(call):
27+
raise call.excinfo.value
28+
29+
@pytest.hookimpl(tryfirst=True)
30+
def pytest_internalerror(excinfo):
31+
raise excinfo.value
32+
33+
34+
@pytest.fixture
35+
def work_dir():
36+
work_dir = tempfile.mkdtemp()
37+
return Path(work_dir)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from ._version import __version__
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "fileformats-medimage-CHANGEME-extras"
7+
description = "Classes for representing file formats used exclusively by the Freesurfer tool in Python classes for use in type hinting in data workflows"
8+
readme = "../README.rst"
9+
requires-python = ">=3.8"
10+
dependencies = [
11+
"fileformats >= 0.7",
12+
"fileformats-medimage-freesurfer",
13+
"pydra >= 0.22.0"
14+
]
15+
license = {file = "../LICENSE"}
16+
authors = [
17+
{name = "Thomas G. Close", email = "[email protected]"},
18+
]
19+
maintainers = [
20+
{name = "Thomas G. Close", email = "[email protected]"},
21+
]
22+
keywords = [
23+
"file formats",
24+
"data",
25+
]
26+
classifiers = [
27+
"Development Status :: 3 - Alpha",
28+
"Environment :: Console",
29+
"Intended Audience :: Science/Research",
30+
"License :: OSI Approved :: Apache Software License",
31+
"Operating System :: MacOS :: MacOS X",
32+
"Operating System :: Microsoft :: Windows",
33+
"Operating System :: POSIX :: Linux",
34+
"Programming Language :: Python :: 3.8",
35+
"Programming Language :: Python :: 3.9",
36+
"Programming Language :: Python :: 3.10",
37+
"Programming Language :: Python :: 3.11",
38+
"Topic :: Scientific/Engineering",
39+
]
40+
dynamic = ["version"]
41+
42+
[project.optional-dependencies]
43+
dev = [
44+
"black",
45+
"pre-commit",
46+
"codespell",
47+
"flake8",
48+
"flake8-pyproject",
49+
]
50+
test = [
51+
"pytest >=6.2.5",
52+
"pytest-env>=0.6.2",
53+
"pytest-cov>=2.12.1",
54+
"codecov",
55+
]
56+
57+
converters = [
58+
]
59+
60+
[project.urls]
61+
repository = "https://github.com/nipype/pydra-freesurfer"
62+
63+
[tool.hatch.version]
64+
source = "vcs"
65+
raw-options = { root = ".." }
66+
67+
[tool.hatch.build.hooks.vcs]
68+
version-file = "fileformats/extras/medimage_freesurfer/_version.py"
69+
70+
[tool.hatch.build.targets.wheel]
71+
packages = ["fileformats"]
72+
73+
[tool.black]
74+
target-version = ['py38']
75+
exclude = "fileformats/extras/medimage_freesurfer/_version.py"
76+
77+
[tool.codespell]
78+
ignore-words = ".codespell-ignorewords"
79+
80+
[tool.flake8]
81+
doctests = true
82+
per-file-ignores = [
83+
"__init__.py:F401"
84+
]
85+
max-line-length = 88
86+
select = "C,E,F,W,B,B950"
87+
extend-ignore = ['E203', 'E501', 'E129']

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ requires = ["hatchling", "hatch-vcs"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "pydra-tasks-CHANGEME"
6+
name = "pydra-CHANGEME"
77
description = "Pydra tasks package for CHANGEME"
88
readme = "README.md"
99
requires-python = ">=3.8"
1010
dependencies = [
1111
"pydra >=0.22",
1212
"fileformats >=0.8.3",
1313
"fileformats-datascience >=0.1",
14-
"fileformats-medimage >=0.4.1"]
14+
"fileformats-medimage >=0.4.1",
15+
"fileformats-medimage-CHANGEME"
16+
]
1517
license = {file = "LICENSE"}
1618
authors = [{name = "Nipype developers", email = "[email protected]"}]
1719
maintainers = [{name = "Nipype developers", email = "[email protected]"}]
@@ -51,17 +53,18 @@ test = [
5153
"fileformats-extras",
5254
"fileformats-datascience-extras",
5355
"fileformats-medimage-extras",
56+
"fileformats-medimage-CHANGEME-extras"
5457
]
5558

5659
[tool.hatch.version]
5760
source = "vcs"
5861

5962
[tool.hatch.build.hooks.vcs]
60-
version-file = "pydra/tasks/CHANGEME/_version.py"
63+
version-file = "src/pydra/tasks/CHANGEME/_version.py"
6164

6265
[tool.hatch.build.targets.wheel]
6366
packages = ["pydra"]
64-
include-only = ["pydra/tasks/CHANGEME"]
67+
include-only = ["src/pydra/tasks/CHANGEME"]
6568

6669
[tool.black]
6770
target-version = ["py38"]
File renamed without changes.

0 commit comments

Comments
 (0)