sagemath/sage

Make jupyter_packaging standard; add hatchling, editables, pathspec, poetry_core, tomlkit, deprecation; update tomli, flit_core, setuptools, pip, wheel

mkoeppe opened this issue · 40 comments

In preparation for an upgrade of jupyter_jsmol and jupyter component packages (#33530), we make the jupyter_packaging package standard. As the latest version of jupyter_packaging now uses hatchling as its build backend, we add it and its dependencies as standard packages and upgrade related packages.

There should be no user-visible change.

CC: @egourgoulhon @dimpase @jhpalmieri @kiwifb @antonio-rojas @tornaria

Component: packages: standard

Author: Matthias Koeppe

Branch: 6607401

Reviewer: Dima Pasechnik, François Bissey, John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/33866

Author: Matthias Koeppe

New commits:

ce9a905build/pkgs/jupyter_jsmol: Update to 2022.1.0
cea777cbuild/pkgs/jupyter_packaging: Make it a normal standard package

Commit: cea777c

Description changed:

--- 
+++ 
@@ -1,2 +1,3 @@
-`jupyter_packaging` is a new dependency, so it needs to become standard
+`jupyter_packaging` is a new dependency of `jupyter_jsmol`, so it needs to become standard
 
+`jupyter_packaging` now uses `hatchling` as its build backend, so we add it and its dependencies as standard packages and upgrade related packages.

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f8c42c7build/pkgs/jupyter_jsmol: Update to 2022.1.0
a843a53build/pkgs/jupyter_packaging: Make it a normal standard package
fbddf49build/pkgs/hatchling: New standard package, build dep of jupyter_client, jsonschema
a3dcb2fbuild/pkgs/editables: New standard package, build dep of hatchling
04b430ebuild/pkgs/tomli: Update to 2.0.1
6d149c9build/pkgs/hatchling/dependencies: Add tomli, editables
6b8c0bebuild/pkgs/flit_core: Update to 3.7.1
bfa7d35build/pkgs/jupyter_packaging: Update to 0.12.2

Changed commit from cea777c to bfa7d35

Description changed:

--- 
+++ 
@@ -1,3 +1,2 @@
-`jupyter_packaging` is a new dependency of `jupyter_jsmol`, so it needs to become standard
+In preparation for an upgrade of `jupyter_jsmol`, we make the `jupyter_packaging` package standard. As the latest version of `jupyter_packaging` now uses `hatchling` as its build backend, we add it and its dependencies as standard packages and upgrade related packages.
 
-`jupyter_packaging` now uses `hatchling` as its build backend, so we add it and its dependencies as standard packages and upgrade related packages.

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1a63ff6build/pkgs/jupyter_packaging: Make it a normal standard package
a675336build/pkgs/hatchling: New standard package, build dep of jupyter_client, jsonschema
f12287abuild/pkgs/editables: New standard package, build dep of hatchling
f715db8build/pkgs/tomli: Update to 2.0.1
10f216bbuild/pkgs/hatchling/dependencies: Add tomli, editables
4738f8cbuild/pkgs/flit_core: Update to 3.7.1
b82667fbuild/pkgs/jupyter_packaging: Update to 0.12.2

Changed commit from bfa7d35 to b82667f

Description changed:

--- 
+++ 
@@ -1,2 +1,3 @@
 In preparation for an upgrade of `jupyter_jsmol`, we make the `jupyter_packaging` package standard. As the latest version of `jupyter_packaging` now uses `hatchling` as its build backend, we add it and its dependencies as standard packages and upgrade related packages.
 
+There should be user-visible change.
comment:8

Deferred the actual update of jupyter_jsmol to a follow-up ticket.

Branch pushed to git repo; I updated commit sha1. New commits:

95e1955build/pkgs/jupyter_packaging/dependencies: Add hatchling
708d846build/pkgs/pathspec: New

Changed commit from b82667f to 708d846

Description changed:

--- 
+++ 
@@ -1,3 +1,3 @@
 In preparation for an upgrade of `jupyter_jsmol`, we make the `jupyter_packaging` package standard. As the latest version of `jupyter_packaging` now uses `hatchling` as its build backend, we add it and its dependencies as standard packages and upgrade related packages.
 
-There should be user-visible change.
+There should be no user-visible change.

Branch pushed to git repo; I updated commit sha1. New commits:

416603fbuild/pkgs/deprecation: New (jupyter_packaging dep)
f5076babuild/pkgs/tomlkit: New (jupyter_packaging dep)
255126abuild/pkgs/setuptools: Update to 62.6.0
5f29fb6build/pkgs/poetry_core: New (tomlkit build dep)
0804b62build/pkgs/poetry_core/patches/5547.diff_bin: New
0c4d0ebbuild/pkgs/hatchling/dependencies: Add pluggy, packaging
3e54474build/pkgs/pip: Update to 22.1.2
7e9722fbuild/pkgs/setuptools_scm: Update to 7.0.2, add typing_extensions as dep
6f72e8cbuild/pkgs/wheel: Update to 0.37.1

Changed commit from 708d846 to 6f72e8c

Description changed:

--- 
+++ 
@@ -1,3 +1,3 @@
-In preparation for an upgrade of `jupyter_jsmol`, we make the `jupyter_packaging` package standard. As the latest version of `jupyter_packaging` now uses `hatchling` as its build backend, we add it and its dependencies as standard packages and upgrade related packages.
+In preparation for an upgrade of `jupyter_jsmol` and jupyter component packages (#33530), we make the `jupyter_packaging` package standard. As the latest version of `jupyter_packaging` now uses `hatchling` as its build backend, we add it and its dependencies as standard packages and upgrade related packages.
 
 There should be no user-visible change.

Changed commit from 6f72e8c to 3e9d4a8

Branch pushed to git repo; I updated commit sha1. New commits:

3e9d4a8Revert "build/pkgs/setuptools_scm: Update to 7.0.2, add typing_extensions as dep"
comment:20

The setuptools_scm upgrade made matplotlib think that it is version 0.0

comment:22

lgtm

Reviewer: Dima Pasechnik

comment:23

Nitpick, you did not list a license for hatchling

diff --git a/build/pkgs/hatchling/SPKG.rst b/build/pkgs/hatchling/SPKG.rst
new file mode 100644
index 00000000..23d86bd
--- /dev/null
+++ b/build/pkgs/hatchling/SPKG.rst
@@ -0,0 +1,16 @@
+hatchling: Modern, extensible Python build backend
+==================================================
+
+Description
+-----------
+
+Modern, extensible Python build backend
+
+License
+-------
+
+Upstream Contact
+----------------
+
+https://pypi.org/project/hatchling/
+

It is MIT.

Changed commit from 3e9d4a8 to 5d8111f

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

5d8111fbuild/pkgs/hatchling/SPKG.rst: Add license info
comment:25

Thanks!

Changed reviewer from Dima Pasechnik to Dima Pasechnik, François Bissey

comment:26

Doctest failures, I think because of the pip upgrade:

sage -t --random-seed=40701510628761718232931312764279214628 src/sage/misc/package.py
**********************************************************************
File "src/sage/misc/package.py", line 146, in sage.misc.package.pip_installed_packages
Failed example:
    'scipy' in d  # optional - sage_spkg
Expected:
    True
Got:
    False
**********************************************************************
File "src/sage/misc/package.py", line 148, in sage.misc.package.pip_installed_packages
Failed example:
    d['scipy']  # optional - sage_spkg
Exception raised:
    Traceback (most recent call last):
      File "/Users/palmieri/Desktop/Sage/sage_builds/TESTING/sage-9.7.beta3/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 695, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Desktop/Sage/sage_builds/TESTING/sage-9.7.beta3/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 1093, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.package.pip_installed_packages[3]>", line 1, in <module>
        d['scipy']  # optional - sage_spkg
    KeyError: 'scipy'
comment:27

The issue is that the dictionary pip_installed_packages() now has a key "SciPy" rather than "scipy". I suggested several possible fixes at #33530 comment:68 and #33530 comment:69.

Branch pushed to git repo; I updated commit sha1. New commits:

6607401src/sage/misc/package.py (pip_installed_packages): Make doctests more flexible

Changed commit from 5d8111f to 6607401

comment:29

Thanks for catching this and your suggestions. I have made similar changes to the doctests. The doctests now accept both formats. I think it's not necessary to track down which of the updated packages is responsible for this change. I wouldn't want to have to tighten version bounds in install-requires.txt for this package just for this doctest.

comment:31

Looks good, thank you.

Changed reviewer from Dima Pasechnik, François Bissey to Dima Pasechnik, François Bissey, John Palmieri

comment:32

Thanks!

Changed commit from 6607401 to none

comment:34

as it turns out, jupyter_jsmol installation process fetches more js stuff than there is in the tarball:

jjupyter_jsmol-2022.1.0] Building wheels for collected packages: jupyter-jsmol
[jupyter_jsmol-2022.1.0]   WARNING: Ignoring --build-option when building jupyter-jsmol using PEP 517
[jupyter_jsmol-2022.1.0]   Building wheel for jupyter-jsmol (pyproject.toml): started
[jupyter_jsmol-2022.1.0]   Running command Building wheel for jupyter-jsmol (pyproject.toml)
[jupyter_jsmol-2022.1.0]   setup.py entered
[jupyter_jsmol-2022.1.0]   $PATH=/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/local/var/lib/sage/venv-python3.10/bin:/mnt/opt/Sage/sage-dev/local/bin:/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/local/bin:/mnt/opt/Sage/sage-dev/local/var/lib/sage/venv-python3.10/bin:/mnt/opt/Sage/sage-dev/build/bin:/mnt/opt/Sage/sage-dev/src/bin:/mnt/opt/Sage/sage-dev/local/bin:/home/dima/.elan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin:/home/dima/.local/bin:/home/dima/.local/bin
[jupyter_jsmol-2022.1.0]   <string>:47: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
[jupyter_jsmol-2022.1.0]   Use `wrap_installers` to handle prebuild steps in cmdclass.
[jupyter_jsmol-2022.1.0]   Use `get_data_files` to handle data files.
[jupyter_jsmol-2022.1.0]   Use `include_package_data=True` and `MANIFEST.in` for package data.
[jupyter_jsmol-2022.1.0] 
[jupyter_jsmol-2022.1.0]   <string>:49: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
[jupyter_jsmol-2022.1.0]   running bdist_wheel
[jupyter_jsmol-2022.1.0]   running jsdeps
[jupyter_jsmol-2022.1.0]   Installing build dependencies with npm.  This may take a while...
[jupyter_jsmol-2022.1.0]   > yarn install
[jupyter_jsmol-2022.1.0]   yarn install v1.22.19
[jupyter_jsmol-2022.1.0]   warning package.json: No license field
[jupyter_jsmol-2022.1.0]   warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[jupyter_jsmol-2022.1.0]   warning jupyter-jsmol@2022.1.0: No license field
[jupyter_jsmol-2022.1.0]   [1/4] Resolving packages...
[jupyter_jsmol-2022.1.0]   [2/4] Fetching packages...
[jupyter_jsmol-2022.1.0]   info There appears to be trouble with your network connection. Retrying...
...

aand it hangs - even tough the network is OK :-(

comment:35

follow-up on #34421