Skip to content

Commit 43f1bc8

Browse files
authored
Refactor Extension Modules (#53346)
* Working refactor with setuptools * Meson updates * fixed missing source files * Missing graft
1 parent 4c3af48 commit 43f1bc8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+120
-158
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ repos:
6565
rev: 1.6.1
6666
hooks:
6767
- id: cpplint
68-
# We don't lint all C files because we don't want to lint any that are built
69-
# from Cython files nor do we want to lint C files that we didn't modify for
70-
# this particular codebase (e.g. src/headers, src/klib). However,
71-
# we can lint all header files since they aren't "generated" like C files are.
72-
exclude: ^pandas/_libs/src/(klib|headers)/
68+
exclude: ^pandas/_libs/include/pandas/vendored/klib
7369
args: [
7470
--quiet,
7571
'--extensions=c,h',

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,4 @@ prune pandas/tests/io/parser/data
5757

5858
# Selectively re-add *.cxx files that were excluded above
5959
graft pandas/_libs/src
60-
graft pandas/_libs/tslibs/src
61-
include pandas/_libs/pd_parser.h
62-
include pandas/_libs/pd_parser.c
60+
graft pandas/_libs/include

pandas/_libs/tslibs/src/datetime/pd_datetime.h renamed to pandas/_libs/include/pandas/datetime/pd_datetime.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ See NUMPY_LICENSE.txt for the license.
2222
#endif // NPY_NO_DEPRECATED_API
2323

2424
#include <numpy/ndarraytypes.h>
25-
#include "np_datetime.h"
26-
#include "np_datetime_strings.h"
27-
#include "date_conversions.h"
25+
#include "pandas/vendored/numpy/datetime/np_datetime.h"
26+
#include "pandas/vendored/numpy/datetime/np_datetime_strings.h"
27+
#include "pandas/datetime/date_conversions.h"
2828

2929
#ifdef __cplusplus
3030
extern "C" {

pandas/_libs/pd_parser.h renamed to pandas/_libs/include/pandas/parser/pd_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern "C" {
1414

1515
#define PY_SSIZE_T_CLEAN
1616
#include <Python.h>
17-
#include "src/parser/tokenizer.h"
17+
#include "pandas/parser/tokenizer.h"
1818

1919
typedef struct {
2020
int (*to_double)(char *, double *, char, char, int *);

pandas/_libs/src/parser/tokenizer.h renamed to pandas/_libs/include/pandas/parser/tokenizer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ See LICENSE for the license
1919
#define ERROR_INVALID_CHARS 3
2020

2121
#include <stdint.h>
22-
#include "../inline_helper.h"
23-
#include "../headers/portable.h"
22+
#include "pandas/inline_helper.h"
23+
#include "pandas/portable.h"
2424

25-
#include "khash.h"
25+
#include "pandas/vendored/klib/khash.h"
2626

2727
#define STREAM_INIT_SIZE 32
2828

pandas/_libs/src/headers/portable.h renamed to pandas/_libs/include/pandas/portable.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
/*
2+
Copyright (c) 2016, PyData Development Team
3+
All rights reserved.
4+
5+
Distributed under the terms of the BSD Simplified License.
6+
7+
The full license is in the LICENSE file, distributed with this software.
8+
*/
9+
110
#pragma once
211

312
#include <string.h>
413

514
#if defined(_MSC_VER)
6-
#define strcasecmp( s1, s2 ) _stricmp( s1, s2 )
15+
#define strcasecmp(s1, s2) _stricmp(s1, s2)
716
#endif
817

918
// GH-23516 - works around locale perf issues

pandas/_libs/src/skiplist.h renamed to pandas/_libs/include/pandas/skiplist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Python recipe (https://rhettinger.wordpress.com/2010/02/06/lost-knowledge/)
1919
#include <stdio.h>
2020
#include <stdlib.h>
2121
#include <string.h>
22-
#include "inline_helper.h"
22+
#include "pandas/inline_helper.h"
2323

2424
PANDAS_INLINE float __skiplist_nanf(void) {
2525
const union {

0 commit comments

Comments
 (0)