Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove import packaged environments #653

Merged
merged 6 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ Changelog
The **signac-flow** package follows `semantic versioning <https://semver.org/>`_.
The numbers in brackets denote the related GitHub issue and/or pull request.

Version 0.21
============

[0.21.0] -- 2022-xx-xx
----------------------

Removed
+++++++

- Removed configuration key 'flow.import_packaged_environments' (#653).

Version 0.20
============

Expand Down
31 changes: 2 additions & 29 deletions flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@

.. _signac: https://signac.io/
"""
import warnings

from . import environment, errors, hooks, scheduling, testing
from . import environment, environments, errors, hooks, scheduling, testing
from .aggregates import aggregator, get_aggregate_id
from .environment import get_environment
from .operations import cmd, directives, with_job
from .project import FlowProject, IgnoreConditions, classlabel, label, staticlabel
from .template import init

# Import packaged environments unless disabled in config:
from .util.config import _FLOW_CONFIG_DEFAULTS
from .util.config import get_config_value as _get_config_value
from .util.misc import redirect_log
from .version import __version__

__all__ = [
"environment",
"environments",
"errors",
"hooks",
"scheduling",
Expand All @@ -44,27 +41,3 @@
"redirect_log",
"__version__",
]


_import_packaged_environments = _get_config_value(
"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")
4 changes: 4 additions & 0 deletions flow/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def setup(py_modules, **attrs):
an environment's module, but also register it with the global signac
configuration. Once registered, the environment is automatically
imported when the :meth:`~flow.get_environment` function is called.

Warning
-------
This function is deprecated. Install user environments manually.
"""
warnings.warn(
"The configuration key flow.environment_modules will be removed in signac-flow version "
Expand Down
12 changes: 1 addition & 11 deletions flow/environments/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""The environments module contains a set of provided environment profiles.

These environments are imported by default. This can be disabled by setting
the configuration key 'flow.import_packaged_environments' to 'off' with the
following shell command:

.. code-block:: bash

signac config --global set flow.import_packaged_environments off

"""
"""The environments module contains a set of provided environment profiles."""
from . import drexel, incite, umich, umn, xsede

__all__ = [
Expand Down
2 changes: 0 additions & 2 deletions flow/util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"import_packaged_environments": {"type": "boolean"},
"status_performance_warn_threshold": {"type": "number"},
"show_traceback": {"type": "boolean"},
"eligible_jobs_max_lines": {"type": "integer"},
Expand All @@ -19,7 +18,6 @@
}

_FLOW_CONFIG_DEFAULTS = {
"import_packaged_environments": True,
"status_performance_warn_threshold": 0.2,
"show_traceback": False,
"eligible_jobs_max_lines": 10,
Expand Down