Skip to content

Commit

Permalink
feat!: replace Jupyter Lab with VS Code notebook support (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
JWuzyk authored Feb 28, 2024
1 parent 59ba878 commit de61dbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ To update your Python project with the latest template:
| `development_environment` <br> ["simple", "strict"] | Whether to configure the development environment with a focus on simplicity or with a focus on strictness. In strict mode, additional [Ruff rules](https://beta.ruff.rs/docs/rules/) are added, and tools such as [Mypy](https://github.com/python/mypy) and [Pytest](https://github.com/pytest-dev/pytest) are set to strict mode. |
| `with_conventional_commits` <br> ["0", "1"] | If "1", [Commitizen](https://github.com/commitizen-tools/commitizen) will verify that your commits follow the [Conventional Commits](https://www.conventionalcommits.org/) standard. In return, `cz bump` may be used to automate [Semantic Versioning](https://semver.org/) and [Keep A Changelog](https://keepachangelog.com/). |
| `with_fastapi_api` <br> ["0", "1"] | If "1", [FastAPI](https://github.com/tiangolo/fastapi) is added as a run time dependency, FastAPI API stubs and tests are added, a `poe api` command for serving the API is added, and an `app` stage that packages the API is added to the Dockerfile. Additionally, the CI workflow will push the application as a Docker image instead of publishing the Python package. |
| `with_jupyter_lab` <br> ["0", "1"] | If "1", [JupyterLab](https://github.com/jupyterlab/jupyterlab) is added to Poetry's dev dependencies, and a `poe lab` command is added to start Jupyter Lab in the `notebooks/` directory. |
| `with_pydantic_typing` <br> ["0", "1"] | If "1", [Pydantic](https://github.com/samuelcolvin/pydantic) is added as a run time dependency, and the [Pydantic mypy plugin](https://pydantic-docs.helpmanual.io/mypy_plugin/) is enabled and configured. |
| `with_sentry_logging` <br> ["0", "1"] | If "1", [Sentry](https://github.com/getsentry/sentry-python) is added as a run time dependency, and a Sentry configuration stub and tests are added. |
| `with_streamlit_app` <br> ["0", "1"] | If "1", [Streamlit](https://github.com/streamlit/streamlit) is added as a run time dependency, a Streamlit application stub is added, a `poe app` command to serve the Streamlit app is added, and an `app` stage that packages the Streamlit app is added to the Dockerfile. Additionally, the CI workflow will push the application as a Docker image instead of publishing the Python package. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
"charliermarsh.ruff",
"ms-python.mypy-type-checker",
"ms-python.python",
{%- if cookiecutter.with_jupyter_lab|int %}
"ms-toolsai.jupyter",
{%- endif %}
"ryanluker.vscode-coverage-gutters",
"tamasfe.even-better-toml",
"visualstudioexptteam.vscodeintellicode"
Expand All @@ -38,7 +36,9 @@
100
],
"files.autoSave": "onFocusChange",
"jupyter.kernels.excludePythonEnvironments": ["/usr/local/bin/python"],
"mypy-type-checker.importStrategy": "fromEnvironment",
"notebook.formatOnSave.enabled": true,
"python.defaultInterpreterPath": "/opt/{{ cookiecutter.__package_name_kebab_case }}-env/bin/python",
"python.terminal.activateEnvironment": false,
"python.testing.pytestEnabled": true,
Expand Down
19 changes: 1 addition & 18 deletions {{ cookiecutter.__package_name_kebab_case }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ typeguard = ">=3.0.2"

[tool.poetry.group.dev.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/
cruft = ">=2.14.0"
{%- if cookiecutter.with_jupyter_lab|int %}
jupyterlab = ">=3.6.3"
{%- endif %}
ipykernel = ">=6.29.2"
pdoc = ">=13.1.1"
{%- if cookiecutter.private_package_repository_name %}

Expand Down Expand Up @@ -260,21 +258,6 @@ convention = "{{ cookiecutter.docstring_style|lower }}"
name = "outputdirectory"
options = ["--output-directory"]
default = "docs"
{%- if cookiecutter.with_jupyter_lab|int %}

[tool.poe.tasks.lab]
help = "Run Jupyter Lab"

[[tool.poe.tasks.lab.sequence]]
cmd = "mkdir -p notebooks"

[[tool.poe.tasks.lab.sequence]]
cmd = """
jupyter lab
--allow-root
--notebook-dir notebooks
"""
{%- endif %}

[tool.poe.tasks.lint]
help = "Lint this package"
Expand Down

0 comments on commit de61dbf

Please sign in to comment.