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

Switch sage-conf to modern editable install #36751

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Nov 22, 2023

This modernization eliminates some deprecation warnings during installation. It may help solve the problem of the disappearing sage-conf (https://groups.google.com/g/sage-release/c/J6mGYH56FKA/m/m9yHivCWAgAJ, https://groups.google.com/g/sage-release/c/dvPti2UkyjQ/m/2jeUZROzAwAJ, https://groups.google.com/g/sage-release/c/DeqhtAgi2es/m/DYq13owvAQAJ).

No change to how sagelib is installed; this will be taken care of separately (#34209).

In combination with #36562, which adds pyproject.toml for sage-docbuild, sage-setup, sage-sws2rst, also these distributions are switched to the modern editable install.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Nov 22, 2023
@mkoeppe mkoeppe requested a review from jhpalmieri November 27, 2023 00:28
@jhpalmieri
Copy link
Member

If I understand correctly, this turns off SETUPTOOLS_ENABLE_FEATURES=legacy-editable for everything except sagelib. Is that right?

Where might I see differences in deprecation warnings? I see a lot both with and without this.

I wish that I knew how to trigger the "missing sage-conf" problem. I've certainly seen it, but I don't know how to trigger it, so I can't tell if this change has any effect.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 29, 2023

this turns off SETUPTOOLS_ENABLE_FEATURES=legacy-editable for everything except sagelib. Is that right?

That's right.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 29, 2023

I wish that I knew how to trigger the "missing sage-conf" problem. I've certainly seen it, but I don't know how to trigger it, so I can't tell if this change has any effect.

Same here...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 29, 2023

Where might I see differences in deprecation warnings? I see a lot both with and without this.

Without this PR, sage_conf-...log looks like this:

Installing sage_conf-10.2.rc4 (editable mode)
Using pip 23.3.1 from /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/pip (python 3.9)
Obtaining file:///Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/pkgs/sage-conf
  Checking if build backend supports build_editable: started
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info
  writing /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/dependency_links.txt
  writing entry points to /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/entry_points.txt
  writing top-level names to /private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/top_level.txt
  writing manifest file '/private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file '/private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf.egg-info/SOURCES.txt'
  creating '/private/var/folders/38/wnh4gf1552g_crsjnv2vmmww0000gp/T/pip-modern-metadata-2fshuail/sage_conf-10.2rc4.dist-info'
  Preparing metadata (pyproject.toml): finished with status 'done'
Installing collected packages: sage-conf
  Running setup.py develop for sage-conf
    Running command python setup.py develop
    running develop
    /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.

            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************

    !!
      easy_install.initialize_options(self)
    /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.

            See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
            ********************************************************************************

    !!
      self.initialize_options()
    running egg_info
    writing sage_conf.egg-info/PKG-INFO
    writing dependency_links to sage_conf.egg-info/dependency_links.txt
    writing entry points to sage_conf.egg-info/entry_points.txt
    writing top-level names to sage_conf.egg-info/top_level.txt
    reading manifest template 'MANIFEST.in'
    writing manifest file 'sage_conf.egg-info/SOURCES.txt'
    running build_ext
    Creating /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/lib/python3.9/site-packages/sage-conf.egg-link (link to .)
    Adding sage-conf 10.2rc4 to easy-install.pth file
    Installing sage-config script to /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/bin
    Installing sage-env-config script to /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/local/var/lib/sage/venv-python3.9/bin

    Installed /Users/mkoeppe/s/sage/sage-rebasing/worktree-clean/pkgs/sage-conf
Successfully installed sage-conf-10.2rc4

The "Please avoid running setup.py and easy_install." should disappear with this PR.

@jhpalmieri
Copy link
Member

Okay, looks good to me. Everything else builds without much change, and I see those few deprecations have gone away.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 29, 2023

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 10, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->
This modernization eliminates some deprecation warnings during
installation. It may help solve the problem of the disappearing sage-
conf (https://groups.google.com/g/sage-
release/c/J6mGYH56FKA/m/m9yHivCWAgAJ, https://groups.google.com/g/sage-
release/c/dvPti2UkyjQ/m/2jeUZROzAwAJ, https://groups.google.com/g/sage-
release/c/DeqhtAgi2es/m/DYq13owvAQAJ).

No change to how sagelib is installed; this will be taken care of
separately (sagemath#34209).

In combination with sagemath#36562, which adds `pyproject.toml` for sage-
docbuild, sage-setup, sage-sws2rst, also these distributions are
switched to the modern editable install.

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36751
Reported by: Matthias Köppe
Reviewer(s): John H. Palmieri
@vbraun
Copy link
Member

vbraun commented Dec 11, 2023

merge conflict

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 14, 2023

rebased

Copy link

Documentation preview for this PR (built with commit 560ab28; changes) is ready! 🎉

@vbraun
Copy link
Member

vbraun commented Dec 16, 2023

[editables-0.5] pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
[editables-0.5]   File "/home/release/Sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
[editables-0.5]     obj = import_module(mod_path)
[editables-0.5]           ^^^^^^^^^^^^^^^^^^^^^^^
[editables-0.5]   File "/home/release/Sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/importlib/__init__.py", line 126, in import_module
[editables-0.5]     return _bootstrap._gcd_import(name[level:], package, level)
[editables-0.5]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked
[editables-0.5]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
[editables-0.5]   File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
[editables-0.5] ModuleNotFoundError: No module named 'flit_core'
[editables-0.5] 
[editables-0.5] ****************************************************************************************************************************
[editables-0.5] Error building a wheel for editables-0.5
[editables-0.5] ****************************************************************************************************************************
[editables-0.5] 
[editables-0.5] real	0m0.909s
[editables-0.5] user	0m0.742s
[editables-0.5] sys	0m0.171s
[editables-0.5] ************************************************************************
[editables-0.5] Error installing package editables-0.5
[editables-0.5] ************************************************************************

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 16, 2023

no, this is unrelated.
the dependency is already missing in the last beta.
fixed in #36885

@vbraun vbraun merged commit 1838bdf into sagemath:develop Dec 19, 2023
32 of 36 checks passed
@mkoeppe mkoeppe added this to the sage-10.3 milestone Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants