Skip to content

Commit b0050f3

Browse files
committed
fix: never use .. in a header include (#5321)
* fix: never use `..` in a header include Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: one more parent include Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent c6239a8 commit b0050f3

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

include/pybind11/detail/class.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
#pragma once
1111

12-
#include "../attr.h"
13-
#include "../options.h"
12+
#include <pybind11/attr.h>
13+
#include <pybind11/options.h>
1414

1515
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
1616
PYBIND11_NAMESPACE_BEGIN(detail)

include/pybind11/detail/internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#include "common.h"
1313

1414
#if defined(PYBIND11_SIMPLE_GIL_MANAGEMENT)
15-
# include "../gil.h"
15+
# include <pybind11/gil.h>
1616
#endif
1717

18-
#include "../pytypes.h"
18+
#include <pybind11/pytypes.h>
1919

2020
#include <exception>
2121
#include <mutex>

include/pybind11/detail/type_caster_base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#pragma once
1111

12-
#include "../pytypes.h"
12+
#include <pybind11/pytypes.h>
13+
1314
#include "common.h"
1415
#include "descr.h"
1516
#include "internals.h"

include/pybind11/eigen/matrix.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#pragma once
1111

12-
#include "../numpy.h"
12+
#include <pybind11/numpy.h>
13+
1314
#include "common.h"
1415

1516
/* HINT: To suppress warnings originating from the Eigen headers, use -isystem.

include/pybind11/eigen/tensor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
#pragma once
99

10-
#include "../numpy.h"
10+
#include <pybind11/numpy.h>
11+
1112
#include "common.h"
1213

1314
#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER)

include/pybind11/stl/filesystem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
#pragma once
66

7-
#include "../pybind11.h"
8-
#include "../detail/common.h"
9-
#include "../detail/descr.h"
10-
#include "../cast.h"
11-
#include "../pytypes.h"
7+
#include <pybind11/cast.h>
8+
#include <pybind11/detail/common.h>
9+
#include <pybind11/detail/descr.h>
10+
#include <pybind11/pybind11.h>
11+
#include <pybind11/pytypes.h>
1212

1313
#include <string>
1414

0 commit comments

Comments
 (0)