Skip to content

Commit

Permalink
try removing IS_WINDOWS_CI special case
Browse files Browse the repository at this point in the history
This may fix #326, because this would also fix the lack of permissions that causes the error message there to suggest using `--user`.
  • Loading branch information
egpbos committed Jun 8, 2023
1 parent a385157 commit e5c6cdc
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pytest

IS_WINDOWS = platform.startswith('win')
IS_WINDOWS_CI = IS_WINDOWS and os.environ.get('CI', False)


def test_project_folder(cookies):
Expand All @@ -33,17 +32,11 @@ def run(args: Sequence[str], dirpath: os.PathLike) -> subprocess.CompletedProces

@pytest.fixture
def project_env_bin_dir(tmp_path):
if IS_WINDOWS_CI:
# Creating virtualenv does not work on Windows CI,
# falling back to using current pip3 dir
pip = Path(which('pip3'))
bin_dir = pip.parent
else:
env_output = run(['python3', '-m', 'venv', 'env'], tmp_path)
assert env_output.returncode == 0
bin_dir = str(tmp_path / 'env' / 'bin')
if IS_WINDOWS:
bin_dir = str(tmp_path / 'env' / 'Scripts')
env_output = run(['python3', '-m', 'venv', 'env'], tmp_path)
assert env_output.returncode == 0
bin_dir = str(tmp_path / 'env' / 'bin')
if IS_WINDOWS:
bin_dir = str(tmp_path / 'env' / 'Scripts')
return str(bin_dir) + os.sep


Expand Down Expand Up @@ -98,9 +91,6 @@ def test_subpackage(baked_with_development_dependencies, project_env_bin_dir):
subsubpackage.mkdir()
(subsubpackage / '__init__.py').write_text('FOO = "bar"', encoding="utf-8")

if IS_WINDOWS_CI:
# On Windows CI python and pip executable are in different paths
bin_dir = ''
# sdist and bdist_wheel both call build command to create build/ dir
# So instead of looking in distribution archives we can look in build/ dir
result = run([f'{bin_dir}python', 'setup.py', 'build'], project_dir)
Expand Down

0 comments on commit e5c6cdc

Please sign in to comment.