-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-1267][SPARK-18129] Allow PySpark to be pip installed #15659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7763f3c
30debc7
5155531
2f0bf9b
4c00b98
7ff8d0f
610b975
cb2e06d
01f791d
e2e4d1c
fb15d7e
aab7ee4
5a57620
646aa23
36c9d45
a78754b
955e92b
2d88a40
9e5c532
be7eadd
07d3849
11b5fa8
8791f82
92837a3
6947a85
944160c
5bf0746
435f842
27ca27e
df126cf
70a78a0
555d443
051abe5
b345bdb
28da44b
0f16c08
574c1f0
6299744
17104c1
0447ea2
c335c80
146567b
0e2223d
849ded0
cf5ab7e
4b69871
3788bfb
308a168
74b79c4
3056553
125ae2a
d2da8b0
595409f
cf421b0
31ac8e2
0e9cb8d
264b253
802f682
fba37a0
8ba499f
1c177f3
6ace070
ab8ca53
77f8eca
f590898
f956a5d
489d4e3
9e4fdb5
e668af6
3bf961e
c9d48d3
e9f1e8e
1cdcf61
7af912a
c77d9fd
7b1d8b7
298bda6
9770260
99940ee
f6806b2
b0cd655
6bb422e
b5b4713
2b808dc
b958f7e
577554b
9cf2ec9
154a287
b478bdf
fb62a8a
6540964
d2389ed
48cd1ad
23109a4
49fc6db
7001f90
8d74672
210c9d4
9efca67
fd3e89c
587c0eb
2904998
3345eb9
f86574a
05fc25f
dd243a2
df5a3f9
d753d80
e139855
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…or Python and use it for long_description in PyPi
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,9 @@ | |
| EXAMPLES_TARGET = "%s/examples" % TEMP_PATH | ||
|
|
||
| # Check and see if we are under the spark path in which case we need to build the symlink farm. | ||
| # This is important because we only want to build the symlink farm while under Spark otherwise we | ||
| # want to use the symlink farm. And if the symlink farm exists under while under Spark (e.g. a | ||
| # partially built sdist) we should error and have the user sort it out. | ||
| in_spark = os.path.isfile("../core/src/main/scala/org/apache/spark/SparkContext.scala") | ||
| if (in_spark): | ||
| # Construct links for setup | ||
|
|
@@ -26,13 +29,29 @@ | |
|
|
||
| try: | ||
| if (in_spark): | ||
| # Construct the symlink farm | ||
|
||
| os.symlink(JARS_PATH, JARS_TARGET) | ||
| os.symlink(SCRIPTS_PATH, SCRIPTS_TARGET) | ||
| os.symlink(EXAMPLES_PATH, EXAMPLES_TARGET) | ||
| # Parse the README markdown file into rst for PyPi | ||
| try: | ||
| import pypandoc | ||
| long_description = pypandoc.convert('README.md', 'rst') | ||
| except ImportError: | ||
| print("Could not import pypandoc - required to package PySpark", file=sys.stderr) | ||
| long_description = "!!!!! missing pandoc do not upload to PyPi !!!!" | ||
| else: | ||
| # We add find_spark_home.py to the bin directory we install so that pip installed PySpark | ||
| # will search for SPARK_HOME with Python. | ||
| # We only do this copy when we aren't inside of Spark (e.g. the packaging tool has copied | ||
| # all the files into a temp directory) since otherwise the copy would go into the symlinked | ||
| # directory. | ||
| copyfile("pyspark/find_spark_home.py", SCRIPTS_TARGET + "/find_spark_home.py") | ||
| # We copy the shell script to be under pyspark/python/pyspark so that the launcher scripts | ||
| # find it where expected. The rest of the files aren't copied because they are accessed | ||
| # using Python imports instead which will be resolved correctly. | ||
| os.makedirs("pyspark/python/pyspark") | ||
| copyfile("pyspark/shell.py", "pyspark/python/pyspark/shell.py") | ||
|
|
||
| if not os.path.isdir(SCRIPTS_TARGET): | ||
| print("For packaging reasons you must first create a source dist and install that source dist.", file=sys.stderr) | ||
|
|
@@ -46,6 +65,7 @@ | |
| name='pyspark', | ||
| version=VERSION, | ||
| description='Apache Spark Python API', | ||
| long_description=long_description, | ||
| author='Spark Developers', | ||
| author_email='[email protected]', | ||
| url='https://github.com/apache/spark/tree/master/python', | ||
|
|
@@ -73,6 +93,7 @@ | |
| scripts=scripts, | ||
| license='http://www.apache.org/licenses/LICENSE-2.0', | ||
| install_requires=['py4j==0.10.4'], | ||
| setup_requires=['pypandoc'], | ||
| extras_require={ | ||
| 'ml': ['numpy>=1.7'], | ||
| 'mllib': ['numpy<=1.7'], | ||
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor point, but
graftseems more appropriate here.See: https://docs.python.org/3/distutils/commandref.html#sdist-cmd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! :)