Skip to content

Commit

Permalink
Merge branch 'master' into python_requires-no-upper-bound
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice authored Jun 23, 2022
2 parents fa9131a + 38b176c commit 166200e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Added

- Added support to run aggregate operations in parallel (#642, #644).

Changed
+++++++
- Deprecated configuaration key 'flow.environment_modules' (#651).
- Deprecated configuration key 'flow.import_packaged_environments' (#651).

Removed
+++++++

Expand Down
23 changes: 20 additions & 3 deletions flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
.. _signac: https://signac.io/
"""
import warnings

from . import environment, errors, hooks, scheduling, testing
from .aggregates import aggregator, get_aggregate_id
from .environment import get_environment
Expand Down Expand Up @@ -44,10 +46,25 @@
]


if _get_config_value(
_import_packaged_environments = _get_config_value(
"import_packaged_environments",
default=_FLOW_CONFIG_DEFAULTS["import_packaged_environments"],
):
default=None, # Use None to determine if this is being used or not.
)

if _import_packaged_environments is None:
_import_packaged_environments = _FLOW_CONFIG_DEFAULTS[
"import_packaged_environments"
]
else:
warnings.warn(
"The configuration key flow.import_packaged_environments will be removed in signac-flow "
"version 0.21. To remove this warning, remove the flow.import_packaged_environments key "
"from your signac configuration. In the future, environments provided by signac-flow will "
"always be imported.",
FutureWarning,
)

if _import_packaged_environments:
from . import environments # noqa: F401

__all__.append("environments")
12 changes: 12 additions & 0 deletions flow/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import os
import re
import socket
import warnings
from functools import lru_cache

from signac.common import config
Expand Down Expand Up @@ -60,6 +61,11 @@ def setup(py_modules, **attrs):
configuration. Once registered, the environment is automatically
imported when the :meth:`~flow.get_environment` function is called.
"""
warnings.warn(
"The configuration key flow.environment_modules will be removed in signac-flow version "
"0.21. Users should manually import user-defined environments instead.",
FutureWarning,
)
import setuptools
from setuptools.command.install import install

Expand Down Expand Up @@ -517,6 +523,12 @@ def _import_configured_environments():
logger.warning(error)
except KeyError:
pass
else:
warnings.warn(
"The configuration key flow.environment_modules will be removed in signac-flow version "
"0.21. Users should manually import user-defined environments instead.",
FutureWarning,
)


def registered_environments(import_configured=True):
Expand Down

0 comments on commit 166200e

Please sign in to comment.