Skip to content

Commit

Permalink
Prevent unwanted directories to be installed as Python packages (#1301)
Browse files Browse the repository at this point in the history
* Prevent unwanted directories to be installed as Python packages

* Add missing __init__.py

* Try using find_namespace_packages() with include filter instead

* Try including DMF data after changing root dir name to be more explicit

* Actually rename DMF data directory
  • Loading branch information
lbianchi-lbl authored Dec 13, 2023
1 parent 87ee4c5 commit 75a784e
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion idaes/core/dmf/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
NAME = "idaes-pse"

# Keep this the same as constant DMF_DATA_ROOT in setup.py
DMF_DATA_ROOT = "data"
DMF_DATA_ROOT = "dmf_data"

_log = logging.getLogger(__name__)

Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def rglob(path, glob):


# For included DMF data
DMF_DATA_ROOT = "data"
DMF_DATA_ROOT = "dmf_data"


def dmf_data_files(root: str = DMF_DATA_ROOT) -> List[Tuple[str, List[str]]]:
Expand Down Expand Up @@ -123,7 +123,12 @@ def __getitem__(self, key):
zip_safe=False,
name=NAME,
version=VERSION,
packages=find_namespace_packages(),
packages=find_namespace_packages(
include=[
"idaes*",
"dmf_data*",
]
),
# Put abstract (non-versioned) deps here.
# Concrete dependencies go in requirements[-dev].txt
install_requires=[
Expand Down

0 comments on commit 75a784e

Please sign in to comment.