Skip to content

Commit 0cdc4bd

Browse files
author
alexioannides
committed
code changes prior to testing
1 parent 46bb373 commit 0cdc4bd

7 files changed

+273
-77
lines changed

Pipfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
8+
[dev-packages]
9+
pyspark = "==2.3.1"
10+
ipython = "*"
11+
"flake8" = "*"
12+
13+
[requires]
14+
python_version = "3.6"

Pipfile.lock

Lines changed: 179 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_dependencies.sh

Lines changed: 0 additions & 58 deletions
This file was deleted.

create_py_packages_zip.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
3+
# check to see if pipenv is installed
4+
if [ -x "$(which pipenv)" ]
5+
then
6+
# check that there Pipfile exists in root directory
7+
if [ ! -e Pipfile ]
8+
then
9+
echo 'ERROR - cannot find Pipfile'
10+
exit 1
11+
fi
12+
13+
# use Pipenv to create a requirement.txt file
14+
echo '... creating requirements.txt from Pipfile'
15+
pipenv lock -r > requirements.txt
16+
17+
# install packages to a temporary directory and zip it
18+
pip3 install -r requirements.txt --target ./packages
19+
20+
# check to see if there are any external dependencies
21+
# if not then create an empty file to see zip with
22+
if [ -z "$(ls -A packages)" ]
23+
then
24+
touch packages/empty.txt
25+
fi
26+
27+
# zip dependencies
28+
if [ ! -d packages ]
29+
then
30+
echo 'ERROR - pip failed to import dependencies'
31+
exit 1
32+
fi
33+
34+
cd packages
35+
zip -9mrv packages.zip .
36+
mv packages.zip ..
37+
cd ..
38+
39+
# remove temporary directory and requirements.txt
40+
rm -rf packages
41+
rm requirements.txt
42+
43+
# add local modules
44+
echo '... adding all modules from local utils package'
45+
zip -ru9 packages.zip dependencies -x dependencies/__pycache__/\*
46+
47+
exit 0
48+
else
49+
echo 'ERROR - pipenv is not installed --> run pip3 install pipenv to load pipenv into global site packages or install via a system package manager.'
50+
exit 1
51+
fi

dependencies.zip

-2.53 KB
Binary file not shown.

0 commit comments

Comments
 (0)