diff --git a/ci/setup_env.sh b/ci/setup_env.sh index 78951c9def7cb..c36422884f2ec 100755 --- a/ci/setup_env.sh +++ b/ci/setup_env.sh @@ -108,6 +108,12 @@ fi echo "activate pandas-dev" source activate pandas-dev +# Explicitly set an environment variable indicating that this is pandas' CI environment. +# +# This allows us to enable things like -Werror that shouldn't be activated in +# downstream CI jobs that may also build pandas from source. +export PANDAS_CI=1 + echo echo "remove any installed pandas package" echo "w/o removing anything else" diff --git a/doc/source/whatsnew/v1.1.5.rst b/doc/source/whatsnew/v1.1.5.rst index 29b0e99a3a356..552c8ced6b08a 100644 --- a/doc/source/whatsnew/v1.1.5.rst +++ b/doc/source/whatsnew/v1.1.5.rst @@ -33,6 +33,14 @@ Bug fixes .. --------------------------------------------------------------------------- +.. _whatsnew_115.other: + +Other +~~~~~ +- Only set ``-Werror`` as a compiler flag in the CI jobs (:issue:`33315`, :issue:`33314`) + +.. --------------------------------------------------------------------------- + .. _whatsnew_115.contributors: Contributors diff --git a/setup.py b/setup.py index 9f33c045df6ed..0b1007794bbdb 100755 --- a/setup.py +++ b/setup.py @@ -409,15 +409,16 @@ def run(self): endian_macro = [("__LITTLE_ENDIAN__", "1")] +extra_compile_args = [] +extra_link_args = [] if is_platform_windows(): - extra_compile_args = [] - extra_link_args = [] if debugging_symbols_requested: extra_compile_args.append("/Z7") extra_link_args.append("/DEBUG") else: - extra_compile_args = ["-Werror"] - extra_link_args = [] + # PANDAS_CI=1 is set by ci/setup_env.sh + if os.environ.get("PANDAS_CI", "0") == "1": + extra_compile_args.append("-Werror") if debugging_symbols_requested: extra_compile_args.append("-g")