Skip to content

Commit b508a04

Browse files
authored
BLD: fix linting wrt to pandas-dev#15537, changes in location of pandas/src (pandas-dev#15614)
1 parent d32acaa commit b508a04

16 files changed

+47
-47
lines changed

ci/lint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RET=0
88

99
if [ "$LINT" ]; then
1010

11-
# pandas/src is C code, so no need to search there.
11+
# pandas/_libs/src is C code, so no need to search there.
1212
echo "Linting *.py"
13-
flake8 pandas --filename=*.py --exclude pandas/src
13+
flake8 pandas --filename=*.py --exclude pandas/_libs/src
1414
if [ $? -ne "0" ]; then
1515
RET=1
1616
fi
@@ -46,8 +46,8 @@ if [ "$LINT" ]; then
4646
echo "Linting *.c and *.h"
4747
for path in '*.h' 'period_helper.c' 'datetime' 'parser' 'ujson'
4848
do
49-
echo "linting -> pandas/src/$path"
50-
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/src/$path
49+
echo "linting -> pandas/_libs/src/$path"
50+
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/_libs/src/$path
5151
if [ $? -ne "0" ]; then
5252
RET=1
5353
fi

pandas/_libs/src/datetime/np_datetime.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt
1414
1515
*/
1616

17-
#ifndef PANDAS_SRC_DATETIME_NP_DATETIME_H_
18-
#define PANDAS_SRC_DATETIME_NP_DATETIME_H_
17+
#ifndef PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_
18+
#define PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_
1919

2020
#include <numpy/ndarraytypes.h>
2121

@@ -124,4 +124,4 @@ convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
124124
PANDAS_DATETIMEUNIT get_datetime64_unit(PyObject *obj);
125125

126126

127-
#endif // PANDAS_SRC_DATETIME_NP_DATETIME_H_
127+
#endif // PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_

pandas/_libs/src/datetime/np_datetime_strings.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ This file implements string parsing and creation for NumPy datetime.
1919
2020
*/
2121

22-
#ifndef PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
23-
#define PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
22+
#ifndef PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
23+
#define PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
2424

2525
/*
2626
* Parses (almost) standard ISO 8601 date strings. The differences are:
@@ -103,4 +103,4 @@ make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
103103
int local, PANDAS_DATETIMEUNIT base, int tzoffset,
104104
NPY_CASTING casting);
105105

106-
#endif // PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
106+
#endif // PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_

pandas/_libs/src/datetime_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_DATETIME_HELPER_H_
11-
#define PANDAS_SRC_DATETIME_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_DATETIME_HELPER_H_
11+
#define PANDAS__LIBS_SRC_DATETIME_HELPER_H_
1212

1313
#include <stdio.h>
1414
#include "datetime.h"
@@ -33,4 +33,4 @@ npy_float64 total_seconds(PyObject *td) {
3333
return (microseconds + (seconds + days_in_seconds) * 1000000.0) / 1000000.0;
3434
}
3535

36-
#endif // PANDAS_SRC_DATETIME_HELPER_H_
36+
#endif // PANDAS__LIBS_SRC_DATETIME_HELPER_H_

pandas/_libs/src/helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_HELPER_H_
11-
#define PANDAS_SRC_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_HELPER_H_
11+
#define PANDAS__LIBS_SRC_HELPER_H_
1212

1313
#ifndef PANDAS_INLINE
1414
#if defined(__GNUC__)
@@ -22,4 +22,4 @@ The full license is in the LICENSE file, distributed with this software.
2222
#endif
2323
#endif
2424

25-
#endif // PANDAS_SRC_HELPER_H_
25+
#endif // PANDAS__LIBS_SRC_HELPER_H_

pandas/_libs/src/numpy_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_NUMPY_HELPER_H_
11-
#define PANDAS_SRC_NUMPY_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_NUMPY_HELPER_H_
11+
#define PANDAS__LIBS_SRC_NUMPY_HELPER_H_
1212

1313
#include "Python.h"
1414
#include "helper.h"
@@ -159,4 +159,4 @@ PANDAS_INLINE PyObject* unbox_if_zerodim(PyObject* arr) {
159159
}
160160
}
161161

162-
#endif // PANDAS_SRC_NUMPY_HELPER_H_
162+
#endif // PANDAS__LIBS_SRC_NUMPY_HELPER_H_

pandas/_libs/src/parse_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_PARSE_HELPER_H_
11-
#define PANDAS_SRC_PARSE_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_PARSE_HELPER_H_
11+
#define PANDAS__LIBS_SRC_PARSE_HELPER_H_
1212

1313
#include <errno.h>
1414
#include <float.h>
@@ -270,4 +270,4 @@ static double xstrtod(const char *str, char **endptr, char decimal, char sci,
270270
return number;
271271
}
272272

273-
#endif // PANDAS_SRC_PARSE_HELPER_H_
273+
#endif // PANDAS__LIBS_SRC_PARSE_HELPER_H_

pandas/_libs/src/parser/io.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_PARSER_IO_H_
11-
#define PANDAS_SRC_PARSER_IO_H_
10+
#ifndef PANDAS__LIBS_SRC_PARSER_IO_H_
11+
#define PANDAS__LIBS_SRC_PARSER_IO_H_
1212

1313
#include "Python.h"
1414
#include "tokenizer.h"
@@ -83,4 +83,4 @@ void *buffer_file_bytes(void *source, size_t nbytes, size_t *bytes_read,
8383
void *buffer_rd_bytes(void *source, size_t nbytes, size_t *bytes_read,
8484
int *status);
8585

86-
#endif // PANDAS_SRC_PARSER_IO_H_
86+
#endif // PANDAS__LIBS_SRC_PARSER_IO_H_

pandas/_libs/src/parser/tokenizer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ See LICENSE for the license
99
1010
*/
1111

12-
#ifndef PANDAS_SRC_PARSER_TOKENIZER_H_
13-
#define PANDAS_SRC_PARSER_TOKENIZER_H_
12+
#ifndef PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
13+
#define PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
1414

1515
#include <errno.h>
1616
#include <stdio.h>
@@ -276,4 +276,4 @@ double round_trip(const char *p, char **q, char decimal, char sci, char tsep,
276276
int skip_trailing);
277277
int to_boolean(const char *item, uint8_t *val);
278278

279-
#endif // PANDAS_SRC_PARSER_TOKENIZER_H_
279+
#endif // PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_

pandas/_libs/src/period_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Cython to pandas. This primarily concerns interval representation and
1111
frequency conversion routines.
1212
*/
1313

14-
#ifndef PANDAS_SRC_PERIOD_HELPER_H_
15-
#define PANDAS_SRC_PERIOD_HELPER_H_
14+
#ifndef PANDAS__LIBS_SRC_PERIOD_HELPER_H_
15+
#define PANDAS__LIBS_SRC_PERIOD_HELPER_H_
1616

1717
#include <Python.h>
1818
#include "headers/stdint.h"
@@ -188,4 +188,4 @@ int get_yq(npy_int64 ordinal, int freq, int *quarter, int *year);
188188

189189
void initialize_daytime_conversion_factor_matrix(void);
190190

191-
#endif // PANDAS_SRC_PERIOD_HELPER_H_
191+
#endif // PANDAS__LIBS_SRC_PERIOD_HELPER_H_

pandas/_libs/src/skiplist.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Port of Wes McKinney's Cython version of Raymond Hettinger's original pure
1313
Python recipe (http://rhettinger.wordpress.com/2010/02/06/lost-knowledge/)
1414
*/
1515

16-
#ifndef PANDAS_SRC_SKIPLIST_H_
17-
#define PANDAS_SRC_SKIPLIST_H_
16+
#ifndef PANDAS__LIBS_SRC_SKIPLIST_H_
17+
#define PANDAS__LIBS_SRC_SKIPLIST_H_
1818

1919
#include <math.h>
2020
#include <stdio.h>
@@ -287,4 +287,4 @@ PANDAS_INLINE int skiplist_remove(skiplist_t *skp, double value) {
287287
return 1;
288288
}
289289

290-
#endif // PANDAS_SRC_SKIPLIST_H_
290+
#endif // PANDAS__LIBS_SRC_SKIPLIST_H_

pandas/_libs/src/ujson/lib/ultrajson.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ tree doesn't have cyclic references.
4949
5050
*/
5151

52-
#ifndef PANDAS_SRC_UJSON_LIB_ULTRAJSON_H_
53-
#define PANDAS_SRC_UJSON_LIB_ULTRAJSON_H_
52+
#ifndef PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
53+
#define PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_
5454

5555
#include <stdio.h>
5656
#include <wchar.h>
@@ -307,4 +307,4 @@ EXPORTFUNCTION JSOBJ JSON_DecodeObject(JSONObjectDecoder *dec,
307307
const char *buffer, size_t cbBuffer);
308308
EXPORTFUNCTION void encode(JSOBJ, JSONObjectEncoder *, const char *, size_t);
309309

310-
#endif // PANDAS_SRC_UJSON_LIB_ULTRAJSON_H_
310+
#endif // PANDAS__LIBS_SRC_UJSON_LIB_ULTRAJSON_H_

pandas/_libs/src/ujson/python/py_defines.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ modification, are permitted provided that the following conditions are met:
1616
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1717
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1818
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19-
DISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB OR JONAS TARNSTROM BE LIABLE
19+
DISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB OR JONAS TARNSTROM BE LIABLE
2020
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2121
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2222
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -35,8 +35,8 @@ Numeric decoder derived from from TCL library
3535
* Copyright (c) 1994 Sun Microsystems, Inc.
3636
*/
3737

38-
#ifndef PANDAS_SRC_UJSON_PYTHON_PY_DEFINES_H_
39-
#define PANDAS_SRC_UJSON_PYTHON_PY_DEFINES_H_
38+
#ifndef PANDAS__LIBS_SRC_UJSON_PYTHON_PY_DEFINES_H_
39+
#define PANDAS__LIBS_SRC_UJSON_PYTHON_PY_DEFINES_H_
4040

4141
#include <Python.h>
4242

@@ -55,4 +55,4 @@ Numeric decoder derived from from TCL library
5555

5656
#endif
5757

58-
#endif // PANDAS_SRC_UJSON_PYTHON_PY_DEFINES_H_
58+
#endif // PANDAS__LIBS_SRC_UJSON_PYTHON_PY_DEFINES_H_

pandas/_libs/src/ujson/python/version.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ modification, are permitted provided that the following conditions are met:
1616
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1717
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1818
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19-
DISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB OR JONAS TARNSTROM BE LIABLE
19+
DISCLAIMED. IN NO EVENT SHALL ESN SOCIAL SOFTWARE AB OR JONAS TARNSTROM BE LIABLE
2020
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2121
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2222
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
@@ -35,9 +35,9 @@ Numeric decoder derived from from TCL library
3535
* Copyright (c) 1994 Sun Microsystems, Inc.
3636
*/
3737

38-
#ifndef PANDAS_SRC_UJSON_PYTHON_VERSION_H_
39-
#define PANDAS_SRC_UJSON_PYTHON_VERSION_H_
38+
#ifndef PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_
39+
#define PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_
4040

4141
#define UJSON_VERSION "1.33"
4242

43-
#endif // PANDAS_SRC_UJSON_PYTHON_VERSION_H_
43+
#endif // PANDAS__LIBS_SRC_UJSON_PYTHON_VERSION_H_

test.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
:: test on windows
22

3-
pytest --skip-slow --skip-network pandas
3+
pytest --skip-slow --skip-network pandas %*

test_fast.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# https://github.com/pytest-dev/pytest/issues/1075
66
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
77

8-
pytest pandas --skip-slow --skip-network -m "not single" -n 4
8+
pytest pandas --skip-slow --skip-network -m "not single" -n 4 "$@"

0 commit comments

Comments
 (0)