From add5ef50c5d6477e26a71f668a79833377bede1b Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:59:11 -0700 Subject: [PATCH] rename project --- .copier-answers.yml | 4 +-- .gitignore | 6 ++-- Makefile | 14 ++++---- README.md | 12 +++---- js/package.json | 12 +++---- js/src/index.js | 4 +-- jupyter_template/tests/test_all.py | 5 --- pyproject.toml | 32 +++++++++---------- .../__init__.py | 0 python_template_jupyter/tests/test_all.py | 5 +++ 10 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 jupyter_template/tests/test_all.py rename {jupyter_template => python_template_jupyter}/__init__.py (100%) create mode 100644 python_template_jupyter/tests/test_all.py diff --git a/.copier-answers.yml b/.copier-answers.yml index d038c54..0b8866f 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,10 +1,10 @@ # Changes here will be overwritten by Copier -_commit: 33cc159 +_commit: 65b6f3e _src_path: https://github.com/python-project-templates/base.git add_extension: jupyter email: 3105306+timkpaine@users.noreply.github.com github: python-project-templates project_description: A Jupyter-Python project template -project_name: jupyter template +project_name: python template jupyter python_version_primary: '3.11' team: Python Project Template Authors diff --git a/.gitignore b/.gitignore index d3f1c99..96ac9d5 100644 --- a/.gitignore +++ b/.gitignore @@ -135,13 +135,13 @@ _template/labextension js/coverage js/dist js/node_modules -jupyter_template/extension +python_template_jupyter/extension # Jupyter .ipynb_checkpoints .autoversion -jupyter_template/nbextension -jupyter_template/labextension +python_template_jupyter/nbextension +python_template_jupyter/labextension # Mac .DS_Store diff --git a/Makefile b/Makefile index 32d89ec..b03e20a 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 jupyter_template - python -m ruff format --check jupyter_template + python -m ruff check python_template_jupyter + python -m ruff format --check python_template_jupyter 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 jupyter_template - python -m ruff format jupyter_template + python -m ruff check --fix python_template_jupyter + python -m ruff format python_template_jupyter 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 ./jupyter_template + python -m mypy ./python_template_jupyter ######### # TESTS # ######### .PHONY: test-py tests-py coverage-py test-py: ## run python tests - python -m pytest -v jupyter_template/tests + python -m pytest -v python_template_jupyter/tests # alias tests-py: test-py coverage-py: ## run python tests and collect test coverage - python -m pytest -v jupyter_template/tests --cov=jupyter_template --cov-report term-missing --cov-report xml + python -m pytest -v python_template_jupyter/tests --cov=python_template_jupyter --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 6fd8638..5676ffe 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# jupyter template +# python template jupyter A Jupyter-Python project template -[![Build Status](https://github.com/python-project-templates/jupyter-template/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/jupyter-template/actions/workflows/build.yml) -[![codecov](https://codecov.io/gh/python-project-templates/jupyter-template/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/jupyter-template) -[![License](https://img.shields.io/github/license/python-project-templates/jupyter-template)](https://github.com/python-project-templates/jupyter-template) -[![PyPI](https://img.shields.io/pypi/v/jupyter-template.svg)](https://pypi.python.org/pypi/jupyter-template) -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/jupyter-template/main?urlpath=lab) +[![Build Status](https://github.com/python-project-templates/python-template-jupyter/actions/workflows/build.yml/badge.svg?branch=main&event=push)](https://github.com/python-project-templates/python-template-jupyter/actions/workflows/build.yml) +[![codecov](https://codecov.io/gh/python-project-templates/python-template-jupyter/branch/main/graph/badge.svg)](https://codecov.io/gh/python-project-templates/python-template-jupyter) +[![License](https://img.shields.io/github/license/python-project-templates/python-template-jupyter)](https://github.com/python-project-templates/python-template-jupyter) +[![PyPI](https://img.shields.io/pypi/v/python-template-jupyter.svg)](https://pypi.python.org/pypi/python-template-jupyter) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-project-templates/python-template-jupyter/main?urlpath=lab) ## Overview diff --git a/js/package.json b/js/package.json index 122fe87..31e1be6 100644 --- a/js/package.json +++ b/js/package.json @@ -1,8 +1,8 @@ { - "name": "jupyter-template", + "name": "python-template-jupyter", "version": "0.1.0", "description": "A Jupyter-Python project template", - "repository": "git@github.com:python-project-templates/jupyter-template.git", + "repository": "git@github.com:python-project-templates/python-template-jupyter.git", "author": "Python Project Template Authors <3105306+timkpaine@users.noreply.github.com>", "license": "Apache-2.0", "keywords": [ @@ -17,11 +17,11 @@ ], "jupyterlab": { "extension": "lib/index.js", - "outputDir": "../jupyter_template/labextension", + "outputDir": "../python_template_jupyter/labextension", "discovery": { "server": { "base": { - "name": "jupyter_template" + "name": "python_template_jupyter" }, "managers": [ "pip" @@ -31,8 +31,8 @@ }, "scripts": { "build:babel": "babel src/ --source-maps --out-dir lib/", - "build:nbextension": "mkdirp ../jupyter_template/nbextension/static/ && cpy --flat 'src/notebook.js' '../jupyter_template/nbextension/static/'", - "build:labextension": "rimraf ../jupyter_template/labextension && jupyter labextension build .", + "build:nbextension": "mkdirp ../python_template_jupyter/nbextension/static/ && cpy --flat 'src/notebook.js' '../python_template_jupyter/nbextension/static/'", + "build:labextension": "rimraf ../python_template_jupyter/labextension && jupyter labextension build .", "build": "pnpm clean && pnpm build:babel && pnpm build:labextension && pnpm build:nbextension", "clean": "rimraf lib", "fix": "pnpm lint --fix", diff --git a/js/src/index.js b/js/src/index.js index 19a3c34..b1f3f28 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -2,13 +2,13 @@ import "../style/index.css"; async function activate(app) { // eslint-disable-next-line no-console - console.log("JupyterLab extension jupyter-template is activated!"); + console.log("JupyterLab extension python-template-jupyter is activated!"); } const extension = { activate, autoStart: true, - id: "jupyter-template", + id: "python-template-jupyter", optional: [], requires: [], }; diff --git a/jupyter_template/tests/test_all.py b/jupyter_template/tests/test_all.py deleted file mode 100644 index 4c906ac..0000000 --- a/jupyter_template/tests/test_all.py +++ /dev/null @@ -1,5 +0,0 @@ -from jupyter_template import * # noqa - - -def test_all(): - assert True diff --git a/pyproject.toml b/pyproject.toml index cbbbefa..d895dae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = [ build-backend="hatchling.build" [project] -name = "jupyter-template" +name = "python-template-jupyter" authors = [{name = "Python Project Template Authors", email = "3105306+timkpaine@users.noreply.github.com"}] description="A Jupyter-Python project template" readme = "README.md" @@ -31,8 +31,8 @@ classifiers = [ dependencies = [] [project.urls] -Repository = "https://github.com/python-project-templates/jupyter-template" -Homepage = "https://github.com/python-project-templates/jupyter-template" +Repository = "https://github.com/python-project-templates/python-template-jupyter" +Homepage = "https://github.com/python-project-templates/python-template-jupyter" [project.optional-dependencies] develop = [ @@ -57,7 +57,7 @@ commit = true tag = true [[tool.bumpversion.files]] -filename = "jupyter_template/__init__.py" +filename = "python_template_jupyter/__init__.py" search = '__version__ = "{current_version}"' replace = '__version__ = "{new_version}"' @@ -77,14 +77,14 @@ ignore = [ "js/pnpm-lock.yaml", "Makefile", "setup.py", - "jupyter_template/labextension/**", - "jupyter_template/nbextension/**", + "python_template_jupyter/labextension/**", + "python_template_jupyter/nbextension/**", ] [tool.coverage.run] branch = true omit = [ - "jupyter_template/tests/integration/", + "python_template_jupyter/tests/integration/", ] [tool.coverage.report] exclude_also = [ @@ -97,8 +97,8 @@ fail_under = 50 [tool.hatch.build] artifacts = [ - "jupyter_template/nbextension", - "jupyter_template/labextension", + "python_template_jupyter/nbextension", + "python_template_jupyter/labextension", ] [tool.hatch.build.sources] @@ -106,7 +106,7 @@ src = "/" [tool.hatch.build.targets.sdist] include = [ - "/jupyter_template", + "/python_template_jupyter", "/js", "LICENSE", "README.md", @@ -121,7 +121,7 @@ exclude = [ [tool.hatch.build.targets.wheel] include = [ - "/jupyter_template", + "/python_template_jupyter", ] exclude = [ ".copier-answers.yml", @@ -133,15 +133,15 @@ exclude = [ ] [tool.hatch.build.targets.wheel.shared-data] -"jupyter_template/labextension" = "share/jupyter/labextensions/jupyter_template" +"python_template_jupyter/labextension" = "share/jupyter/labextensions/python_template_jupyter" [tool.hatch.build.hooks.jupyter-builder] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ - "jupyter_template/labextension/package.json", + "python_template_jupyter/labextension/package.json", ] skip-if-exists = [ - "jupyter_template/labextension/package.json", + "python_template_jupyter/labextension/package.json", ] dependencies = [ "hatch-jupyter-builder", @@ -155,7 +155,7 @@ npm = "pnpm" [tool.pytest.ini_options] addopts = ["-vvv", "--junitxml=junit.xml"] asyncio_mode = "strict" -testpaths = "jupyter_template/tests" +testpaths = "python_template_jupyter/tests" [tool.ruff] line-length = 150 @@ -166,7 +166,7 @@ extend-select = ["I"] [tool.ruff.lint.isort] combine-as-imports = true default-section = "third-party" -known-first-party = ["jupyter_template"] +known-first-party = ["python_template_jupyter"] section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] [tool.ruff.lint.per-file-ignores] diff --git a/jupyter_template/__init__.py b/python_template_jupyter/__init__.py similarity index 100% rename from jupyter_template/__init__.py rename to python_template_jupyter/__init__.py diff --git a/python_template_jupyter/tests/test_all.py b/python_template_jupyter/tests/test_all.py new file mode 100644 index 0000000..386e973 --- /dev/null +++ b/python_template_jupyter/tests/test_all.py @@ -0,0 +1,5 @@ +from python_template_jupyter import * # noqa + + +def test_all(): + assert True