Skip to content

Commit 003c4a7

Browse files
BLD: Only enable -Werror in the CI jobs (#38087)
Co-authored-by: Simon Hawkins <[email protected]>
1 parent 19c5eea commit 003c4a7

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
@@ -108,6 +108,12 @@ fi
108108
echo "activate pandas-dev"
109109
source activate pandas-dev
110110

111+
# Explicitly set an environment variable indicating that this is pandas' CI environment.
112+
#
113+
# This allows us to enable things like -Werror that shouldn't be activated in
114+
# downstream CI jobs that may also build pandas from source.
115+
export PANDAS_CI=1
116+
111117
echo
112118
echo "remove any installed pandas package"
113119
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
@@ -409,15 +409,16 @@ def run(self):
409409
endian_macro = [("__LITTLE_ENDIAN__", "1")]
410410

411411

412+
extra_compile_args = []
413+
extra_link_args = []
412414
if is_platform_windows():
413-
extra_compile_args = []
414-
extra_link_args = []
415415
if debugging_symbols_requested:
416416
extra_compile_args.append("/Z7")
417417
extra_link_args.append("/DEBUG")
418418
else:
419-
extra_compile_args = ["-Werror"]
420-
extra_link_args = []
419+
# PANDAS_CI=1 is set by ci/setup_env.sh
420+
if os.environ.get("PANDAS_CI", "0") == "1":
421+
extra_compile_args.append("-Werror")
421422
if debugging_symbols_requested:
422423
extra_compile_args.append("-g")
423424

0 commit comments

Comments
 (0)