Skip to content

Commit

Permalink
code changes prior to testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alexioannides committed Oct 2, 2018
1 parent 46bb373 commit 0cdc4bd
Show file tree
Hide file tree
Showing 7 changed files with 273 additions and 77 deletions.
14 changes: 14 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]
pyspark = "==2.3.1"
ipython = "*"
"flake8" = "*"

[requires]
python_version = "3.6"
179 changes: 179 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 0 additions & 58 deletions build_dependencies.sh

This file was deleted.

51 changes: 51 additions & 0 deletions create_py_packages_zip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash

# check to see if pipenv is installed
if [ -x "$(which pipenv)" ]
then
# check that there Pipfile exists in root directory
if [ ! -e Pipfile ]
then
echo 'ERROR - cannot find Pipfile'
exit 1
fi

# use Pipenv to create a requirement.txt file
echo '... creating requirements.txt from Pipfile'
pipenv lock -r > requirements.txt

# install packages to a temporary directory and zip it
pip3 install -r requirements.txt --target ./packages

# check to see if there are any external dependencies
# if not then create an empty file to see zip with
if [ -z "$(ls -A packages)" ]
then
touch packages/empty.txt
fi

# zip dependencies
if [ ! -d packages ]
then
echo 'ERROR - pip failed to import dependencies'
exit 1
fi

cd packages
zip -9mrv packages.zip .
mv packages.zip ..
cd ..

# remove temporary directory and requirements.txt
rm -rf packages
rm requirements.txt

# add local modules
echo '... adding all modules from local utils package'
zip -ru9 packages.zip dependencies -x dependencies/__pycache__/\*

exit 0
else
echo 'ERROR - pipenv is not installed --> run pip3 install pipenv to load pipenv into global site packages or install via a system package manager.'
exit 1
fi
Binary file removed dependencies.zip
Binary file not shown.
Loading

0 comments on commit 0cdc4bd

Please sign in to comment.