Skip to content

Commit

Permalink
sagemathgh-36754: Relativize more header imports
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

Follow-up to sagemath#36598, relativizing
the remaining header imports.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [ ] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36754
Reported by: Tobias Diez
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Dec 10, 2023
2 parents e7f6503 + 233a4ef commit e0f602a
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/sage/cpython/debug.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cdef extern from "Python.h":
# Helper to get a pointer to an object's __dict__ slot, if any
PyObject** _PyObject_GetDictPtr(obj)

cdef extern from "sage/cpython/debugimpl.c":
cdef extern from "debugimpl.c":
void _type_debug(PyTypeObject*)

from sage.cpython.getattr cimport AttributeErrorMessage
Expand Down
2 changes: 1 addition & 1 deletion src/sage/cpython/python_debug.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from cpython.ref cimport PyObject, PyTypeObject

cdef extern from "sage/cpython/python_debug.h":
cdef extern from "python_debug.h":

# This is what is generally meant by "a debug build" of Python.
# Implies Py_REF_DEBUG, Py_TRACE_REFS, and PYMALLOC_DEBUG (if
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/cliquer.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ from cysignals.memory cimport sig_free
from cysignals.signals cimport sig_on, sig_off


cdef extern from "sage/graphs/cliquer/cl.c":
cdef extern from "cliquer/cl.c":
cdef int sage_clique_max(graph_t *g, int ** list_of_vertices)
cdef int sage_all_clique_max(graph_t *g, int ** list_of_vertices)
cdef int sage_clique_number(graph_t *g)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/modular/arithgroup/farey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <Python.h>

#include "farey.hpp"
#include "sage/modular/arithgroup/farey_symbol.h"
#include "farey_symbol.h"


using namespace std;
Expand Down
4 changes: 2 additions & 2 deletions src/sage/rings/padics/pow_computer_ext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ from cpython.dict cimport *

from cysignals.signals cimport sig_on, sig_off

include "sage/libs/ntl/decl.pxi"
include "../../libs/ntl/decl.pxi"

from sage.misc.timing import cputime
from sage.libs.gmp.mpz cimport *
Expand All @@ -69,7 +69,7 @@ from sage.libs.ntl.ntl_ZZ cimport ntl_ZZ
from sage.libs.ntl.ntl_ZZ_pX cimport ntl_ZZ_pX, ntl_ZZ_pX_Modulus
from sage.rings.integer cimport Integer

cdef extern from "sage/ext/ccobject.h":
cdef extern from "../../ext/ccobject.h":
ZZ_c* Allocate_ZZ_array "Allocate_array<ZZ>"(size_t n)
void Delete_ZZ_array "Delete_array<ZZ>"(ZZ_c* v)
ZZ_pX_c* Allocate_ZZ_pX_array "Allocate_array<ZZ_pX>"(size_t n)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/structure/coerce_dict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ from cysignals.memory cimport check_calloc, sig_free
cdef extern from "Python.h":
void PyTuple_SET_ITEM(object tuple, Py_ssize_t index, PyObject* item)

cdef extern from "sage/cpython/pyx_visit.h":
cdef extern from "../cpython/pyx_visit.h":
void Py_VISIT3(PyObject*, visitproc, void*)

cdef type KeyedRef, ref
Expand Down
2 changes: 1 addition & 1 deletion src/sage_setup/autogen/interpreters/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def write_wrapper(self, write):
from sage.ext.fast_callable cimport Wrapper
cdef extern from "sage/ext/interpreters/interp_{{ s.name }}.c":
cdef extern from "interp_{{ s.name }}.c":
{{ myself.func_header(cython=true) -}}
{% if s.err_return != 'NULL' %}
Expand Down
4 changes: 2 additions & 2 deletions src/sage_setup/autogen/interpreters/specs/cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self):
sage: print(interp.c_header)
<BLANKLINE>
#include <mpc.h>
#include "sage/ext/interpreters/wrapper_cc.h"
#include "wrapper_cc.h"
<BLANKLINE>
So instructions where you need to interact with Python can
Expand All @@ -171,7 +171,7 @@ def __init__(self):
self.c_header = ri(0,
'''
#include <mpc.h>
#include "sage/ext/interpreters/wrapper_cc.h"
#include "wrapper_cc.h"
''')

self.pxd_header = ri(0,
Expand Down
2 changes: 1 addition & 1 deletion src/sage_setup/autogen/interpreters/specs/cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self):
self.c_header = ri(0,"""
#include <stdlib.h>
#include <complex.h>
#include "sage/ext/interpreters/wrapper_cdf.h"
#include "wrapper_cdf.h"
/* On Solaris, we need to define _Imaginary_I when compiling with GCC,
* otherwise the constant I doesn't work. The definition below is based
Expand Down
2 changes: 1 addition & 1 deletion src/sage_setup/autogen/interpreters/specs/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def __init__(self):
self.chunks = [self.mc_args, self.mc_constants, self.mc_stack,
self.mc_domain_info, self.mc_code]
self.c_header = ri(0, """
#include "sage/ext/interpreters/wrapper_el.h"
#include "wrapper_el.h"
#define CHECK(x) do_check(&(x), domain)
Expand Down
4 changes: 2 additions & 2 deletions src/sage_setup/autogen/interpreters/specs/rr.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def __init__(self):
sage: print(interp.c_header)
<BLANKLINE>
#include <mpfr.h>
#include "sage/ext/interpreters/wrapper_rr.h"
#include "wrapper_rr.h"
<BLANKLINE>
The function ``rr_py_call_helper`` is implemented in Cython::
Expand Down Expand Up @@ -188,7 +188,7 @@ def __init__(self):
self.c_header = ri(0,
'''
#include <mpfr.h>
#include "sage/ext/interpreters/wrapper_rr.h"
#include "wrapper_rr.h"
''')

self.pxd_header = ri(0,
Expand Down

0 comments on commit e0f602a

Please sign in to comment.