From 6a8af4787b4beb773b54de0ee59f3229d6270bc3 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:43:46 -0700 Subject: [PATCH] rename project --- .copier-answers.yml | 4 +-- .gitignore | 2 +- Makefile | 14 +++++----- README.md | 12 ++++----- js/build.mjs | 4 +-- js/package.json | 10 +++---- js_template/tests/test_all.py | 5 ---- pyproject.toml | 26 +++++++++---------- .../__init__.py | 0 python_template_js/tests/test_all.py | 5 ++++ 10 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 js_template/tests/test_all.py rename {js_template => python_template_js}/__init__.py (100%) create mode 100644 python_template_js/tests/test_all.py diff --git a/.copier-answers.yml b/.copier-answers.yml index a545a60..2653607 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,10 +1,10 @@ # Changes here will be overwritten by Copier -_commit: 33cc159 +_commit: 70d506b _src_path: https://github.com/python-project-templates/base.git add_extension: js email: 3105306+timkpaine@users.noreply.github.com github: python-project-templates project_description: A JavaScript-Python project template -project_name: js template +project_name: python template js python_version_primary: '3.11' team: Python Project Template Authors diff --git a/.gitignore b/.gitignore index 796c587..8bda46d 100644 --- a/.gitignore +++ b/.gitignore @@ -134,7 +134,7 @@ _template/labextension # JS js/node_modules js/dist -js_template/extension +python_template_js/extension # Jupyter .ipynb_checkpoints diff --git a/Makefile b/Makefile index 82c77b3..c513b70 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,8 @@ install: ## install python library ######### .PHONY: lint-py lint-js lint lints lint-py: ## run python linter with ruff - python -m ruff check js_template - python -m ruff format --check js_template + python -m ruff check python_template_js + python -m ruff format --check python_template_js lint-js: ## run js linter cd js; pnpm lint @@ -41,8 +41,8 @@ lints: lint .PHONY: fix-py fix-js fix format fix-py: ## fix python formatting with ruff - python -m ruff check --fix js_template - python -m ruff format js_template + python -m ruff check --fix python_template_js + python -m ruff format python_template_js fix-js: ## fix js formatting cd js; pnpm fix @@ -66,20 +66,20 @@ checks: check-manifest check: checks annotate: ## run python type annotation checks with mypy - python -m mypy ./js_template + python -m mypy ./python_template_js ######### # TESTS # ######### .PHONY: test-py tests-py coverage-py test-py: ## run python tests - python -m pytest -v js_template/tests + python -m pytest -v python_template_js/tests # alias tests-py: test-py coverage-py: ## run python tests and collect test coverage - python -m pytest -v js_template/tests --cov=js_template --cov-report term-missing --cov-report xml + python -m pytest -v python_template_js/tests --cov=python_template_js --cov-report term-missing --cov-report xml .PHONY: test-js tests-js coverage-js test-js: ## run js tests diff --git a/README.md b/README.md index ff936b4..9848abd 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# js template +# python template js A JavaScript-Python project template -[![Build Status](https://github.com/python-project-templates/js-template/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/js-template/actions/workflows/build.yml) -[![codecov](https://codecov.io/gh/python-project-templates/js-template/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/js-template) -[![License](https://img.shields.io/github/license/python-project-templates/js-template)](https://github.com/python-project-templates/js-template) -[![PyPI](https://img.shields.io/pypi/v/js-template.svg)](https://pypi.python.org/pypi/js-template) -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/js-template/main?urlpath=lab) +[![Build Status](https://github.com/python-project-templates/python-template-js/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/python-template-js/actions/workflows/build.yml) +[![codecov](https://codecov.io/gh/python-project-templates/python-template-js/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/python-template-js) +[![License](https://img.shields.io/github/license/python-project-templates/python-template-js)](https://github.com/python-project-templates/python-template-js) +[![PyPI](https://img.shields.io/pypi/v/python-template-js.svg)](https://pypi.python.org/pypi/python-template-js) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/python-template-js/main?urlpath=lab) ## Overview diff --git a/js/build.mjs b/js/build.mjs index e7ddd76..0efb9eb 100644 --- a/js/build.mjs +++ b/js/build.mjs @@ -80,8 +80,8 @@ async function copy_img() { } async function copy_to_python() { - fs.mkdirSync("../js_template/extension", { recursive: true }); - cpy("dist/**/*", "../js_template/extension"); + fs.mkdirSync("../python_template_js/extension", { recursive: true }); + cpy("dist/**/*", "../python_template_js/extension"); } async function build_all() { diff --git a/js/package.json b/js/package.json index dcdce21..9b15404 100644 --- a/js/package.json +++ b/js/package.json @@ -1,8 +1,8 @@ { - "name": "js-template", + "name": "python-template-js", "version": "0.1.10", "description": "A JavaScript-Python project template", - "repository": "git@github.com:python-project-templates/js-template.git", + "repository": "git@github.com:python-project-templates/python-template-js.git", "author": "Python Project Template Authors <3105306+timkpaine@users.noreply.github.com>", "license": "Apache-2.0", "private": true, @@ -28,7 +28,7 @@ "scripts": { "build:debug": "node build.mjs --debug", "build": "node build.mjs", - "clean": "rm -rf dist playwright-report ../js_template/extension", + "clean": "rm -rf dist playwright-report ../python_template_js/extension", "dev": "npm-run-all -p start watch", "lint": "prettier --check \"src/**/*\" \"tests/**/*\" \"*.mjs\" \"*.json\"", "fix": "prettier --write \"src/**/*\" \"tests/**/*\" \"*.mjs\" \"*.json\"", @@ -41,11 +41,11 @@ }, "dependencies": {}, "devDependencies": { - "@finos/perspective-esbuild-plugin": "^3.1.0", + "@finos/perspective-esbuild-plugin": "^2.10.1", "@playwright/test": "^1.47.0", "@prospective.co/procss": "^0.1.16", "cpy": "^11.1.0", - "esbuild": "^0.24.0", + "esbuild": "^0.23.1", "esbuild-plugin-less": "^1.3.9", "http-server": "^14.1.1", "nodemon": "^3.1.4", diff --git a/js_template/tests/test_all.py b/js_template/tests/test_all.py deleted file mode 100644 index d48930f..0000000 --- a/js_template/tests/test_all.py +++ /dev/null @@ -1,5 +0,0 @@ -from js_template import * # noqa - - -def test_all(): - assert True diff --git a/pyproject.toml b/pyproject.toml index a3feb06..747b0cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ build-backend="hatchling.build" [project] -name = "js-template" +name = "python-template-js" authors = [{name = "Python Project Template Authors", email = "3105306+timkpaine@users.noreply.github.com"}] description="A JavaScript-Python project template" readme = "README.md" @@ -30,8 +30,8 @@ classifiers = [ dependencies = [] [project.urls] -Repository = "https://github.com/python-project-templates/js-template" -Homepage = "https://github.com/python-project-templates/js-template" +Repository = "https://github.com/python-project-templates/python-template-js" +Homepage = "https://github.com/python-project-templates/python-template-js" [project.optional-dependencies] develop = [ @@ -55,7 +55,7 @@ commit = true tag = true [[tool.bumpversion.files]] -filename = "js_template/__init__.py" +filename = "python_template_js/__init__.py" search = '__version__ = "{current_version}"' replace = '__version__ = "{new_version}"' @@ -75,13 +75,13 @@ ignore = [ "js/pnpm-lock.yaml", "Makefile", "setup.py", - "js_template/**/*", + "python_template_js/**/*", ] [tool.coverage.run] branch = true omit = [ - "js_template/tests/integration/", + "python_template_js/tests/integration/", ] [tool.coverage.report] exclude_also = [ @@ -94,7 +94,7 @@ fail_under = 50 [tool.hatch.build] artifacts = [ - "js_template/extension", + "python_template_js/extension", ] [tool.hatch.build.sources] @@ -102,7 +102,7 @@ src = "/" [tool.hatch.build.targets.sdist] include = [ - "/js_template", + "/python_template_js", "/js", "LICENSE", "README.md", @@ -117,7 +117,7 @@ exclude = [ [tool.hatch.build.targets.wheel] include = [ - "/js_template", + "/python_template_js", ] exclude = [ ".copier-answers.yml", @@ -131,10 +131,10 @@ exclude = [ [tool.hatch.build.hooks.jupyter-builder] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ - "js_template/extension/cdn/index.js", + "python_template_js/extension/cdn/index.js", ] skip-if-exists = [ - "js_template/extension/cdn/index.js", + "python_template_js/extension/cdn/index.js", ] dependencies = [ "hatch-jupyter-builder", @@ -148,7 +148,7 @@ npm = "pnpm" [tool.pytest.ini_options] addopts = ["-vvv", "--junitxml=junit.xml"] asyncio_mode = "strict" -testpaths = "js_template/tests" +testpaths = "python_template_js/tests" [tool.ruff] line-length = 150 @@ -159,7 +159,7 @@ extend-select = ["I"] [tool.ruff.lint.isort] combine-as-imports = true default-section = "third-party" -known-first-party = ["js_template"] +known-first-party = ["python_template_js"] section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] [tool.ruff.lint.per-file-ignores] diff --git a/js_template/__init__.py b/python_template_js/__init__.py similarity index 100% rename from js_template/__init__.py rename to python_template_js/__init__.py diff --git a/python_template_js/tests/test_all.py b/python_template_js/tests/test_all.py new file mode 100644 index 0000000..9ab4ea5 --- /dev/null +++ b/python_template_js/tests/test_all.py @@ -0,0 +1,5 @@ +from python_template_js import * # noqa + + +def test_all(): + assert True