Skip to content

Commit 3bcb3cd

Browse files
xhochymeeseeksmachine
authored andcommitted
Backport PR pandas-dev#38087: BLD: Only enable -Werror in the CI jobs
1 parent c53df5f commit 3bcb3cd

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

ci/setup_env.sh

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ fi
111111
echo "activate pandas-dev"
112112
source activate pandas-dev
113113

114+
# Explicitly set an environment variable indicating that this is pandas' CI environment.
115+
#
116+
# This allows us to enable things like -Werror that shouldn't be activated in
117+
# downstream CI jobs that may also build pandas from source.
118+
export PANDAS_CI=1
119+
114120
echo
115121
echo "remove any installed pandas package"
116122
echo "w/o removing anything else"

doc/source/whatsnew/v1.1.5.rst

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ Bug fixes
3333

3434
.. ---------------------------------------------------------------------------
3535
36+
.. _whatsnew_115.other:
37+
38+
Other
39+
~~~~~
40+
- Only set ``-Werror`` as a compiler flag in the CI jobs (:issue:`33315`, :issue:`33314`)
41+
42+
.. ---------------------------------------------------------------------------
43+
3644
.. _whatsnew_115.contributors:
3745

3846
Contributors

setup.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,16 @@ def run(self):
427427
endian_macro = [("__LITTLE_ENDIAN__", "1")]
428428

429429

430+
extra_compile_args = []
431+
extra_link_args = []
430432
if is_platform_windows():
431-
extra_compile_args = []
432-
extra_link_args = []
433433
if debugging_symbols_requested:
434434
extra_compile_args.append("/Z7")
435435
extra_link_args.append("/DEBUG")
436436
else:
437-
extra_compile_args = ["-Werror"]
438-
extra_link_args = []
437+
# PANDAS_CI=1 is set by ci/setup_env.sh
438+
if os.environ.get("PANDAS_CI", "0") == "1":
439+
extra_compile_args.append("-Werror")
439440
if debugging_symbols_requested:
440441
extra_compile_args.append("-g")
441442

0 commit comments

Comments
 (0)