Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adopt breaking plugin API change in tox 4.0.0a10 #112

Merged
merged 2 commits into from Jan 8, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -41,7 +41,7 @@ package_dir =
zip_safe = True
python_requires = >=3.7
install_requires =
tox >= 4.0.0a9, <5
tox >= 4.0.0a10, <5
setup_requires =
setuptools_scm[toml] >=6, <7

Expand Down
13 changes: 7 additions & 6 deletions src/tox_gh_actions/plugin.py
Expand Up @@ -15,13 +15,16 @@
from tox.config.types import EnvList
from tox.execute.api import Outcome
from tox.plugin import impl
from tox.session.state import State
from tox.tox_env.api import ToxEnv

logger = getLogger(__name__)


@impl
def tox_add_core_config(core_conf: ConfigSet, config: Config) -> None:
def tox_add_core_config(core_conf: ConfigSet, state: State) -> None:
config = state.conf

logger.info("running tox-gh-actions")
if not is_running_on_actions():
logger.warning(
Expand Down Expand Up @@ -209,11 +212,9 @@ def is_log_grouping_enabled(options: Parsed) -> bool:

def is_env_specified(config: Config) -> bool:
"""Returns True when environments are explicitly given"""
if os.environ.get("TOXENV"):
# When TOXENV is a non-empty string
return True
elif hasattr(config.options, "env") and not config.options.env.use_default_list:
# When command line argument (-e) is given
if hasattr(config.options, "env") and not config.options.env.is_default_list:
# is_default_list becomes False when TOXENV is a non-empty string
# and when command line argument (-e) is given.
return True
return False

Expand Down