Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare metadata in pyproject.toml, remove hatch-nodejs-version plugin #427

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jupyter_server_proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from jupyter_server.utils import url_path_join as ujoin

from ._version import __version__ # noqa
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add an __all__ so this doesn't have to be noqa

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like the __all__ list everythign currently exported or only some attributes (possibly breaking)?

Ideally, we'd have __all__ listing only what was needed to be exported historically, but I'm not confident on constraining what we export at this point.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess once something has been hoisted to __init__.py, for whatever reason, it is part of the public API. Doing in-the-wild searching sounds more tiresome.

This might be an appropriate time to consider getting on the recent push to get more of the stack working with mypy, with a backstop of the unused-imports rules from ruff, which can more generally be informed by sp-repo-review. This is likely better than making on-the-fly, case-by-case calls on specific repos.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds interesting @bollwyvl! I'm not able to drive that effort as part of this PR though, feeling somewhat overloaded atm :/

from .api import IconHandler, ServersInfoHandler
from .config import ServerProxy as ServerProxyConfig
from .config import get_entrypoint_server_processes, make_handlers, make_server_process
Expand Down
4 changes: 4 additions & 0 deletions jupyter_server_proxy/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# __version__ should be updated using tbump, based on configuration in
# pyproject.toml, according to instructions in RELEASE.md.
#
__version__ = "4.1.1-0.dev"
consideRatio marked this conversation as resolved.
Show resolved Hide resolved
35 changes: 19 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-jupyter-builder >=0.5",
"hatch-nodejs-version",
"hatchling >=1.4.0",
"hatch-jupyter-builder >=0.8.3",
"hatchling >=1.18.0",
"jupyterlab >=4.0.6,<5.0.0a0",
]

Expand All @@ -17,12 +16,13 @@ requires = [
#
[project]
name = "jupyter_server_proxy"
dynamic = [
"authors",
"description",
"keywords",
"urls",
"version",
version = "4.1.1-0.dev"
description = "A Jupyter server extension to run additional processes and proxy to them that comes bundled JupyterLab extension to launch pre-defined processes."
keywords = ["jupyter", "jupyterlab", "jupyterlab-extension"]
authors = [
{ name = "Ryan Lovett", email = "[email protected]" },
{ name = "Yuvi Panda", email = "[email protected]" },
{ name = "Jupyter Development Team", email = "[email protected]" },
]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -75,10 +75,14 @@ lab = [
"notebook >=7",
]

[tool.hatch.version]
source = "nodejs"
path = "labextension/package.json"
[project.urls]
Documentation = "https://jupyter-server-proxy.readthedocs.io"
Source = "https://github.com/jupyterhub/jupyter-server-proxy"
Tracker = "https://github.com/jupyterhub/jupyter-server-proxy/issues"


# hatch ref: https://hatch.pypa.io/latest/
#
[tool.hatch.build.targets.sdist]
artifacts = [
"jupyter_server_proxy/labextension",
Expand All @@ -101,10 +105,6 @@ exclude = [
# Set to true to allow testing of git+https://github.com/user/repo@sha dependencies
allow-direct-references = false

[tool.hatch.metadata.hooks.nodejs]
path = "labextension/package.json"
fields = ["description", "authors", "urls"]

[tool.hatch.build.hooks.jupyter-builder]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
Expand Down Expand Up @@ -187,6 +187,9 @@ regex = '''
message_template = "Bump to {new_version}"
tag_template = "v{new_version}"

[[tool.tbump.file]]
src = "pyproject.toml"

[[tool.tbump.file]]
src = "labextension/package.json"

Expand Down
Loading