Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 08a244d
_commit: fead162
_src_path: https://github.com/python-project-templates/base.git
add_docs: true
add_extension: cppjswasm
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Makefile linguist-documentation
*.html text=auto eol=lf
*.js text=auto eol=lf
*.json text=auto eol=lf
*.less text=auto eol=lf
*.md text=auto eol=lf
*.py text=auto eol=lf
*.toml text=auto eol=lf
Expand Down
41 changes: 23 additions & 18 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,54 +66,59 @@ jobs:
run: make checks
if: matrix.os == 'ubuntu-latest'

- name: Build
run: make build

- name: Test
run: make coverage

- name: Upload test results (Python)
uses: actions/upload-artifact@v7
with:
name: test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: '**/junit.xml'
if: matrix.os == 'ubuntu-latest'
path: junit.xml
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: '**/junit.xml'
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'

- name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
if: runner.os == 'Linux' && runner.arch == 'X64'
- name: Install build dependencies
run: pip install cibuildwheel

- name: Make dist
- name: Make dist (Linux)
run: |
make dist-py-sdist
make dist-py-wheel
make dist-check
env:
CIBW_BUILD: "${{ matrix.cibuildwheel }}-manylinux*"
CIBW_BUILD_VERBOSITY: 3
if: matrix.os == 'ubuntu-latest'

- name: Make dist
- name: Make dist (Macos)
run: |
make dist-py-wheel
make dist-check
env:
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0
if: matrix.os != 'ubuntu-latest'
CIBW_BUILD: "${{ matrix.cibuildwheel }}-macos*"
CIBW_BUILD_VERBOSITY: 3
if: matrix.os == 'macos-latest'

- name: Make dist (Windows)
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
make dist-py-wheel
shell: cmd
env:
CIBW_BUILD: "${{ matrix.cibuildwheel }}-win_amd64"
CIBW_BEFORE_ALL: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
if: matrix.os == 'windows-latest'

- uses: actions/upload-artifact@v7
with:
name: dist-${{matrix.os}}
name: dist-${{matrix.os}}-${{matrix.python-version}}
path: dist
28 changes: 7 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ __pycache__/
*.exp
*.lib

# Rust
target

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -55,26 +58,12 @@ junit.xml
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
# Django
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# PyBuilder
target/

# IPython
profile_default/
ipython_config.py
Expand All @@ -85,15 +74,12 @@ ipython_config.py
# pipenv
Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
# Celery
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
# Airspeed Velocity
.asv

# Environments
.env
Expand Down
41 changes: 19 additions & 22 deletions js/build.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { NodeModulesExternal } from "@finos/perspective-esbuild-plugin/external.js";
import { build } from "@finos/perspective-esbuild-plugin/build.js";
import { BuildCss } from "@prospective.co/procss/target/cjs/procss.js";
import { transform } from "lightningcss";
import { getarg } from "./tools/getarg.mjs";
import fs from "fs";
import cpy from "cpy";
import path_mod from "path";

const DEBUG = getarg("--debug");

Expand Down Expand Up @@ -40,31 +39,29 @@ const BUILD = [

async function compile_css() {
const process_path = (path) => {
const outpath = path.replace("src/less", "dist/css");
const outpath = path.replace("src/css", "dist/css");
fs.mkdirSync(outpath, { recursive: true });

fs.readdirSync(path).forEach((file_or_folder) => {
if (file_or_folder.endsWith(".less")) {
const outfile = file_or_folder.replace(".less", ".css");
const builder = new BuildCss("");
builder.add(
`${path}/${file_or_folder}`,
fs
.readFileSync(path_mod.join(`${path}/${file_or_folder}`))
.toString(),
);
fs.writeFileSync(
`${path.replace("src/less", "dist/css")}/${outfile}`,
builder.compile().get(outfile),
);
} else {
process_path(`${path}/${file_or_folder}`);
fs.readdirSync(path, { withFileTypes: true }).forEach((entry) => {
const input = `${path}/${entry.name}`;
const output = `${outpath}/${entry.name}`;

if (entry.isDirectory()) {
process_path(input);
} else if (entry.isFile() && entry.name.endsWith(".css")) {
const source = fs.readFileSync(input);
const { code } = transform({
filename: entry.name,
code: source,
minify: !DEBUG,
sourceMap: false,
});
fs.writeFileSync(output, code);
}
});
};
// recursively process all less files in src/less
process_path("src/less");
cpy("src/css/*", "dist/css/");

process_path("src/css");
}

async function copy_html() {
Expand Down
15 changes: 7 additions & 8 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
"build": "npm-run-all build:cpp build:prod",
"clean": "rm -rf dist lib playwright-report ../python_template_cppjswasm/extension",
"dev": "npm-run-all -p start watch",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"lint:cpp": "clang-format --dry-run -Werror -style=file:../.clang-format src/cpp/*.cpp",
"lint": "npm-run-all lint:*",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"",
"fix:cpp": "clang-format -i -style=file:../.clang-format src/cpp/*.cpp",
"fix": "npm-run-all fix:*",
"preinstall": "npx only-allow pnpm",
Expand All @@ -44,20 +44,19 @@
"start:tests": "http-server -p 3000 ",
"test:js": "playwright test",
"test": "npm-run-all test:*",
"watch": "nodemon --watch src -e ts,less,html,cpp,hpp --exec \"pnpm build:debug\""
"watch": "nodemon --watch src -e ts,css,html,cpp,hpp --exec \"pnpm build:debug\""
},
"dependencies": {},
"devDependencies": {
"@finos/perspective-esbuild-plugin": "^3.2.1",
"@playwright/test": "^1.56.1",
"@prospective.co/procss": "^0.1.17",
"cpy": "^12.1.0",
"@playwright/test": "^1.59.0",
"cpy": "^13.2.1",
"esbuild": "^0.27.2",
"esbuild-plugin-less": "^1.3.35",
"lightningcss": "^1.29.3",
"http-server": "^14.1.1",
"nodemon": "^3.1.10",
"npm-run-all": "^4.1.5",
"prettier": "^3.8.1",
"typescript": "^5.9.3"
"typescript": "^6.0.2"
}
}
Loading
Loading