Skip to content

Commit

Permalink
Merge pull request #1 from christiandietze/main
Browse files Browse the repository at this point in the history
Do not deliver Spark dependency
  • Loading branch information
christiandietze authored May 5, 2021
2 parents 4e05f7c + ba08c27 commit 8ecdb31
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
.PHONY: setup test
.PHONY: setup-environment test
PYTHON=$(shell brew --prefix)/opt/python@3.7/bin/python3

install-python:
brew install python@3.7

setup-environment:
pip3 install virtualenv==20.0.15
virtualenv env
source env/bin/activate; \
pip3 install -r requirements.txt
$(PYTHON) -m pip install virtualenv==20.0.15
$(PYTHON) -m virtualenv env
. env/bin/activate; \
pip3 install -r requirements.txt; \
pip3 install pyspark==2.4.4

test:
source env/bin/activate; \
test: setup-environment
. env/bin/activate; \
SPARK_LOCAL_IP=127.0.0.1 PYTHONPATH=./src python -m pytest $(target) -v
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def main():
Job(__package__).execute()
```

## How to test

The tests currently run against Spark 2.4, which does not work with Python versions > 3.7 ([reference](https://issues.apache.org/jira/browse/SPARK-29536)). For that reason we expect Python 3.7 to be installed with Homebrew.
To run the tests, first install Python 3.7 with Homebrew (`make install-python`), then run the tests with `make test`. If you're not using Homebrew you can override the `PYTHON` variable as such: `make test PYTHON=/path/to/python3`.


## How to contribute

If you want to contribute, please submit a Pull Request! Thank you :)
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pyspark==3.0.1
pytest==6.1.2
pytest-spark==0.6.0
testfixtures==6.15.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pyspark-core-utils",
version="1.0.0",
version="1.0.1",
author="ImmobilienScout24",
description="PySpark core utils library",
long_description=long_description,
Expand Down

0 comments on commit 8ecdb31

Please sign in to comment.