Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python/packaging/classic/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,13 @@ def run(self):
copyfile("pyspark/shell.py", "pyspark/python/pyspark/shell.py")

if in_spark:
# !!HACK ALTERT!!
# `setup.py` has to be located with the same directory with the package.
# Therefore, we copy the current file, and place it at `spark/python` directory.
# After that, we remove it in the end.
copyfile("packaging/classic/setup.py", "setup.py")
copyfile("packaging/classic/setup.cfg", "setup.cfg")

# Construct the symlink farm - this is nein_sparkcessary since we can't refer to
# the path above the package root and we need to copy the jars and scripts which
# are up above the python root.
Expand Down
10 changes: 9 additions & 1 deletion python/packaging/connect/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import sys
from setuptools import setup
import os
from shutil import copyfile
from shutil import copyfile, move
import glob
from pathlib import Path

Expand Down Expand Up @@ -109,6 +109,13 @@

try:
if in_spark:
# !!HACK ALTERT!!
# 1. `setup.py` has to be located with the same directory with the package.
# Therefore, we copy the current file, and place it at `spark/python` directory.
# After that, we remove it in the end.
# 2. Here it renames `lib` to `lib.ack` so MANIFEST.in does not pick `py4j` up.
# We rename it back in the end.
move("lib", "lib.back")
copyfile("packaging/connect/setup.py", "setup.py")
copyfile("packaging/connect/setup.cfg", "setup.cfg")

Expand Down Expand Up @@ -206,5 +213,6 @@
)
finally:
if in_spark:
move("lib.back", "lib")
os.remove("setup.py")
os.remove("setup.cfg")