Skip to content

Commit

Permalink
Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasBorboleta committed Feb 10, 2021
1 parent 51df58f commit 71dbff0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
3 changes: 2 additions & 1 deletion docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

*jersi_certu* has been developed using Python 3.8.5. So it is better to have installed such version or some higher version.

The following instructions might also work on other platforms, but only Windows and Linux have been tested.

### Instructions for Linux and Windows platforms

1. Make an installation directory by either cloning this *git* repository or downloading it as a zip archive and unzipping it.
Expand All @@ -17,7 +19,6 @@

4. For un-installing *jersi_certu* just remove the installation directory.

5. The above instructions might also work on other platforms, but only Windows and Linux have been tested.

### Used dependencies

Expand Down
27 changes: 8 additions & 19 deletions jersi_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@


_product_home = os.path.abspath(os.path.dirname(__file__))
os.chdir(_product_home)

_jersi_gui_executable = os.path.join(_product_home, "jersi_certu", "jersi_gui.py")
_venv_home = os.path.join(_product_home, ".env")

os.chdir(_product_home)

print()
print("Checking virtual environment ...")
if not os.path.isdir(_venv_home):
print()
print("Creating virtual environment ...")
print(" Creating virtual environment ...")
subprocess.run(args=[sys.executable, "-m", "venv", ".env"], shell=False, check=True)
print("Creating virtual environment done")
print(" Creating virtual environment done")
_install_dependencies = True

else:
Expand All @@ -55,17 +53,16 @@
else:
_venv_python_executable = glob.glob(os.path.join(_venv_home, "*/python*"))[0]

print("_venv_python_executable = ", _venv_python_executable)
print(" _venv_python_executable = ", _venv_python_executable)
print("Determining the python executable done")



if _install_dependencies:
print()
print("Installing dependencies ...")

if os.name == 'nt':
# windows fix to "import _ssl" failure after "import ssl" in "pip"
# windows fix of "import _ssl" failure after "import ssl" during "pip" execution
_sys_python_path = os.path.dirname(sys.executable)

if 'PATH' in os.environ:
Expand All @@ -77,19 +74,11 @@
os.environ['PATH'] = (_sys_python_path + os.pathsep +
os.path.join(_sys_python_path, 'Scripts') + os.pathsep +
os.path.join(_sys_python_path, 'Library', 'bin') )


_venv_python_path = os.path.dirname(_venv_python_executable)

if 'PATH' in os.environ:
os.environ['PATH'] = _venv_python_path + os.pathsep + os.environ['PATH']
else:
os.environ['PATH'] = _venv_python_path

subprocess.run(args=[_venv_python_executable, "-c", "import ssl"], shell=False, check=True)


subprocess.run(args=[_venv_python_executable, "-m", "ensurepip", "--upgrade"], shell=False, check=True)
subprocess.run(args=[_venv_python_executable, "-m", "pip", "install", "--upgrade", "pip"], shell=False, check=True)
subprocess.run(args=[_venv_python_executable, "-m", "pip", "install", "-r", "requirements.txt"], shell=False, check=True)
print()
print("Installing dependencies done")


Expand Down

0 comments on commit 71dbff0

Please sign in to comment.