Skip to content

Commit 3b17036

Browse files
authored
Merge pull request #12 from effigies/enh/subpackages
ENH: Add a test subpackage to ensure packages are installed
2 parents 90ca272 + 8dc7696 commit 3b17036

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ All tasks will be inserted into the `pydra.tasks.<yourtaskpackagename>` namespac
1313
1. One of the folders is called TODO. This should also be renamed to your package
1414
name.
1515
1. Add tasks to the `pydra/tasks/<yourpackagename>` folder.
16+
1. An example subpackage is found in `pydra/tasks/<yourpackagename>/utils`.
17+
You may wish to add tools to it or delete it.
1618
1. You may want to initialize a [Sphinx] docs directory.
1719
1. **Update this README after creating the new repository.**
1820

pydra/tasks/TODO/utils/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""
2+
This is a basic doctest demonstrating that subpackags can also be
3+
imported.
4+
5+
>>> import pydra.tasks.TODO.utils
6+
"""

setup.cfg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ test_requires =
1919
pytest-rerunfailures
2020
codecov
2121

22-
packages = pydra.tasks.%(subpackage)s
23-
2422
[options.extras_require]
2523
doc =
2624
packaging

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/usr/bin/env python
22
import sys
33

4-
from setuptools import setup
4+
from setuptools import setup, find_namespace_packages
55
import versioneer
66

7+
SUBPACKAGE = "TODO"
8+
79
# Give setuptools a hint to complain if it's too old a version
810
# 30.3.0 allows us to put most metadata in setup.cfg
911
# Should match pyproject.toml
@@ -13,8 +15,11 @@
1315

1416
if __name__ == "__main__":
1517
setup(
16-
name="pydra-TODO",
18+
name=f"pydra-{SUBPACKAGE}",
1719
setup_requires=SETUP_REQUIRES,
1820
version=versioneer.get_version(),
1921
cmdclass=versioneer.get_cmdclass(),
22+
packages=find_namespace_packages(
23+
include=(f"pydra.tasks.{SUBPACKAGE}", f"pydra.tasks.{SUBPACKAGE}.*")
24+
),
2025
)

0 commit comments

Comments
 (0)