Update directory structure and rename from Cppyy->CppJIT - #14
Conversation
|
As discussed/planned, following this merge we can squash the history and begin active development. |
|
|
||
|
|
||
| namespace CPyCppyy { | ||
| namespace PyCppJIT { |
There was a problem hiding this comment.
Is that the middle layer? I am wondering if we have better options for a namespace name to signal that.
|
@vgvassilev I'm continuing our discussions here, so I can propose the design we seem to be converging upon: cppjit namespace design: cppjit::{cpyrt, interop}We use a single C++ namespace tree,
What one writes and reads as a cppjit developerThe two layers are siblings under // src/cpyrt/Converters.cxx
namespace cppjit::cpyrt {
bool VectorConverter::SetArg(PyObject* pyobject, Parameter& para, CallContext* ctxt)
{
// sibling namespace, no full qualification needed
interop::TCppScope_t scope = interop::GetScope("std::vector<double>");
...
}
} // namespace cppjit::cpyrtImplementation files that are not namespace-wrapped carry Someone extending cppjit from outside includes the installed headers #include "cpyrt/API.h"
class MyConverter : public cppjit::cpyrt::Converter {
bool SetArg(PyObject*, cppjit::cpyrt::Parameter&,
cppjit::cpyrt::CallContext* = nullptr) override;
};
cppjit::cpyrt::RegisterConverter("MyType", ...);The From Python and from JIT-side C++ the same tree shows up as nested import cppjit
cppjit.cppdef("int f(int x) { return x + 1; }")
cppjit.gbl.f(41)
# the reflection API is a normal namespace under gbl
scope = cppjit.gbl.cppjit.interop.GetScope("std::vector<int>")The naming conventions in one place:
How python-fortran interop would fitThe split between the two namespaces is also the extension seam.
The invariant that makes this "unintrusive": new languages add siblings cc @guitargeek |
|
Sounds good! Anyway I have no strong preference at all because there is no public API, but if there would be one at some point, I'd definitely prefer |
This is a bit clunky but I guess we can solve that later not now... |
Structurally, |
Not an actual problem for now fortunately, because we won't expose the public C++ API |
sI would prefer |
If we are discussing folder name then that's fine, for a namespace I think it is a bit long. In that sense (assuming we follow the 80 col llvm rule) people will probably do using namespace EDIT: |
Sounds good. @guitargeek? |
|
Sure! |
fe26006 to
9702f93
Compare
Test Results
|
For maybe a future improvement, we should have this either to the bottom of the PR description which has the last run and in |
This is currently posts the last run results, ensuring it is always at the end of the PR (so it follows a force push for e.g), and the intermediate runs are discarded: at any given point in time there is only one "Test Results" displayed by github actions. What do you mean by multirun setups |
|
Pending work-items for this PR:
This should in the end give us a relatively "minimal" starting point for development after squashing the history. Some post squash items have been recorded in #15 |
9702f93 to
c114dee
Compare
From the agent:
This PR carries the pre-squash structural work: it turns the fork-derived tree into cppjit proper, layout updates, renames, no legacy so the churn is buried into a single commit before we begin new developments on top.
Layout
Rename
Everything is spelled cppjit, by one ordered, case-respecting token map over file contents and file names:
declarations, and identifiers emitted into JIT-compiled code keep the full spelling, since the interpreter resolves only the real namespace.
Dead code and metadata
Everything without a reachable path in the merged package is dropped:
The package version is single-sourced from _version.py (previously reported cppyy's 3.0.0 from the frontend and ROOT's 6.28.0 from the backend) and requires-python is now 3.12+, matching what CI tests.
Validation
pip source install (LLVM 22, fresh venv) + the full upstream test suite: 539 passed / 40 skipped / 19 xfailed / 1 xpassed, 0 failed — identical to the pre-rename reference run. CI needs the matching ci-workflows composite change (smoke import + suppression paths) on main.