diff --git a/.copier-answers.yaml b/.copier-answers.yaml index d4d42c6..5f4d74b 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: ca3e4a0 +_commit: 4a9f82b _src_path: https://github.com/python-project-templates/base.git add_docs: true add_extension: rustjswasm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c1edc5..16f15b1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,6 +31,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.9"] + cibuildwheel: ["cp39"] node-version: [20.x] steps: @@ -44,13 +45,14 @@ jobs: - uses: actions-ext/node/setup@main with: - version: 20.x + version: 22.x - name: Install dependencies run: make develop - name: Lint run: make lint + if: matrix.os == 'ubuntu-latest' - name: Checks run: make checks @@ -67,7 +69,7 @@ jobs: with: name: test-results-${{ matrix.os }}-${{ matrix.python-version }} path: '**/junit.xml' - if: ${{ always() }} + if: matrix.os == 'ubuntu-latest' - name: Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v2 @@ -92,6 +94,8 @@ jobs: make dist-py-sdist make dist-py-wheel make dist-check + env: + CIBW_BUILD: "${{ matrix.cibuildwheel }}-manylinux*" if: matrix.os == 'ubuntu-latest' - name: Make dist diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index d9ff12f..52abc4a 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -15,6 +15,7 @@ jobs: - uses: actions-ext/python/setup@main - uses: actions-ext/rust/setup@main - uses: actions-ext/node/setup@main + - run: make develop - run: uv pip install . - run: uv pip install yardang - run: yardang build diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 664db10..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -*.png -*.svg diff --git a/Cargo.lock b/Cargo.lock index 3150d58..59c2fe8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,9 +76,9 @@ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "beef09f85ae72cea1ef96ba6870c51e6382ebfa4f0e85b643459331f3daa5be0" dependencies = [ "unicode-ident", ] @@ -175,9 +175,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" diff --git a/Makefile b/Makefile index 11e4014..f45add5 100644 --- a/Makefile +++ b/Makefile @@ -159,16 +159,16 @@ major: ## bump a major version ######## .PHONY: dist-py-wheel dist-py-sdist dist-rs dist-check dist publish -dist-py-wheel: # build python wheel +dist-py-wheel: ## build python wheel python -m cibuildwheel --output-dir dist -dist-py-sdist: # build python sdist +dist-py-sdist: ## build python sdist python -m build --sdist -o dist dist-js: # build js dists cd js; pnpm pack -dist-rs: # build rust dists +dist-rs: ## build rust dists make -C rust dist dist-check: ## run python dist checker with twine @@ -176,7 +176,7 @@ dist-check: ## run python dist checker with twine dist: clean build dist-rs dist-js dist-py-wheel dist-py-sdist dist-check ## build all dists -publish: dist # publish python assets +publish: dist ## publish python assets ######### # CLEAN # diff --git a/js/.prettierignore b/js/.prettierignore deleted file mode 100644 index 664db10..0000000 --- a/js/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -*.png -*.svg diff --git a/js/package.json b/js/package.json index 66297b3..c192497 100644 --- a/js/package.json +++ b/js/package.json @@ -34,17 +34,17 @@ "build": "npm-run-all build:rust build:wasm-bindgen build:prod", "clean": "rm -rf dist lib playwright-report ../python_template_rust/extension", "dev": "npm-run-all -p start watch", - "lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*\" \"*.mjs\" \"*.json\"", + "lint:js": "prettier --check \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"", "lint:rust": "cargo clippy --all-features && cargo fmt --all -- --check", "lint": "npm-run-all lint:*", - "fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx}\" \"tests/**/*\" \"*.mjs\" \"*.json\"", + "fix:js": "prettier --write \"src/**/*.{js,ts,jsx,tsx,less,css}\" \"tests/**/*.{js,ts,jsx,tsx}\" \"*.mjs\" \"*.json\"", "fix:rust": "cargo fmt --all", "fix": "npm-run-all fix:*", "preinstall": "npx only-allow pnpm", "prepack": "pnpm run build", "start": "http-server -p 3000 -o examples/", "start:tests": "http-server -p 3000 ", - "test:js": "TZ=UTC playwright test", + "test:js": "playwright test", "test:rust": "cargo test -- --show-output", "test": "npm-run-all test:rust test:js", "watch": "nodemon --watch src -e ts,less,html --exec \"pnpm build:debug\"" diff --git a/pyproject.toml b/pyproject.toml index 1e51a03..724f44e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,8 @@ develop = [ "check-manifest", "cibuildwheel", "codespell>=2.4,<2.5", - "hatch-jupyter-builder", + "hatch-js", + "hatch-rs", "hatchling", "mdformat>=0.7.22,<0.8", "mdformat-tables>=1", @@ -105,7 +106,6 @@ ignore = [ ] [tool.cibuildwheel] -before-build = "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y" build = "cp39-*" test-command = "pytest -vvv {project}/python_template_rust/tests" test-requires = ["pytest", "pytest-cov", "pytest-sugar", "pytest-xdist"] @@ -115,28 +115,15 @@ before-build = """ curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y rustup target add aarch64-unknown-linux-gnu rustup target add x86_64-unknown-linux-gnu -rustup show """ -environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always"} -skip = "*i686 musllinux*" +environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always", SKIP_HATCH_JS="1" } +skip = "*i686* *musllinux*" [tool.cibuildwheel.macos] -before-build = """ -curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y -rustup target add aarch64-apple-darwin -rustup target add x86_64-apple-darwin -rustup show -""" environment = {PATH="$HOME/.cargo/bin:$PATH", CARGO_TERM_COLOR="always", MACOS_DEPLOYMENT_TARGET=11.0} archs = "arm64" [tool.cibuildwheel.windows] -before-build = """ -curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=minimal -y -rustup target add x86_64-pc-windows-msvc -rustup target add aarch64-pc-windows-msvc -rustup show -""" environment = {PATH="$UserProfile\\.cargo\bin;$PATH", CARGO_TERM_COLOR="always"} skip = "*win32 *arm_64" diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ee8f650..26fc196 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] name = "itoa" @@ -17,14 +17,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "python_template_rust" -version = "0.1.0" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "quote" version = "1.0.36" @@ -34,6 +26,14 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "python_template_rust" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "ryu" version = "1.0.18"