Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Deprecated setuptools features are used #1653

Closed
@EliahKagan

Description

@EliahKagan

This project currently uses deprecated features ofsetuptools, some of which may be removed in the future.

  • Installing by runningsetup.py directly, as the instructions inREADME.md say to do and as is done intest_installation, is deprecated. Actual breakage due to this begins in Python 3.12, where althoughsetuptools is still supported as a build backend and nontrivial logic can still be used insetup.py, global and virtual environments do not automatically have thesetuptools package. (See theensurepip item in thelist of removals in 3.12.) This is the cause ofPython 3.12: ModuleNotFoundError: No module named 'setuptools' #1640. But the deprecation is not new as of Python 3.12. The following message appears during installation (with any Python version provided the installedsetuptools version is not very old, but I used Python 3.11.5):

    /home/ek/repos-wsl/GitPython/.venv/lib/python3.11/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.        ********************************************************************************!!

    This could be worked around without a fix by addingsetuptools as a development dependency, but an actual fix is straightforward, and there are some further benefits to usingpip install . to install locally, including that-e can easily be passed to make the installation editable.

  • Building by runningsetup.py directly is, if I understand correctly, also deprecated. This is a less serious problem, but a true fix for this is also straightforward: thebuild module can be added as a development dependency and used for building the sdist and wheel inMakefile. Thesetuptools documentationrecommends usingbuild.

  • Thetests_require keyword argument is deprecated and intended for removal in a future version ofsetuptools, as noted in thesetuptools.setup keyword arguments documentation.

    This is already not achieving what appears intended or least hoped for (seeReadme claims test dependencies are installed automatically #1652), and one reasonable way to fix this is to remove that argument altogether. But both the reliance on a deprecated feature and the absence of an automated way to install test dependencies as a group (withoutpip install -r commands) could be remedied by using atestextra rather thantests_require.

Although I worry a bit about broad scope, it seems to me that it is natural to fix#1640,#1651,#1652, and this issue (which itself overlaps with#1640 and#1652, though is not limited to them) in a single pull request. I say this because there is significant overlap in the changes, and because decisions made in review should probably take the considerations of all these issues into account. I've opened#1654 for this.

Note that while it is today discouraged to implement nontrivial logic insetup.py, and recommended to usepyproject.toml and/orsetup.cfg for what has traditionally been done insetup.py,I do not believe it is deprecated to make nontrivial use ofsetup.py as this project does. Although it would be beneficial to define build and installation rules declaratively, I think that would be a much bigger change than needed to fix this issue. I have not attempted to do anything like that at this time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp