diff --git a/.copier-answers.yaml b/.copier-answers.yaml index 321f1f4..e32417d 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: 37f89c1 +_commit: 3160d4c _src_path: https://github.com/python-project-templates/base.git add_docs: false add_extension: rustjswasm diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9a66af9..84b1386 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -65,7 +65,7 @@ jobs: run: make coverage - name: Upload test results (Python) - uses: actions/upload-artifact@v6 + uses: actions/upload-artifact@v7 with: name: test-results-${{ matrix.os }}-${{ matrix.python-version }} path: '**/junit.xml' @@ -83,7 +83,7 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: platforms: all if: runner.os == 'Linux' && runner.arch == 'X64' @@ -106,7 +106,7 @@ jobs: CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=11.0 if: matrix.os != 'ubuntu-latest' - - uses: actions/upload-artifact@v6 + - uses: actions/upload-artifact@v7 with: name: dist-${{matrix.os}} path: dist diff --git a/.gitignore b/.gitignore index cf0af0a..765382a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ __pycache__/ *.exp *.lib +# Rust +target + # Distribution / packaging .Python build/ @@ -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 @@ -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 @@ -141,14 +127,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -zarc/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!zarc/extension/zarc.json -!zarc/extension/install.json +zarc/extension zarc/nbextension zarc/labextension @@ -157,3 +141,7 @@ zarc/labextension # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/Cargo.lock b/Cargo.lock index 35c8d56..4ec3acc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - [[package]] name = "bumpalo" version = "3.19.1" @@ -26,15 +20,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "indoc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" -dependencies = [ - "rustversion", -] - [[package]] name = "inventory" version = "0.3.21" @@ -50,15 +35,6 @@ version = "0.2.179" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -82,36 +58,33 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.27.2" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d" +checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1" dependencies = [ - "indoc", "inventory", "libc", - "memoffset", "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", - "unindent", ] [[package]] name = "pyo3-build-config" -version = "0.27.2" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6" +checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7" dependencies = [ "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.27.2" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089" +checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc" dependencies = [ "libc", "pyo3-build-config", @@ -119,9 +92,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.27.2" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02" +checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -131,9 +104,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.27.2" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9" +checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a" dependencies = [ "heck", "proc-macro2", @@ -210,17 +183,11 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unindent" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" - [[package]] name = "wasm-bindgen" -version = "0.2.106" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ "cfg-if", "once_cell", @@ -231,9 +198,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.106" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -241,9 +208,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.106" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ "bumpalo", "proc-macro2", @@ -254,9 +221,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.106" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] diff --git a/Cargo.toml b/Cargo.toml index ab8ac22..c50292b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,12 +6,12 @@ publish = false [lib] name = "zarc" -path = "src/lib.rs" +path = "rust/python/lib.rs" crate-type = ["cdylib"] [dependencies] zarc = { path = "./rust", version = "*" } -pyo3 = { version = "0.27.1", features = ["abi3-py39", "extension-module", "multiple-pymethods"] } +pyo3 = { version = "0.28.2", features = ["abi3", "extension-module", "multiple-pymethods"] } [profile.release] panic = 'abort' diff --git a/Makefile b/Makefile index 03fc771..0f9e790 100644 --- a/Makefile +++ b/Makefile @@ -88,12 +88,15 @@ format: fix ################ # Other Checks # ################ -.PHONY: check-manifest checks check +.PHONY: check-dist check-types checks check -check-manifest: ## check python sdist manifest with check-manifest - check-manifest -v +check-dist: ## check python sdist and wheel with check-dist + check-dist -v -checks: check-manifest +check-types: ## check python types with ty + ty check --python $$(which python) + +checks: check-dist # alias check: checks diff --git a/js/Cargo.toml b/js/Cargo.toml index 3c6aef0..697d341 100644 --- a/js/Cargo.toml +++ b/js/Cargo.toml @@ -13,4 +13,4 @@ crate-type = ["cdylib"] [dependencies] zarc = { path = "../rust", version = "*" } -wasm-bindgen = "0.2.108" +wasm-bindgen = "0.2.114" diff --git a/js/package.json b/js/package.json index 8f09a3c..e13a86b 100644 --- a/js/package.json +++ b/js/package.json @@ -26,7 +26,7 @@ "access": "public" }, "scripts": { - "setup": "cargo install -f wasm-bindgen-cli --version 0.2.108", + "setup": "cargo install -f wasm-bindgen-cli --version 0.2.114", "build:debug": "node build.mjs --debug", "build:rust": "cargo build --release --all-features --target wasm32-unknown-unknown", "build:wasm-bindgen": "wasm-bindgen ../target/wasm32-unknown-unknown/release/zarc.wasm --out-dir ./dist/pkg --target web", @@ -55,12 +55,12 @@ "@playwright/test": "^1.56.1", "@prospective.co/procss": "^0.1.17", "cpy": "^12.1.0", - "esbuild": "^0.27.0", + "esbuild": "^0.27.2", "esbuild-plugin-less": "^1.3.35", "http-server": "^14.1.1", "nodemon": "^3.1.10", "npm-run-all": "^4.1.5", - "prettier": "^3.7.4", + "prettier": "^3.8.1", "typescript": "^5.9.3" } } diff --git a/js/pnpm-lock.yaml b/js/pnpm-lock.yaml index e7a1a70..2b7a600 100644 --- a/js/pnpm-lock.yaml +++ b/js/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: specifier: ^12.1.0 version: 12.1.0 esbuild: - specifier: ^0.27.0 + specifier: ^0.27.2 version: 0.27.2 esbuild-plugin-less: specifier: ^1.3.35 @@ -36,8 +36,8 @@ importers: specifier: ^4.1.5 version: 4.1.5 prettier: - specifier: ^3.7.4 - version: 3.7.4 + specifier: ^3.8.1 + version: 3.8.1 typescript: specifier: ^5.9.3 version: 5.9.3 @@ -888,8 +888,8 @@ packages: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} - prettier@3.7.4: - resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} + prettier@3.8.1: + resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==} engines: {node: '>=14'} hasBin: true @@ -2054,7 +2054,7 @@ snapshots: possible-typed-array-names@1.1.0: {} - prettier@3.7.4: {} + prettier@3.8.1: {} prr@1.0.1: optional: true diff --git a/pyproject.toml b/pyproject.toml index e036ecd..bed6717 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,17 +38,17 @@ dependencies = [] develop = [ "build", "bump-my-version", - "check-manifest", + "check-dist", "cibuildwheel", - "codespell>=2.4,<2.5", + "codespell", "hatch-js", "hatch-rs", "hatchling", - "mdformat>=0.7.22,<1.1", + "mdformat", "mdformat-tables>=1", "pytest", "pytest-cov", - "ruff>=0.9,<0.15", + "ruff", "twine", "ty", "uv", @@ -97,22 +97,6 @@ filename = "rust/Cargo.toml" search = 'version = "{current_version}"' replace = 'version = "{new_version}"' -[tool.check-manifest] -ignore = [ - ".copier-answers.yaml", - "Cargo.toml", - "Cargo.lock", - "js/pnpm-lock.yaml", - "Makefile", - ".vscode/*", - "zarc/extension/**/*", - "docs/**/*", - "js/dist/**/*", - "rust/.config/*", - "rust/Cargo.lock", - "rust/README.md", -] - [tool.cibuildwheel] build = "cp310-*" test-command = "pytest -vvv {project}/zarc/tests" @@ -140,6 +124,7 @@ branch = true omit = [ "zarc/tests/integration/", ] + [tool.coverage.report] exclude_also = [ "raise NotImplementedError", @@ -159,18 +144,22 @@ targets = [ [tool.hatch.build.hooks.hatch-rs] verbose = true +abi3 = true module = "zarc" path = "." [tool.hatch.build.targets.sdist] packages = [ "zarc", - "/js", - "/rust", - "/src", + "js", + "rust", + "Cargo.toml", + "Cargo.lock", ] -sources = [ - ".", +exclude = [ + "js/node_modules", + "rust/Makefile", + "target", ] [tool.hatch.build.targets.wheel] @@ -178,9 +167,8 @@ packages = [ "zarc", ] exclude = [ - "/js", - "/rust", - "/src", + "js", + "rust", ] [tool.pytest.ini_options] diff --git a/rust/Makefile b/rust/Makefile index d10474a..9e184ae 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -5,7 +5,7 @@ requirements: ## install required dev dependencies rustup component add clippy cargo install -f cargo-nextest --locked cargo install -f cargo-llvm-cov - cargo install -f wasm-bindgen-cli --version 0.2.108 + cargo install -f wasm-bindgen-cli --version 0.2.114 rustup target add wasm32-unknown-unknown develop: requirements ## install required dev dependencies diff --git a/src/example/mod.rs b/rust/python/example/mod.rs similarity index 100% rename from src/example/mod.rs rename to rust/python/example/mod.rs diff --git a/src/lib.rs b/rust/python/lib.rs similarity index 100% rename from src/lib.rs rename to rust/python/lib.rs