Skip to content

Commit

Permalink
Update install instruction (openvinotoolkit#469)
Browse files Browse the repository at this point in the history
* Update install instruction

* Add a new virtualenv test

* Remove onnx dependency from INSTALL_REQUIRES; rollback changes

* Put onnx dependency to tests/requirements.txt

* Return a test back
  • Loading branch information
kshpv committed Feb 3, 2021
1 parent f0ce976 commit 173a630
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def find_version(*file_paths):
"jstyleson>=0.0.2",
"numpy>=1.19",
"tqdm>=4.54.1",
"onnx>=1.8.0",
"pytest-mock>=3.3.1",
"jsonschema>=3.2.0",
"natsort>=7.1.0",
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ yattag>=1.14.0
prettytable>=2.0.0
# Required for test_algo_common not to fail because of google namespace issues
protobuf==3.14.0
onnx>=1.8.0
20 changes: 16 additions & 4 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,34 @@
INSTALL_CHECKS_FILENAME = 'install_checks.py'


@pytest.fixture(name="package_type", params=["install", "develop", "sdist", "bdist_wheel", "pypi"])
@pytest.fixture(name="venv_type",
params=["virtualenv", "venv"])
def venv_type_(request):
return request.param


@pytest.fixture(name="package_type",
params=["install", "develop", "sdist", "bdist_wheel", "pypi"])
def package_type_(request):
return request.param


def test_install(install_type, tmp_path, package_type):
def test_install(install_type, tmp_path, package_type, venv_type):
if install_type is None:
pytest.skip("Please specify type of installation")
venv_path = tmp_path / 'venv'
venv_path.mkdir()

version_string = "{}.{}".format(sys.version_info[0], sys.version_info[1])
subprocess.call("virtualenv -ppython{} {}".format(version_string, venv_path), shell=True)
python_executable_with_venv = ". {0}/bin/activate && {0}/bin/python".format(venv_path)
pip_with_venv = ". {0}/bin/activate && {0}/bin/pip".format(venv_path)

version_string = "{}.{}".format(sys.version_info[0], sys.version_info[1])
if venv_type == 'virtualenv':
subprocess.call("virtualenv -ppython{} {}".format(version_string, venv_path), shell=True)
elif venv_type == 'venv':
subprocess.call("python{} -m venv {}".format(version_string, venv_path), shell=True)
subprocess.call("{} install --upgrade pip".format(pip_with_venv), shell=True)

run_path = tmp_path / 'run'
run_path.mkdir()

Expand Down

0 comments on commit 173a630

Please sign in to comment.