Package PyPI dependencies right into our source package

This commit is contained in:
Virgil Dupras 2013-12-21 12:13:26 -05:00
parent 46f8984bdc
commit 7ba2e38cd6
2 changed files with 15 additions and 2 deletions

View File

@ -19,7 +19,13 @@ if [ "$(uname)" == "Darwin" ]; then
pip install -r requirements-osx.txt
else
python3 -c "import PyQt5" >/dev/null 2>&1 || { echo >&2 "PyQt 5.1+ required. Install it and try again. Aborting"; exit 1; }
pip install -r requirements.txt
if [ -d "deps" ]; then
# We have a collection of dependencies in our source package. We might as well use it instead
# of downloading it from PyPI.
pip install --no-index --find-links=deps -r requirements.txt
else
pip install -r requirements.txt
fi
fi
echo "Bootstrapping complete! You can now configure, build and run dupeGuru with:"

View File

@ -153,10 +153,17 @@ def package_arch(edition):
shutil.copy(op.join('images', ed('dg{}_logo_128.png')), srcpath)
def package_source_tgz(edition):
if not op.exists('deps'):
print("Downloading PyPI dependencies")
print_and_do('pip install --download=deps -r requirements.txt')
print("Creating git archive")
app_version = get_module_version('core_{}'.format(edition))
name = 'dupeguru-{}-src-{}.tar.gz'.format(edition, app_version)
name = 'dupeguru-{}-src-{}.tar'.format(edition, app_version)
dest = op.join('build', name)
print_and_do('git archive -o {} HEAD'.format(dest))
print("Adding dependencies and wrapping up")
print_and_do('tar -rf {} deps'.format(dest))
print_and_do('gzip {}'.format(dest))
def main():
args = parse_args()