Skip to content
Open
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
66 changes: 36 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,40 +37,46 @@ def make_release_tree(self, base_dir: str, files: list[str]) -> None:


allowed_to_fail = os.environ.get("CIBUILDWHEEL", "0") != "1"
# Allow skipping Cython extension build for GCC version compatibility issues (#3259)
skip_cython = os.environ.get("PYICEBERG_SKIP_CYTHON", "0") == "1"

ext_modules = []

try:
import Cython.Compiler.Options
from Cython.Build import cythonize

Cython.Compiler.Options.annotate = True

if os.name == "nt": # Windows
extra_compile_args = ["/O2"]
else: # UNIX-based systems (Linux, macOS)
extra_compile_args = ["-O3"]

package_path = "pyiceberg"

extensions = [
Extension(
"pyiceberg.avro.decoder_fast",
[os.path.join(package_path, "avro", "decoder_fast.pyx")],
extra_compile_args=extra_compile_args,
language="c",
if not skip_cython:
try:
import Cython.Compiler.Options
from Cython.Build import cythonize

Cython.Compiler.Options.annotate = True

if os.name == "nt": # Windows
extra_compile_args = ["/O2"]
else: # UNIX-based systems (Linux, macOS)
extra_compile_args = ["-O3"]
# Suppress warnings that may be treated as errors on newer GCC versions (>= 13.x)
# to ensure compatibility with systems that don't have GCC 12.x (#3259)
extra_compile_args.extend(["-Wno-error=implicit-function-declaration"])

package_path = "pyiceberg"

extensions = [
Extension(
"pyiceberg.avro.decoder_fast",
[os.path.join(package_path, "avro", "decoder_fast.pyx")],
extra_compile_args=extra_compile_args,
language="c",
)
]

ext_modules = cythonize(
extensions,
include_path=[package_path],
compiler_directives={"language_level": "3"},
annotate=True,
)
]

ext_modules = cythonize(
extensions,
include_path=[package_path],
compiler_directives={"language_level": "3"},
annotate=True,
)
except Exception:
if not allowed_to_fail:
raise
except Exception:
if not allowed_to_fail:
raise

pyiceberg_packages = find_packages(include=["pyiceberg*"])
vendor_packages = find_packages(where="vendor", include=["fb303", "hive_metastore"])
Expand Down