Commit 36f83139 authored by Andrea Gonsek's avatar Andrea Gonsek
Browse files

Try an autoinstaller for blender-navipy

parent 52cdf919
......@@ -27,6 +27,20 @@ navipy_install:
paths:
- venv
blendnavipy_install:
stage: buildblend
dependencies:
- navipy_install
before_script:
- apt-get update -y; apt-get install -y -qq blender
script:
- source $CI_PROJECT_DIR/venv/bin/activate
- python3 -m navipy/scripts/autoinstall_blendnavipy.py
- pip3 install .
- python navipy/scripts/config_matplotlib_server.py # because no interactive backend
flake8:
stage: test
dependencies:
......
#!/bin/bash
# First install blender
apt-get install -y -qq blender
# Check the necessary dependencies for the
# blender build
blendnavipy --background --python-script=check_blender_versions.py
# Make packages in the virtualenv match the one used by blender
pip install --upgrade pip
pip install --upgrade -r /media/bolirev/data/Research/Toolboxes/navipy/navipy/scripts/requirement.txt
......@@ -23,10 +23,11 @@ packages = ['numpy',
'PIL',
'cv2',
'fastdtw',
'pandoc',
'statsmodels',
'sklearn']
filereq = 'requirement.txt'
fileconda = 'condanaviblend.sh'
filepip = 'pipnaviblend.sh'
# Look for packages require by blender and navipy
# there versions should match
requirements = []
......@@ -46,28 +47,35 @@ for pkg in packages:
requirements.append(line)
# Write a requirement file to auto install the packages
# prior to navipy with the correct versions
print('Write Requirement file ', end='')
with open(filereq, 'w') as cfile:
for line in requirements:
cfile.write(line + '\n')
print('Requirement file written... Ok')
print('Ok')
# Display user informations
pythonvec = python_version()
pathreq = os.path.abspath(filereq)
msg = '---With anaconda---\n'
msg += 'You can create an anaconda virtual environment as follow\n'
msg += '\t conda update conda\n'
msg += '\t conda create -n myblendnavipy python={} anaconda\n'.format(
msg = '#---With anaconda---\n'
msg += '#You can create an anaconda virtual environment as follow\n'
msg += 'conda update conda\n'
msg += 'conda create -n myblendnavipy python={} anaconda\n'.format(
pythonvec)
msg += '\t activate myblendnavipy\n'
msg += '\t conda install --yes --file {}\n'.format(pathreq)
msg += '\t conda install navipy\n'
msg += 'activate myblendnavipy\n'
msg += 'conda install --yes --file {}\n'.format(pathreq)
msg += 'conda install navipy\n'
with open(fileconda, 'w') as cfile:
cfile.write(msg)
print(msg)
msg = '---With mkvirtualenv/pip---\n'
msg += 'You can create an virtual environment as follow\n'
msg += '\t mkvirtualenv myblendnavipy --python={}\n'.format(pythonvec)
msg += '\t workon myblendnavipy\n'
msg += '\t pip install -r {}\n'.format(pathreq)
msg += '\t pip install navipy\n'
msg = '#---With mkvirtualenv/pip---\n'
msg += '#You can create an virtual environment as follow\n'
msg += 'pip3 install virtualenv\n'
msg += 'virtualenv --python=python{} myblendnavipy\n'.format(pythonvec)
msg += 'source myblendnavipy/bin/activate\n'
msg += 'pip3 install --upgrade pip\n'
msg += 'pip3 install -r {}\n'.format(pathreq)
msg += 'pip3 install navipy\n'
with open(filepip, 'w') as cfile:
cfile.write(msg)
print(msg)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment