Skip to content

Commit

Permalink
Remove forcing CI code path to use nt shell code path (#6072)
Browse files Browse the repository at this point in the history
* Remove forcing CI code path to use nt shell code path and remove outdated comment

* Add news fragment
  • Loading branch information
matteius committed Feb 1, 2024
1 parent 95df3fd commit 15149f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions news/6072.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove logic that treats ``CI`` variable to use ``do_run_nt`` shell logic, as the original reasons for that patch were no longer valid.
5 changes: 1 addition & 4 deletions pipenv/routines/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import sys
from os.path import expandvars

from pipenv import environments
from pipenv.utils.project import ensure_project
from pipenv.utils.shell import cmd_list_to_shell, system_which
from pipenv.vendor import click
Expand Down Expand Up @@ -99,9 +98,7 @@ def do_run(project, command, args, python=False, pypi_mirror=None):
click.echo("Can't run script {0!r}-it's empty?", err=True)
run_args = [project, script]
run_kwargs = {"env": env}
# We're using `do_run_nt` on CI (even if we're running on a non-nt machine)
# as a workaround for https://github.com/pypa/pipenv/issues/4909.
if os.name == "nt" or environments.PIPENV_IS_CI:
if os.name == "nt":
run_fn = do_run_nt
else:
run_fn = do_run_posix
Expand Down
10 changes: 0 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
import pytest
import os

# Note that we have to do this *before* `pipenv.environments` gets imported,
# which is why we're doing it here as a side effect of importing this module.
# CI=1 is necessary as a workaround for https://github.com/pypa/pipenv/issues/4909
os.environ['CI'] = '1'

def pytest_sessionstart(session):
import pipenv.environments
assert pipenv.environments.PIPENV_IS_CI


@pytest.fixture()
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def test_scripts(pipenv_instance_pypi):
c = p.pipenv('run notfoundscript')
assert c.returncode != 0
assert c.stdout == ''
if os.name != 'nt': # TODO: Implement this message for Windows.
assert 'not found' in c.stderr
if os.name != 'nt':
assert 'could not be found' in c.stderr

project = Project()

Expand Down

0 comments on commit 15149f0

Please sign in to comment.