Skip to content

Commit c844dc9

Browse files
authored
Merge pull request #271 from Point72/copier-update-2026-05-10T06-04-10
Update from copier (2026-05-10T06:04:10)
2 parents a95c440 + 25c57d6 commit c844dc9

41 files changed

Lines changed: 621 additions & 363 deletions

Some content is hidden

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

.copier-answers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 9be318c
2+
_commit: e392033
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: false
55
add_extension: js

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Makefile linguist-documentation
77
*.html text=auto eol=lf
88
*.js text=auto eol=lf
99
*.json text=auto eol=lf
10-
*.less text=auto eol=lf
1110
*.md text=auto eol=lf
1211
*.py text=auto eol=lf
1312
*.toml text=auto eol=lf
Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,31 @@
11
---
2-
name: Bug report
3-
about: Create a report to help us improve
4-
title: ''
5-
labels: bug
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: 'type: bug'
66
assignees: ''
7-
87
---
98

10-
<!--
11-
Thank you for taking the time to file a bug report. Before creating a
12-
new issue, please take a few minutes to search the issue tracker for an
13-
existing issues about the bug you would like to report.
14-
-->
15-
16-
**Describe the bug**
17-
<!-- A clear and concise description of what the bug is. -->
18-
19-
**To Reproduce**
20-
<!-- A short code example that reproduces the problem. It should be
21-
self-contained, i.e., can be copy-pasted into the Python interpreter or
22-
run as-is via `python myproblem.py`. If this is a problem with the C++
23-
interface, it should link to a buildable C++ project that demonstrates
24-
the issue.
25-
26-
```python
27-
28-
```
29-
-->
30-
31-
9+
**Description**
10+
A clear and concise description of the bug.
3211

33-
**Expected behavior**
34-
<!-- A clear and concise description of what you expected to happen. -->
12+
**Steps to Reproduce**
13+
1.
14+
2.
15+
3.
3516

36-
**Error Message**
37-
<!-- Please include the full error message you see,if any, including the
38-
full traceback -->
17+
**Expected Behavior**
18+
What you expected to happen.
3919

40-
**Runtime Environment**
41-
<!-- Output from
20+
**Actual Behavior**
21+
What actually happened. Include full error messages or tracebacks if available.
4222

43-
`import sys, csp; print(csp.__version__); print(sys.version); print(sys.platform)`.
44-
-->
23+
**Environment**
24+
- OS: [e.g. Ubuntu 22.04, macOS 14.0, Windows 11]
25+
- Python version: [e.g. 3.11.5] (`python --version`)
26+
- Node.js version: [e.g. 22.0.0] (`node --version`)
27+
- pnpm version: [e.g. 9.0.0] (`pnpm --version`)
28+
- Package version: (`pip show csp-gateway | grep Version`)
4529

46-
**Additional context**
47-
<!-- Explain how this issue affects your work or why it should be
48-
prioritized. If there are additional details that don't fit elsewhere,
49-
include them here. -->
30+
**Additional Context**
31+
Add any other relevant context, logs, or screenshots.
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
name: Feature request
3-
about: Suggest an idea for this project
4-
title: ''
5-
labels: ''
2+
name: Feature Request
3+
about: Suggest a new feature or improvement
4+
title: '[FEATURE] '
5+
labels: 'type: enhancement'
66
assignees: ''
7-
87
---
98

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
**Problem Statement**
10+
A clear description of the problem this feature would solve. Ex. "I'm always frustrated when [...]"
1211

13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
12+
**Proposed Solution**
13+
A clear description of the desired behavior or feature.
1514

16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
15+
**Alternatives Considered**
16+
Any alternative solutions or workarounds you've considered.
1817

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
18+
**Additional Context**
19+
Add any other context, mockups, or examples.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Question
3+
about: Ask a question about usage or behavior
4+
title: '[QUESTION] '
5+
labels: 'tag: question'
6+
assignees: ''
7+
---
8+
9+
**Question**
10+
A clear and concise description of your question.
11+
12+
**Context**
13+
What are you trying to accomplish? Include relevant code snippets, configuration, or links to documentation you've already consulted.
14+
15+
**Environment**
16+
If relevant, include your environment details (OS, language versions, package version).

.github/pull_request_template.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Description
2+
3+
Brief description of the changes in this PR.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Documentation update
10+
- [ ] Refactor / code cleanup
11+
- [ ] CI / build configuration
12+
- [ ] Other (describe below)
13+
14+
## Checklist
15+
16+
- [ ] Linting passes (`make lint`)
17+
- [ ] Tests pass (`make test`)
18+
- [ ] New tests added for new functionality
19+
- [ ] Documentation updated (if applicable)
20+
- [ ] Changelog / version bump (if applicable)

.github/workflows/build.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ jobs:
5555
- name: Make dist
5656
run: make dist
5757

58+
- uses: actions-ext/python/test-wheel@main
59+
with:
60+
module: csp_gateway
61+
62+
- uses: actions-ext/python/test-sdist@main
63+
with:
64+
module: csp_gateway
65+
5866
- uses: actions/upload-artifact@v7
5967
with:
6068
name: dist
@@ -92,7 +100,7 @@ jobs:
92100
name: dist
93101

94102
- name: Install wheels
95-
run: uv pip install `ls csp_gateway-*.whl`[develop]
103+
run: uv pip install `ls csp_gateway-*.whl`[develop] --target .
96104

97105
- name: Test
98106
run: make coverage

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ dmypy.json
112112
/site
113113
index.md
114114
docs/_build/
115-
docs/src/_build/
116115
docs/api
117-
docs/index.md
118116
docs/html
117+
docs/index.md
119118
docs/jupyter_execute
119+
docs/src/_build/
120+
docs/superpowers
120121
index.md
121122

122123
# JS
123124
js/coverage
124125
js/dist
125-
js/lib
126126
js/node_modules
127127
js/test-results
128128
js/playwright-report
@@ -150,3 +150,7 @@ multirun/
150150
ROADMAP.md
151151
AGENTS.md
152152
.github/hooks/sdlc.json
153+
.superpowers
154+
155+
# JS Artifacts
156+
csp_gateway/server/build

js/build.mjs

Lines changed: 38 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
2-
import { build } from "@finos/perspective-esbuild-plugin/build.js";
3-
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
4-
import cpy from "cpy";
1+
import { bundle } from "./tools/bundle.mjs";
2+
import { bundle_css } from "./tools/css.mjs";
3+
import { node_modules_external } from "./tools/externals.mjs";
4+
55
import fs from "fs";
6-
import { createRequire } from "node:module";
6+
import cpy from "cpy";
77
import path from "node:path";
8-
8+
import { createRequire } from "node:module";
99
const require = createRequire(import.meta.url);
1010

1111
// Force all react imports to resolve to the same copy to avoid
@@ -17,137 +17,51 @@ const REACT_ALIAS = {
1717
"react/jsx-runtime": require.resolve("react/jsx-runtime"),
1818
};
1919

20-
const BUILD = [
20+
const BUNDLES = [
2121
{
22-
define: {
23-
global: "window",
24-
},
25-
entryPoints: ["src/index.jsx"],
26-
plugins: [NodeModulesExternal()],
27-
format: "esm",
28-
loader: {
29-
".css": "text",
30-
".html": "text",
31-
".jsx": "jsx",
32-
".png": "file",
33-
".ttf": "file",
34-
".wasm": "file",
35-
},
36-
outfile: "./lib/index.js",
22+
entryPoints: ["./src/js/index.jsx"],
23+
plugins: [node_modules_external()],
24+
outfile: "dist/index.js",
25+
alias: REACT_ALIAS,
3726
},
3827
{
39-
define: {
40-
global: "window",
41-
},
42-
entryPoints: ["src/main.jsx"],
43-
bundle: true,
44-
plugins: [],
45-
format: "esm",
46-
alias: REACT_ALIAS,
47-
loader: {
48-
".css": "text",
49-
".html": "text",
50-
".jsx": "jsx",
51-
".png": "file",
52-
".ttf": "file",
53-
".wasm": "file",
54-
},
28+
entryPoints: ["./src/js/main.jsx"],
5529
outfile: "../csp_gateway/server/build/main.js",
56-
publicPath: "/static/",
30+
alias: REACT_ALIAS,
31+
publicPath: "/static",
5732
},
5833
];
5934

60-
function add(builder, path, path2) {
61-
builder.add(path, fs.readFileSync(require.resolve(path2 || path)).toString());
62-
}
35+
const WASM_ASSETS = [
36+
"node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm",
37+
"node_modules/@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm",
38+
];
6339

64-
async function compile_css() {
65-
const builder1 = new BuildCss("");
66-
add(builder1, "./src/style/index.css");
67-
add(builder1, "./src/style/base.css");
68-
add(builder1, "./src/style/nord.css");
69-
add(builder1, "./src/style/header_footer.css");
70-
add(builder1, "./src/style/perspective.css");
71-
add(builder1, "./src/style/settings.css");
72-
add(
73-
builder1,
74-
"perspective-viewer-pro.css",
75-
"@perspective-dev/viewer/dist/css/pro.css",
76-
);
77-
add(
78-
builder1,
79-
"perspective-viewer-pro-dark.css",
80-
"@perspective-dev/viewer/dist/css/pro-dark.css",
81-
);
82-
add(
83-
builder1,
84-
"perspective-viewer-monokai.css",
85-
"@perspective-dev/viewer/dist/css/monokai.css",
86-
);
87-
add(
88-
builder1,
89-
"perspective-viewer-vaporwave.css",
90-
"@perspective-dev/viewer/dist/css/vaporwave.css",
91-
);
92-
add(
93-
builder1,
94-
"perspective-viewer-dracula.css",
95-
"@perspective-dev/viewer/dist/css/dracula.css",
96-
);
97-
add(
98-
builder1,
99-
"perspective-viewer-gruvbox.css",
100-
"@perspective-dev/viewer/dist/css/gruvbox.css",
101-
);
102-
add(
103-
builder1,
104-
"perspective-viewer-gruvbox-dark.css",
105-
"@perspective-dev/viewer/dist/css/gruvbox-dark.css",
106-
);
107-
add(
108-
builder1,
109-
"perspective-viewer-solarized.css",
110-
"@perspective-dev/viewer/dist/css/solarized.css",
111-
);
112-
add(
113-
builder1,
114-
"perspective-viewer-solarized-dark.css",
115-
"@perspective-dev/viewer/dist/css/solarized-dark.css",
116-
);
117-
add(
118-
builder1,
119-
"react-modern-drawer.css",
120-
"react-modern-drawer/dist/index.css",
121-
);
40+
function copy_wasm_assets(outdir) {
41+
fs.mkdirSync(outdir, { recursive: true });
42+
for (const wasm of WASM_ASSETS) {
43+
fs.copyFileSync(wasm, path.join(outdir, path.basename(wasm)));
44+
}
45+
}
12246

123-
const css = builder1.compile().get("index.css");
47+
async function build() {
48+
// Bundle css
49+
await bundle_css();
12450

125-
// write to extension
126-
fs.writeFileSync("./lib/index.css", css);
127-
fs.writeFileSync("../csp_gateway/server/build/index.css", css);
128-
}
51+
// Copy HTML
52+
await cpy("src/html/*", "dist/");
12953

130-
async function cp_to_paths(path) {
131-
await cpy(path, "../csp_gateway/server/build/", { flat: true });
132-
}
54+
// Copy images
55+
await cpy("src/img/*", "dist/", { flat: true });
13356

134-
async function build_all() {
135-
/* make directories */
136-
fs.mkdirSync("../csp_gateway/server/build/", { recursive: true });
57+
// Copy Perspective wasm assets for /static/*.wasm requests.
58+
copy_wasm_assets("dist");
13759

138-
/* Compile and copy JS */
139-
await Promise.all(BUILD.map(build)).catch(() => process.exit(1));
140-
// await cp_to_paths("./src/style/*.css");
141-
await cp_to_paths("./src/html/*.html");
142-
await cp_to_paths(
143-
"node_modules/@perspective-dev/server/dist/wasm/perspective-server.wasm",
144-
);
145-
await cp_to_paths(
146-
"node_modules/@perspective-dev/viewer/dist/wasm/perspective-viewer.wasm",
147-
);
60+
await Promise.all(BUNDLES.map(bundle)).catch(() => process.exit(1));
14861

149-
/* Compile and copy css */
150-
await compile_css();
62+
// Copy servable assets to python extension (exclude esm/)
63+
fs.mkdirSync("../csp_gateway/server/build", { recursive: true });
64+
await cpy("dist/**/*", "../csp_gateway/server/build", { flat: true });
15165
}
15266

153-
build_all();
67+
build();

0 commit comments

Comments
 (0)