Skip to content
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
9 changes: 1 addition & 8 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ concurrency:
cancel-in-progress: true

jobs:
pre_commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3

test:
name: test ${{ matrix.py }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -110,7 +103,7 @@ jobs:

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, test, pre_commit]
needs: [check, test]
runs-on: ubuntu-20.04
steps:
- name: Setup python to build package
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2318.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``devenv`` command does not respect specified path - by :user:`gaborbernat`.
13 changes: 8 additions & 5 deletions src/tox/session/cmd/devenv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import logging
from pathlib import Path

from tox.config.cli.parser import ToxParser
Expand All @@ -23,12 +24,12 @@ def tox_add_option(parser: ToxParser) -> None:

def devenv(state: State) -> int:
opt = state.conf.options

opt.skip_missing_interpreters = False # the target python must exist
opt.no_test = False # do not run the test suite
opt.package_only = False
opt.install_pkg = None # no explicit packages to install
opt.skip_pkg_install = False # always install a package in this case
opt.no_test = True # do not run the test phase

state.envs.ensure_only_run_env_is_active()
envs = list(state.envs.iter())
Expand All @@ -38,7 +39,9 @@ def devenv(state: State) -> int:
usedevelop=True, # dev environments must be of type dev
env_dir=Path(opt.devenv_path), # move it in source
)

opt.no_test = True # do not run the test phase
state.conf.get_env(envs[0], loaders=[loader])
return run_sequential(state)
tox_env = state.envs[envs[0]]
tox_env.conf.loaders.insert(0, loader)
result = run_sequential(state)
if result == 0:
logging.warning(f"created development environment under {tox_env.conf['env_dir']}")
return result
6 changes: 5 additions & 1 deletion tests/session/cmd/test_devenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ def test_devenv_fail_multiple_target(tox_project: ToxProjectCreator) -> None:
@pytest.mark.integration()
def test_devenv_ok(tox_project: ToxProjectCreator, enable_pip_pypi_access: str | None) -> None: # noqa: U100
content = {"setup.py": "from setuptools import setup\nsetup(name='demo', version='1.0')"}
outcome = tox_project(content).run("d", "-e", "py")
project = tox_project(content)
outcome = project.run("d", "-e", "py")

outcome.assert_success()
assert (project.path / "venv").exists()
assert f"created development environment under {project.path / 'venv'}" in outcome.out


def test_devenv_help(tox_project: ToxProjectCreator) -> None:
Expand Down