Skip to content

Commit

Permalink
Bump the pip group with 7 updates (#16270)
Browse files Browse the repository at this point in the history
* Bump the pip group with 7 updates

Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx), [matplotlib](https://github.com/matplotlib/matplotlib), [pandas](https://github.com/pandas-dev/pandas), [scipy](https://github.com/scipy/scipy), [ruff](https://github.com/astral-sh/ruff), [pyyaml-include](https://github.com/tanbro/pyyaml-include) and [pydantic](https://github.com/pydantic/pydantic) to permit the latest version.

Updates `sphinx` to 7.3.7
- [Release notes](https://github.com/sphinx-doc/sphinx/releases)
- [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES.rst)
- [Commits](sphinx-doc/sphinx@v1.8.0...v7.3.7)

Updates `matplotlib` from 3.8.3 to 3.8.4
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](matplotlib/matplotlib@v3.8.3...v3.8.4)

Updates `pandas` from 2.2.1 to 2.2.2
- [Release notes](https://github.com/pandas-dev/pandas/releases)
- [Commits](pandas-dev/pandas@v2.2.1...v2.2.2)

Updates `scipy` from 1.12.0 to 1.13.0
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.12.0...v1.13.0)

Updates `ruff` from 0.3.5 to 0.4.2
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@v0.3.5...v0.4.2)

Updates `pyyaml-include` to 2.0.2.post1
- [Changelog](https://github.com/tanbro/pyyaml-include/blob/main/CHANGELOG.md)
- [Commits](tanbro/pyyaml-include@0.1a1...v2.0.2.post1)

Updates `pydantic` to 2.7.1
- [Release notes](https://github.com/pydantic/pydantic/releases)
- [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md)
- [Commits](pydantic/pydantic@v0.0.2...v2.7.1)

---
updated-dependencies:
- dependency-name: sphinx
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: matplotlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: pip
- dependency-name: pandas
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: pip
- dependency-name: scipy
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: pip
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: pip
- dependency-name: pyyaml-include
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: pydantic
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix ruff UP031

* More lint fixes

* Ignore UP031 for milestone_check.py

* Format

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
Co-authored-by: Frédéric Collonval <fcollonval@users.noreply.github.com>
  • Loading branch information
3 people committed May 16, 2024
1 parent 2d7b0ca commit d86e3cd
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repos:

# Check ruff version is aligned with the one in pyproject.toml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.2
hooks:
- id: ruff
args: ["--fix"]
Expand Down
8 changes: 4 additions & 4 deletions examples/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ def main():
parser.add_argument("--testPath", help="paths containing this string are tested")
args = parser.parse_args()

paths = [i for i in glob.glob("%s/*" % here) if osp.isdir(i)]
paths = [i for i in glob.glob(f"{here}/*") if osp.isdir(i)]

services_dir = osp.abspath(osp.join(here, "../packages/services/examples"))
paths += list(glob.glob("%s/*" % services_dir))
paths += list(glob.glob(f"{services_dir}/*"))
if args.testPath:
paths = [p for p in paths if args.testPath in p]

print("Testing %s" % paths)
print(f"Testing {paths}")
count = 0
failed = []
for path in sorted(paths):
Expand All @@ -64,7 +64,7 @@ def main():
msg = "The following examples failed:\n-{}".format("\n-".join(failed))
raise AssertionError(msg)

print("\n\n%s tests complete!" % count)
print(f"\n\n{count} tests complete!")


if __name__ == "__main__":
Expand Down
140 changes: 68 additions & 72 deletions jupyterlab/commands.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jupyterlab/extensions/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __init__(
) -> None:
super().__init__(parent=parent)
self.log.debug(
"Plugins in %s will managed on the %s level", self.__class__.__name__, self.level
f"Plugins in {self.__class__.__name__} will managed on the {self.level} level"
)
self.app_options = _ensure_options(app_options)
plugin_options_field = {f.name for f in fields(PluginManagerOptions)}
Expand Down
20 changes: 10 additions & 10 deletions jupyterlab/federated_labextensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def develop_labextension( # noqa
full_dest = normpath(pjoin(labext, destination))
if overwrite and os.path.lexists(full_dest):
if logger:
logger.info("Removing: %s" % full_dest)
logger.info(f"Removing: {full_dest}")
if os.path.isdir(full_dest) and not os.path.islink(full_dest):
shutil.rmtree(full_dest)
else:
Expand All @@ -129,15 +129,16 @@ def develop_labextension( # noqa
raise

elif not os.path.islink(full_dest):
raise ValueError("%s exists and is not a symlink" % full_dest)
msg = f"{full_dest} exists and is not a symlink"
raise ValueError(msg)

elif os.path.isdir(path):
path = pjoin(os.path.abspath(path), "") # end in path separator
for parent, _, files in os.walk(path):
dest_dir = pjoin(full_dest, parent[len(path) :])
if not os.path.exists(dest_dir):
if logger:
logger.info("Making directory: %s" % dest_dir)
logger.info(f"Making directory: {dest_dir}")
os.makedirs(dest_dir)
for file_name in files:
src = pjoin(parent, file_name)
Expand Down Expand Up @@ -202,7 +203,7 @@ def build_labextension(
ext_path = str(Path(path).resolve())

if logger:
logger.info("Building extension in %s" % path)
logger.info(f"Building extension in {path}")

builder = _ensure_builder(ext_path, core_path)

Expand All @@ -225,7 +226,7 @@ def watch_labextension(
ext_path = str(Path(path).resolve())

if logger:
logger.info("Building extension in %s" % path)
logger.info(f"Building extension in {path}")

# Check to see if we need to create a symlink
federated_extensions = get_federated_extensions(labextensions_path)
Expand Down Expand Up @@ -268,9 +269,8 @@ def _ensure_builder(ext_path, core_path):
dep_version2 = ext_data.get("devDependencies", {}).get("@jupyterlab/builder")
dep_version2 = dep_version2 or ext_data.get("dependencies", {}).get("@jupyterlab/builder")
if dep_version2 is None:
raise ValueError(
"Extensions require a devDependency on @jupyterlab/builder@%s" % dep_version1
)
msg = f"Extensions require a devDependency on @jupyterlab/builder@{dep_version1}"
raise ValueError(msg)

# if we have installed from disk (version is a path), assume we know what
# we are doing and do not check versions.
Expand Down Expand Up @@ -331,10 +331,10 @@ def _should_copy(src, dest, logger=None):
# we add a fudge factor to work around a bug in python 2.x
# that was fixed in python 3.x: https://bugs.python.org/issue12904
if logger:
logger.warning("Out of date: %s" % dest)
logger.warning(f"Out of date: {dest}")
return True
if logger:
logger.info("Up to date: %s" % dest)
logger.info(f"Up to date: {dest}")
return False


Expand Down
6 changes: 3 additions & 3 deletions jupyterlab/handlers/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</head>
<body>
<h1>JupyterLab Error<h1>
%s
{messages}
</body>
"""

Expand All @@ -29,5 +29,5 @@ def initialize(self, messages=None, name=None):
@web.authenticated
@web.removeslash
def get(self):
msgs = ["<h2>%s</h2>" % msg for msg in self.messages]
self.write(TEMPLATE % "\n".join(msgs))
msgs = [f"<h2>{msg}</h2>" for msg in self.messages]
self.write(TEMPLATE.format(messages="\n".join(msgs)))
26 changes: 12 additions & 14 deletions jupyterlab/labapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ def start(self):
core_config=self.core_config,
splice_source=self.splice_source,
)
self.log.info("JupyterLab %s", version)
self.log.info(f"JupyterLab {version}")
with self.debug_logging():
if self.pre_clean:
self.log.info("Cleaning %s" % app_dir)
self.log.info(f"Cleaning {app_dir}")
clean(app_options=app_options)
self.log.info("Building in %s", app_dir)
self.log.info(f"Building in {app_dir}")
try:
production = None if self.dev_build is None else not self.dev_build
build(
Expand All @@ -216,7 +216,7 @@ def start(self):
clean_flags = dict(base_flags)
clean_flags["extensions"] = (
{"LabCleanApp": {"extensions": True}},
"Also delete <app-dir>/extensions.\n%s" % ext_warn_msg,
f"Also delete <app-dir>/extensions.\n{ext_warn_msg}",
)
clean_flags["settings"] = (
{"LabCleanApp": {"settings": True}},
Expand All @@ -228,7 +228,7 @@ def start(self):
)
clean_flags["all"] = (
{"LabCleanApp": {"all": True}},
"Delete the entire contents of the app directory.\n%s" % ext_warn_msg,
f"Delete the entire contents of the app directory.\n{ext_warn_msg}",
)


Expand Down Expand Up @@ -257,9 +257,7 @@ class LabCleanApp(JupyterApp):

app_dir = Unicode("", config=True, help="The app directory to clean")

extensions = Bool(
False, config=True, help="Also delete <app-dir>/extensions.\n%s" % ext_warn_msg
)
extensions = Bool(False, config=True, help=f"Also delete <app-dir>/extensions.\n{ext_warn_msg}")

settings = Bool(False, config=True, help="Also delete <app-dir>/settings")

Expand All @@ -268,7 +266,7 @@ class LabCleanApp(JupyterApp):
all = Bool(
False,
config=True,
help="Delete the entire contents of the app directory.\n%s" % ext_warn_msg,
help=f"Delete the entire contents of the app directory.\n{ext_warn_msg}",
)

def start(self):
Expand Down Expand Up @@ -300,9 +298,9 @@ class LabPathApp(JupyterApp):
"""

def start(self):
print("Application directory: %s" % get_app_dir())
print("User Settings directory: %s" % get_user_settings_dir())
print("Workspaces directory: %s" % get_workspaces_dir())
print(f"Application directory: {get_app_dir()}")
print(f"User Settings directory: {get_user_settings_dir()}")
print(f"Workspaces directory: {get_workspaces_dir()}")


class LabWorkspaceExportApp(WorkspaceExportApp):
Expand Down Expand Up @@ -742,8 +740,8 @@ def initialize_handlers(self): # noqa
# Client-side code assumes notebookVersion is a JSON-encoded string
page_config["notebookVersion"] = json.dumps(jpserver_version_info)

self.log.info("JupyterLab extension loaded from %s" % HERE)
self.log.info("JupyterLab application directory is %s" % self.app_dir)
self.log.info(f"JupyterLab extension loaded from {HERE!s}")
self.log.info(f"JupyterLab application directory is {self.app_dir!s}")

if self.custom_css:
handlers.append(
Expand Down
4 changes: 2 additions & 2 deletions jupyterlab/labextensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def run_task(self):

def deprecation_warning(self, msg):
return self.log.warning(
"\033[33m(Deprecated) %s\n\n%s \033[0m", msg, LABEXTENSION_COMMAND_WARNING
f"\033[33m(Deprecated) {msg}\n\n{LABEXTENSION_COMMAND_WARNING} \033[0m"
)

def _log_format_default(self):
Expand Down Expand Up @@ -589,7 +589,7 @@ def start(self):
# The above should have called a subcommand and raised NoStart; if we
# get here, it didn't, so we should self.log.info a message.
subcmds = ", ".join(sorted(self.subcommands))
self.exit("Please supply at least one subcommand: %s" % subcmds)
self.exit(f"Please supply at least one subcommand: {subcmds}")


main = LabExtensionApp.launch_instance
Expand Down
7 changes: 4 additions & 3 deletions jupyterlab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ def __init__(self, alt_func=None, behavior="warn", removed_version=None):
def __call__(self, func):
alt_msg = ""
if self.alt_func is not None:
alt_msg = " Use ``%s`` instead." % self.alt_func
alt_msg = f" Use ``{self.alt_func}`` instead."
rmv_msg = ""
if self.removed_version is not None:
rmv_msg = " and will be removed in version %s" % self.removed_version
rmv_msg = f" and will be removed in version {self.removed_version}"

msg = "Function ``%s`` is deprecated" % func.__name__ + rmv_msg + "." + alt_msg
function_description = func.__name__ + rmv_msg + "." + alt_msg
msg = f"Function ``{function_description}`` is deprecated"

@functools.wraps(func)
def wrapped(*args, **kwargs):
Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Pypi = "https://pypi.org/project/jupyterlab"

[project.optional-dependencies]
docs = [
"sphinx>=1.8,<7.3.0",
"sphinx>=1.8,<7.4.0",
"sphinx-copybutton",
"pydata-sphinx-theme>=0.13.0",
"pytest",
Expand All @@ -91,10 +91,10 @@ docs-screenshots = [
"ipywidgets==8.1.2",
"jupyterlab-geojson==3.4.0",
"jupyterlab-language-pack-zh-CN==4.1.post2",
"matplotlib==3.8.3",
"matplotlib==3.8.4",
"nbconvert>=7.0.0",
"pandas==2.2.1",
"scipy==1.12.0",
"pandas==2.2.2",
"scipy==1.13.0",
"vega_datasets==0.9.0",
]
test = [
Expand All @@ -118,13 +118,13 @@ dev = [
"coverage",
"hatch",
"bump2version",
"ruff==0.3.5",
"ruff==0.4.2",
]
upgrade-extension = [
"pyyaml-include<2.0",
"pyyaml-include<3.0",
"copier>=8,<10",
"jinja2-time<0.3",
"pydantic<2.0",
"pydantic<3.0",
"tomli-w<2.0"
]

Expand Down Expand Up @@ -303,7 +303,7 @@ lint.ignore = [
# RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
"jupyterlab/tests/echo_kernel.py" = ["RUF012"]
# T201 `print` found
"scripts/milestone_check.py" = ["T201"]
"scripts/milestone_check.py" = ["T201", "UP031"]
# N806 Variable `tM` in function should be lowercase
# N816 Variable `comparatorTrimReplace` in global scope should not be mixedCase
# PLC1901 test can be simplified as an empty string is falsey
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ if [[ $GROUP == lint ]]; then

# Python checks
ruff format .
ruff .
ruff check .
pipx run 'validate-pyproject[all]' pyproject.toml
fi

Expand Down
12 changes: 5 additions & 7 deletions scripts/milestone_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
}


headers = {"Authorization": "token %s" % api_token}
headers = {"Authorization": f"token {api_token}"}
# construct a commit to PR dictionary
prs = {}
large_prs = []
Expand Down Expand Up @@ -170,9 +170,9 @@

prs[prnumber] = {"mergeCommit": pr["mergeCommit"]["oid"], "commits": pr_commits}
if total_commits > len(pr_commits):
oid = pr["mergeCommit"]["oid"]
print(
"WARNING: PR %d (merge %s) has %d commits, but GitHub is only giving us %d of them"
% (prnumber, pr["mergeCommit"]["oid"], total_commits, len(pr_commits))
f"WARNING: PR {prnumber} (merge {oid}) has {total_commits} commits, but GitHub is only giving us {len(pr_commits)} of them"
)


Expand All @@ -197,7 +197,7 @@

prs_not_represented = set(prs.keys()) - good

print("Milestone: %s, %d merged PRs, %d commits in history" % (MILESTONE, total_prs, len(commits)))
print(f"Milestone: {MILESTONE}, {total_prs} merged PRs, {len(commits)} commits in history")

print()
print("-" * 40)
Expand All @@ -211,9 +211,7 @@
"""
)
print(
"\n".join(
"https://github.com/jupyterlab/jupyterlab/pull/%d" % i for i in prs_not_represented
)
"\n".join(f"https://github.com/jupyterlab/jupyterlab/pull/{i}" for i in prs_not_represented)
)
else:
print(
Expand Down

0 comments on commit d86e3cd

Please sign in to comment.