-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hooks: exclude docutils from distutils.command.check
Add hooks for `distutils.command.check` from stdlib and `setuptools` (`setuptools._distutils.command.check`) that exclude conditionally-imported `docutils`. The latter is quite heavy-weight, as it triggers collection of various modules from `pygments` and `PIL`; so try avoiding its collection if not necessary. See: https://github.com/python/cpython/blob/v3.8.0/Lib/distutils/command/check.py#L8-L34 https://github.com/pypa/setuptools/blob/v68.2.2/setuptools/_distutils/command/check.py#L10-L36
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#----------------------------------------------------------------------------- | ||
# Copyright (c) 2023, PyInstaller Development Team. | ||
# | ||
# Distributed under the terms of the GNU General Public License (version 2 | ||
# or later) with exception for distributing the bootloader. | ||
# | ||
# The full license is in the file COPYING.txt, distributed with this software. | ||
# | ||
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) | ||
#----------------------------------------------------------------------------- | ||
|
||
# Conditionally imported in this module; should not trigger collection. | ||
excludedimports = ['docutils'] |
13 changes: 13 additions & 0 deletions
13
PyInstaller/hooks/hook-setuptools._distutils.command.check.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#----------------------------------------------------------------------------- | ||
# Copyright (c) 2023, PyInstaller Development Team. | ||
# | ||
# Distributed under the terms of the GNU General Public License (version 2 | ||
# or later) with exception for distributing the bootloader. | ||
# | ||
# The full license is in the file COPYING.txt, distributed with this software. | ||
# | ||
# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception) | ||
#----------------------------------------------------------------------------- | ||
|
||
# Conditionally imported in this module; should not trigger collection. | ||
excludedimports = ['docutils'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Add hooks for ``distutils.command.check`` and | ||
``setuptools._distutils.command.check`` that prevent unnecessary | ||
collection of ``docutils`` (which in turn triggers collection of | ||
``pygments``, ``PIL``, etc.). |