mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 13:44:37 +00:00
Improve bootstrap script by working around some problems
... notably, Ubuntu 14.04's python and python v3.4.1, which is still the newest python 3.4 on some systems.
This commit is contained in:
parent
bb9908abb4
commit
bba20f4218
20
bootstrap.sh
20
bootstrap.sh
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
command -v python3 -m venv >/dev/null 2>&1 || { echo >&2 "Python 3.3 required. Install it and try again. Aborting"; exit 1; }
|
PYTHON=python3
|
||||||
|
command -v $PYTHON -m venv >/dev/null 2>&1 || { echo >&2 "Python 3.3 required. Install it and try again. Aborting"; exit 1; }
|
||||||
|
|
||||||
if [ -d "deps" ]; then
|
if [ -d "deps" ]; then
|
||||||
# We have a collection of dependencies in our source package. We might as well use it instead
|
# We have a collection of dependencies in our source package. We might as well use it instead
|
||||||
@ -13,7 +14,12 @@ if [ ! -d "env" ]; then
|
|||||||
# We need a "system-site-packages" env to have PyQt, but we also need to ensure a local pip
|
# We need a "system-site-packages" env to have PyQt, but we also need to ensure a local pip
|
||||||
# install. To achieve our latter goal, we start with a normal venv, which we later upgrade to
|
# install. To achieve our latter goal, we start with a normal venv, which we later upgrade to
|
||||||
# a system-site-packages once pip is installed.
|
# a system-site-packages once pip is installed.
|
||||||
python3 -m venv env
|
if ! $PYTHON -m venv env ; then
|
||||||
|
# We're probably under braindead Ubuntu 14.04 which completely messed up ensurepip.
|
||||||
|
# Work around it :(
|
||||||
|
echo "Ubuntu 14.04's version of Python 3.4 is braindead stupid, but we work around it anyway..."
|
||||||
|
$PYTHON -m venv --without-pip env
|
||||||
|
fi
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
if python -m ensurepip; then
|
if python -m ensurepip; then
|
||||||
echo "We're under Python 3.4+, no need to try to install pip!"
|
echo "We're under Python 3.4+, no need to try to install pip!"
|
||||||
@ -23,7 +29,13 @@ if [ ! -d "env" ]; then
|
|||||||
deactivate
|
deactivate
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
if [ "$(uname)" != "Darwin" ]; then
|
||||||
# We only need system site packages for PyQt, so under OS X, we don't enable it
|
# We only need system site packages for PyQt, so under OS X, we don't enable it
|
||||||
python3 -m venv env --upgrade --system-site-packages
|
if ! $PYTHON -m venv env --upgrade --system-site-packages ; then
|
||||||
|
# We're probably under v3.4.1 and experiencing http://bugs.python.org/issue21643
|
||||||
|
# Work around it.
|
||||||
|
echo "Oops, can't upgrade our venv. Trying to work around it."
|
||||||
|
rm env/lib64
|
||||||
|
$PYTHON -m venv env --upgrade --system-site-packages
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -33,7 +45,7 @@ echo "Installing pip requirements"
|
|||||||
if [ "$(uname)" == "Darwin" ]; then
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
pip install $PIPARGS -r requirements-osx.txt
|
pip install $PIPARGS -r requirements-osx.txt
|
||||||
else
|
else
|
||||||
python3 -c "import PyQt5" >/dev/null 2>&1 || { echo >&2 "PyQt 5.1+ required. Install it and try again. Aborting"; exit 1; }
|
python -c "import PyQt5" >/dev/null 2>&1 || { echo >&2 "PyQt 5.1+ required. Install it and try again. Aborting"; exit 1; }
|
||||||
pip install $PIPARGS -r requirements.txt
|
pip install $PIPARGS -r requirements.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user