diff --git a/Makefile b/Makefile index 7d005ea..e7fdb38 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,7 @@ test-cpp: test-js: cd ../python-template-js && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit" cd ../python-template-js && make develop + cd ../python-template-js && git add js/pnpm-lock.yaml && git commit -m "lockfile" cd ../python-template-js && make lint cd ../python-template-js && make checks cd ../python-template-js && make test @@ -79,6 +80,7 @@ test-js: test-jupyter: cd ../python-template-jupyter && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit" cd ../python-template-jupyter && make develop + cd ../python-template-jupyter && git add js/pnpm-lock.yaml && git commit -m "lockfile" cd ../python-template-jupyter && make lint cd ../python-template-jupyter && make checks cd ../python-template-jupyter && make test @@ -95,6 +97,7 @@ test-rustjswasm: cd ../python-template-rustjswasm && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit" cd ../python-template-rustjswasm && make develop cd ../python-template-rustjswasm && git add Cargo.lock && git commit -m "lockfile" + cd ../python-template-rustjswasm && git add js/pnpm-lock.yaml && git commit -m "lockfile" cd ../python-template-rustjswasm && make lint cd ../python-template-rustjswasm && make checks cd ../python-template-rustjswasm && make test @@ -102,6 +105,7 @@ test-rustjswasm: test-cppjswasm: cd ../python-template-cppjswasm && git config --global user.name "github-actions" && git config --global user.email "41898282+github-actions[bot]@users.noreply.github.c@example.com" && git init && git add . && git commit -m "initial commit" cd ../python-template-cppjswasm && make develop + cd ../python-template-cppjswasm && git add js/pnpm-lock.yaml && git commit -m "lockfile" cd ../python-template-cppjswasm && make lint cd ../python-template-cppjswasm && make checks cd ../python-template-cppjswasm && make test diff --git a/cpp/.gitignore.jinja b/cpp/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/cpp/.gitignore.jinja +++ b/cpp/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/cppjswasm/.gitignore.jinja b/cppjswasm/.gitignore.jinja index e0f91eb..921cf3c 100644 --- a/cppjswasm/.gitignore.jinja +++ b/cppjswasm/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension diff --git a/examples/rustjswasm.yaml b/examples/rustjswasm.yaml index c301273..cf0ad16 100644 --- a/examples/rustjswasm.yaml +++ b/examples/rustjswasm.yaml @@ -4,7 +4,7 @@ add_wiki: true add_extension: rustjswasm email: 3105306+timkpaine@users.noreply.github.com github: python-project-templates -project_description: A Rust-Python project template +project_description: A Rust-JavaScript-Python project template project_name: python template rustjswasm python_version_primary: '3.11' team: Python Project Template Authors diff --git a/js/.gitignore.jinja b/js/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/js/.gitignore.jinja +++ b/js/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/js/Makefile.jinja b/js/Makefile.jinja index 1bf96db..5fb6177 100644 --- a/js/Makefile.jinja +++ b/js/Makefile.jinja @@ -73,15 +73,15 @@ format: fix ################ # Other Checks # ################ -.PHONY: check-manifest check-dist checks check - -check-manifest: ## check python sdist manifest with check-manifest - check-manifest -v +.PHONY: check-dist check-types checks check 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/pyproject.toml.jinja b/js/pyproject.toml.jinja index 57ce312..cfa1e66 100644 --- a/js/pyproject.toml.jinja +++ b/js/pyproject.toml.jinja @@ -37,7 +37,6 @@ develop = [ "build", "bump-my-version", "check-dist", - "check-manifest", "codespell", "hatch-js", "hatchling", @@ -79,17 +78,6 @@ filename = "js/package.json" search = '"version": "{current_version}"' replace = '"version": "{new_version}"' -[tool.check-manifest] -ignore = [ - ".copier-answers.yaml", - "js/pnpm-lock.yaml", - "Makefile", - ".vscode/*", - "{{module}}/extension/**/*", - "docs/**/*", - "js/dist/**/*", -] - [tool.coverage.run] branch = true omit = [ @@ -118,8 +106,8 @@ packages = [ "js", ] exclude = [ - "/js/dist", - "/js/node_modules", + "js/dist", + "js/node_modules", ] [tool.hatch.build.targets.wheel] @@ -127,7 +115,7 @@ packages = [ "{{module}}", ] exclude = [ - "/js", + "js", ] [tool.hatch.build.hooks.hatch-js] diff --git a/jupyter/.gitignore.jinja b/jupyter/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/jupyter/.gitignore.jinja +++ b/jupyter/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/jupyter/Makefile.jinja b/jupyter/Makefile.jinja index 6d14b03..ec0beb0 100644 --- a/jupyter/Makefile.jinja +++ b/jupyter/Makefile.jinja @@ -73,15 +73,15 @@ format: fix ################ # Other Checks # ################ -.PHONY: check-manifest check-dist checks check - -check-manifest: ## check python sdist manifest with check-manifest - check-manifest -v +.PHONY: check-dist check-types checks check 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/jupyter/js/package.json.jinja b/jupyter/js/package.json.jinja index 2024443..a07b697 100644 --- a/jupyter/js/package.json.jinja +++ b/jupyter/js/package.json.jinja @@ -31,9 +31,10 @@ }, "scripts": { "build:babel": "babel src/ --source-maps --out-dir lib/", + "build:extension": "mkdirp ../{{module}}/extension/ && cpy --flat 'src/extension/*' '../{{module}}/extension/'", "build:nbextension": "mkdirp ../{{module}}/nbextension/static/ && cpy --flat 'src/notebook.js' '../{{module}}/nbextension/static/'", "build:labextension": "rimraf ../{{module}}/labextension && jupyter labextension build .", - "build": "pnpm clean && pnpm build:babel && pnpm build:labextension && pnpm build:nbextension", + "build": "pnpm clean && pnpm build:babel && pnpm build:extension && pnpm build:labextension && pnpm build:nbextension", "clean": "rimraf lib", "fix": "pnpm lint --fix", "lint": "eslint -c .eslintrc.js --ext .js src/ tests/", diff --git a/jupyter/{{module}}/extension/install.json.jinja b/jupyter/js/src/extension/install.json.jinja similarity index 100% rename from jupyter/{{module}}/extension/install.json.jinja rename to jupyter/js/src/extension/install.json.jinja diff --git a/jupyter/{{module}}/extension/{{module}}.json.jinja b/jupyter/js/src/extension/{{module}}.json.jinja similarity index 100% rename from jupyter/{{module}}/extension/{{module}}.json.jinja rename to jupyter/js/src/extension/{{module}}.json.jinja diff --git a/jupyter/pyproject.toml.jinja b/jupyter/pyproject.toml.jinja index 0a7b8e4..22df8d0 100644 --- a/jupyter/pyproject.toml.jinja +++ b/jupyter/pyproject.toml.jinja @@ -40,7 +40,6 @@ develop = [ "build", "bump-my-version", "check-dist", - "check-manifest", "codespell", "hatch-js", "hatchling", @@ -83,20 +82,6 @@ filename = "js/package.json" search = '"version": "{current_version}"' replace = '"version": "{new_version}"' -[tool.check-manifest] -ignore = [ - ".copier-answers.yaml", - "js/pnpm-lock.yaml", - "Makefile", - ".vscode/*", - "{{module}}/extension/**", - "{{module}}/labextension/**", - "{{module}}/nbextension/**", - "docs/**/*", - "js/dist/**/*", - "js/lib/*", -] - [tool.coverage.run] branch = true omit = [ @@ -126,8 +111,8 @@ packages = [ "js", ] exclude = [ - "/js/dist", - "/js/node_modules", + "js/dist", + "js/node_modules", ] [tool.hatch.build.targets.wheel] @@ -135,7 +120,7 @@ packages = [ "{{module}}", ] exclude = [ - "/js" + "js" ] [tool.hatch.build.targets.wheel.shared-data] diff --git a/python/.gitignore.jinja b/python/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/python/.gitignore.jinja +++ b/python/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/rust/.gitignore.jinja b/rust/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/rust/.gitignore.jinja +++ b/rust/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/rust/Cargo.toml.jinja b/rust/Cargo.toml.jinja index 95f629d..67886e8 100644 --- a/rust/Cargo.toml.jinja +++ b/rust/Cargo.toml.jinja @@ -6,7 +6,7 @@ publish = false [lib] name = "{{module}}" -path = "src/lib.rs" +path = "rust/python/lib.rs" crate-type = ["cdylib"] [dependencies] diff --git a/rust/Makefile.jinja b/rust/Makefile.jinja index 3608dd9..f577583 100644 --- a/rust/Makefile.jinja +++ b/rust/Makefile.jinja @@ -74,15 +74,15 @@ format: fix ################ # Other Checks # ################ -.PHONY: check-manifest check-dist checks check - -check-manifest: ## check python sdist manifest with check-manifest - check-manifest -v +.PHONY: check-dist check-types checks check 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/rust/pyproject.toml.jinja b/rust/pyproject.toml.jinja index 5f03ef6..1038b5e 100644 --- a/rust/pyproject.toml.jinja +++ b/rust/pyproject.toml.jinja @@ -38,7 +38,6 @@ develop = [ "build", "bump-my-version", "check-dist", - "check-manifest", "cibuildwheel", "codespell", "hatch-rs", @@ -86,17 +85,6 @@ filename = "rust/Cargo.toml" search = 'version = "{current_version}"' replace = 'version = "{new_version}"' -[tool.check-manifest] -ignore = [ - ".copier-answers.yaml", - "Cargo.toml", - "Cargo.lock", - "Makefile", - "docs/**/*", - "rust/**/*", - "src/**/*", -] - [tool.cibuildwheel] build = "cp310-*" test-command = "pytest -vvv {project}/{{module}}/tests" @@ -152,14 +140,13 @@ path = "." [tool.hatch.build.targets.sdist] packages = [ "{{module}}", -] -include = [ "rust", "src", "Cargo.toml", "Cargo.lock", ] exclude = [ + "rust/Makefile", "target", ] diff --git a/rust/src/example/mod.rs.jinja b/rust/rust/python/example/mod.rs.jinja similarity index 100% rename from rust/src/example/mod.rs.jinja rename to rust/rust/python/example/mod.rs.jinja diff --git a/rust/src/lib.rs.jinja b/rust/rust/python/lib.rs.jinja similarity index 100% rename from rust/src/lib.rs.jinja rename to rust/rust/python/lib.rs.jinja diff --git a/rustjswasm/.gitignore.jinja b/rustjswasm/.gitignore.jinja index a8a5af1..4ce1c63 100644 --- a/rustjswasm/.gitignore.jinja +++ b/rustjswasm/.gitignore.jinja @@ -141,14 +141,12 @@ js/node_modules js/test-results js/playwright-report js/*.tgz -{{module}}/extension # Jupyter .ipynb_checkpoints .autoversion Untitled*.ipynb -!{{module}}/extension/{{module}}.json -!{{module}}/extension/install.json +{{module}}/extension {{module}}/nbextension {{module}}/labextension @@ -157,3 +155,7 @@ Untitled*.ipynb # Rust target + +# Hydra +outputs/ +multirun/ diff --git a/rustjswasm/Cargo.toml.jinja b/rustjswasm/Cargo.toml.jinja index b5d1833..c83d866 100644 --- a/rustjswasm/Cargo.toml.jinja +++ b/rustjswasm/Cargo.toml.jinja @@ -6,7 +6,7 @@ publish = false [lib] name = "{{module}}" -path = "src/lib.rs" +path = "rust/python/lib.rs" crate-type = ["cdylib"] [dependencies] diff --git a/rustjswasm/Makefile.jinja b/rustjswasm/Makefile.jinja index 615663f..f245a33 100644 --- a/rustjswasm/Makefile.jinja +++ b/rustjswasm/Makefile.jinja @@ -88,15 +88,15 @@ format: fix ################ # Other Checks # ################ -.PHONY: check-manifest check-dist checks check - -check-manifest: ## check python sdist manifest with check-manifest - check-manifest -v +.PHONY: check-dist check-types checks check 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/rustjswasm/pyproject.toml.jinja b/rustjswasm/pyproject.toml.jinja index b460d48..42547e9 100644 --- a/rustjswasm/pyproject.toml.jinja +++ b/rustjswasm/pyproject.toml.jinja @@ -39,7 +39,6 @@ develop = [ "build", "bump-my-version", "check-dist", - "check-manifest", "cibuildwheel", "codespell", "hatch-js", @@ -98,21 +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/*", - "{{module}}/extension/**/*", - "docs/**/*", - "js/**/*", - "rust/**/*", - "src/**/*", -] - [tool.cibuildwheel] build = "cp310-*" test-command = "pytest -vvv {project}/{{module}}/tests" @@ -165,8 +149,6 @@ path = "." [tool.hatch.build.targets.sdist] packages = [ "{{module}}", -] -include = [ "js", "rust", "src", @@ -175,6 +157,7 @@ include = [ ] exclude = [ "js/node_modules", + "rust/Makefile", "target", ] diff --git a/rustjswasm/src/example/mod.rs.jinja b/rustjswasm/rust/python/example/mod.rs.jinja similarity index 100% rename from rustjswasm/src/example/mod.rs.jinja rename to rustjswasm/rust/python/example/mod.rs.jinja diff --git a/rustjswasm/src/lib.rs.jinja b/rustjswasm/rust/python/lib.rs.jinja similarity index 100% rename from rustjswasm/src/lib.rs.jinja rename to rustjswasm/rust/python/lib.rs.jinja