Skip to content

Commit

Permalink
fix(tests): get tests working for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
n-dusan committed Oct 30, 2023
1 parent 6ce3361 commit 3a647c7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include_package_data = True
package_dir =
upgrade = upgrade
test_suite = tests
setup_requires = setuptools_scm < 7.0.0;
setup_requires = setuptools_scm

[options.extras_require]
dev =
Expand Down
6 changes: 3 additions & 3 deletions upgrade/scripts/manage_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def ensure_pip(venv_executable, *args, **kwargs):
try:
return run(*((venv_executable, "-m", "ensurepip") + args), **kwargs)
except subprocess.CalledProcessError as e:
logging.error("Error occurred while running pip in venv %s", str(e))
logging.error(f"Error occurred while running pip in venv {str(e)}")
raise e


def venv(*args, **kwargs):
try:
return run(*((sys.executable, "-m", "venv", "--without-pip") + args), **kwargs)
except subprocess.CalledProcessError as e:
logging.error("Error occurred while creating venv %s", str(e))
logging.error(f"Error occurred while creating venv {str(e)}" )
raise e


Expand Down Expand Up @@ -130,7 +130,7 @@ def upgrade_venv(
if update_from_local_wheels:
upgrade_args.append("--update-from-local-wheels")

result += run(*(upgrade_args))
result += run(*(upgrade_args), check=False)

return result
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion upgrade/scripts/slack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

import pip._vendor.requests as requests
import requests

from .exceptions import SlackError

Expand Down
2 changes: 1 addition & 1 deletion upgrade/scripts/upgrade_python_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def run(*command, **kwargs):
options = dict(
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
check=True,
check=kwargs.pop("check", True),
universal_newlines=True,
)
options.update(kwargs)
Expand Down
2 changes: 1 addition & 1 deletion upgrade/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_venv_executable(venv_path: str) -> str:
if is_windows():
return str(Path(venv_path, "Scripts", "python.exe").absolute())
else:
return str(Path(venv_path, "bin", "python").absolute())
return str(Path(venv_path, "bin", "python3").absolute())


def is_windows() -> bool:
Expand Down
14 changes: 8 additions & 6 deletions upgrade/tests/manage_venv/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ def mock_package_index_html():

def install_upgrade_python_package(venv_executable, upgrade_python_package_version):
run(
venv_executable,
"-m",
"pip",
"install",
"-e",
f"{str(UPGRADE_PYTHON_PACKAGE_REPOSITORY_PATH)}",
*([
venv_executable,
"-m",
"pip",
"install",
"-e",
f"{str(UPGRADE_PYTHON_PACKAGE_REPOSITORY_PATH)}",
])
)

0 comments on commit 3a647c7

Please sign in to comment.