@@ -30,18 +30,18 @@ all: build test
3030
3131# Downloads EMR packages. Skips if the tar file containing EMR packages has been made.
3232
33- # Builds and moves container python library into the Docker build context
34- build-container-library :
35- python setup.py bdist_wheel;
36- cp dist/* .whl ${BUILD_CONTEXT}
37-
3833init :
3934 pip install pipenv --upgrade
4035 pipenv install
36+ cp {Pipfile,Pipfile.lock,setup.py} ${BUILD_CONTEXT}
37+
38+ # Builds and moves container python library into the Docker build context
39+ build-container-library : init
40+ python setup.py bdist_wheel;
41+ cp dist/* .whl ${BUILD_CONTEXT}
4142
42- install-container-library : init build-container-library
43- pip install --upgrade dist/smspark-0.1-py3-none-any.whl
44- safety check # https://github.com/pyupio/safety
43+ install-container-library : init
44+ pipenv run safety check # https://github.com/pyupio/safety
4545
4646build-static-config :
4747 ./scripts/fetch-ec2-instance-type-info.sh --region ${REGION} --use-case ${USE_CASE} --spark-version ${SPARK_VERSION} \
@@ -64,25 +64,25 @@ build-test-java:
6464
6565build-tests : build-test-scala build-test-java
6666
67- lint :
68- black --check ./src
69- black --check ./test
70- mypy --follow-imports=skip src/smspark # see mypy.ini for configuration
71- flake8 src # see .flake8 for configuration
67+ lint : init
68+ pipenv run black --check ./src
69+ pipenv run black --check ./test
70+ pipenv run mypy --follow-imports=skip src/smspark # see mypy.ini for configuration
71+ pipenv run flake8 src # see .flake8 for configuration
7272
73- test-unit : build-container-library install-container-library
74- python -m pytest -s -vv test/unit
73+ test-unit : install-container-library
74+ pipenv run python -m pytest -s -vv test/unit
7575
7676# Only runs local tests.
77- test-local : install-sdk build-tests
78- python -m pytest -s -vv test/integration/local --repo=$(DEST_REPO ) --tag=$(VERSION ) --role=$(ROLE ) --durations=0
77+ test-local : install-container-library build-tests
78+ pipenv run python -m pytest -s -vv test/integration/local --repo=$(DEST_REPO ) --tag=$(VERSION ) --role=$(ROLE ) --durations=0
7979
8080# Only runs sagemaker tests
8181# Use pytest-parallel to run tests in parallel - https://pypi.org/project/pytest-parallel/
82- test-sagemaker : install-sdk build-tests
82+ test-sagemaker : build-tests
8383 # Separate `pytest` invocation without parallelization:
8484 # History server tests can't run in parallel since they use the same container name.
85- pytest -s -vv test/integration/history \
85+ pipenv run pytest -s -vv test/integration/history \
8686 --repo=$(DEST_REPO ) --tag=$(VERSION ) --durations=0 \
8787 --spark-version=$(SPARK_VERSION ) \
8888 --framework-version=$(FRAMEWORK_VERSION ) \
@@ -91,7 +91,7 @@ test-sagemaker: install-sdk build-tests
9191 --region ${REGION} \
9292 --domain ${AWS_DOMAIN}
9393 # OBJC_DISABLE_INITIALIZE_FORK_SAFETY: https://github.com/ansible/ansible/issues/32499#issuecomment-341578864
94- OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES pytest --workers auto -s -vv test/integration/sagemaker \
94+ OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES pipenv run pytest --workers auto -s -vv test/integration/sagemaker \
9595 --repo=$(DEST_REPO ) --tag=$(VERSION ) --durations=0 \
9696 --spark-version=$(SPARK_VERSION ) \
9797 --framework-version=$(FRAMEWORK_VERSION ) \
@@ -103,7 +103,7 @@ test-sagemaker: install-sdk build-tests
103103
104104# This is included in a separate target because it will be run only in prod stage
105105test-prod :
106- pytest -s -vv test/integration/tag \
106+ pipenv run pytest -s -vv test/integration/tag \
107107 --repo=$(DEST_REPO ) --tag=$(VERSION ) --durations=0 \
108108 --spark-version=$(SPARK_VERSION ) \
109109 --framework-version=$(FRAMEWORK_VERSION ) \
@@ -128,6 +128,7 @@ clean:
128128 rm ${BUILD_CONTEXT} /* .whl || true
129129 rm -rf dist || true
130130 rm -rf build || true
131+ rm =2.9.0
131132
132133# Removes compiled Scala SBT artifacts
133134clean-test-scala :
@@ -145,4 +146,4 @@ release:
145146
146147
147148# Targets that don't create a file with the same name as the target.
148- .PHONY : all build test test-all install-sdk clean clean-all release whitelist build-container-library
149+ .PHONY : all build test test-all clean clean-all release whitelist build-container-library
0 commit comments