Skip to content

Commit

Permalink
Clarify docs for --no-build-isolation
Browse files Browse the repository at this point in the history
Stop assuming that setuptools/wheel will always be preinstalled and
don't need to be explicitly listed as build requirements; this is not
the case in Python 3.12.

Stop using ArgumentDefaultsHelpFormatter, it makes the help message for
--no-build-isolation extra confusing.

Clarify that 'patterns' in --ignore et al. mean glob patterns rather
than regexes or something.

Use an exact version instead of `... # pick a valid tag / revision` in
the README, I trust my `make check-readme` (part of `make release`) to
remind me to update it.

See #168.
  • Loading branch information
mgedmin committed Dec 18, 2023
1 parent c9531f6 commit 5ab939f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 31 deletions.
3 changes: 1 addition & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ Changelog
- Add ``--no-build-isolation`` option so check-manifest can succeed building
pep517-based distributions without an internet connection. With
``--no-build-isolation``, you must preinstall the ``build-system.requires``
beforehand. (
`#128 <https://github.com/mgedmin/check-manifest/pull/128>`__).
beforehand. (`#128 <https://github.com/mgedmin/check-manifest/pull/128>`__).


0.44 (2020-10-03)
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ git-workflow. Add the following to your ``.pre-commit-config.yaml``.
If you are running pre-commit without a network, you can utilize
``args: [--no-build-isolation]`` to prevent a ``pip install`` reaching out to
PyPI. If you have additional ``build-system.requires`` outside of pip /
setuptools / wheel you will want to list those in ``additional_dependencies``.
PyPI. This makes ``python -m build`` ignore your ``build-system.requires``,
so you'll want to list them all in ``additional_dependencies``.

.. code-block:: yaml
repos:
- repo: https://github.com/mgedmin/check-manifest
rev: ... # pick a valid tag / revision
rev: "0.49"
hooks:
- id: check-manifest
args: [--no-build-isolation]
additional_dependencies: [setuptools-scm]
additional_dependencies: [setuptools, wheel, setuptools-scm]
.. |buildstatus| image:: https://github.com/mgedmin/check-manifest/workflows/build/badge.svg?branch=master
Expand Down
67 changes: 42 additions & 25 deletions check_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,34 +1038,51 @@ def check_manifest(source_tree='.', create=False, update=False,

def main():
parser = argparse.ArgumentParser(
description="Check a Python MANIFEST.in file for completeness",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('source_tree', default='.', nargs='?',
help='location for the source tree')
parser.add_argument('--version', action='version',
version='%(prog)s version ' + __version__)
parser.add_argument('-q', '--quiet', action='store_const', dest='quiet',
const=0, default=1, help='reduced output verbosity')
parser.add_argument('-v', '--verbose', action='store_const', dest='verbose',
const=1, default=0, help='more verbose output')
parser.add_argument('-c', '--create', action='store_true',
help='create a MANIFEST.in if missing')
parser.add_argument('-u', '--update', action='store_true',
description="Check a Python MANIFEST.in file for completeness")
parser.add_argument(
'source_tree', default='.', nargs='?',
help='location for the source tree (default: .)')
parser.add_argument(
'--version', action='version',
version='%(prog)s version ' + __version__)
parser.add_argument(
'-q', '--quiet', action='store_const', dest='quiet',
const=0, default=1, help='reduced output verbosity')
parser.add_argument(
'-v', '--verbose', action='store_const', dest='verbose',
const=1, default=0, help='more verbose output')
parser.add_argument(
'-c', '--create', action='store_true',
help='create a MANIFEST.in if missing (default: exit with an error)')
parser.add_argument(
'-u', '--update', action='store_true',
help='append suggestions to MANIFEST.in (implies --create)')
parser.add_argument('-p', '--python', default=sys.executable,
help='use this Python interpreter for running setup.py sdist')
parser.add_argument('--ignore', metavar='patterns', default=None,
help='ignore files/directories matching these'
' comma-separated patterns')
parser.add_argument('--ignore-bad-ideas', metavar='patterns',
default=[], help='ignore bad idea files/directories '
'matching these comma-separated patterns')
parser.add_argument(
'-p', '--python', default=sys.executable,
help=(
'use this Python interpreter for running setup.py sdist'
' (default: %(default)s)'
))
parser.add_argument(
'--ignore', metavar='patterns', default=None,
help=(
'ignore files/directories matching these comma-separated'
' glob patterns'
))
parser.add_argument(
'--ignore-bad-ideas', metavar='patterns', default=[],
help=(
'ignore bad idea files/directories matching these'
' comma-separated glob patterns'
))
parser.add_argument(
'--no-build-isolation', dest='build_isolation', action='store_false',
help='Disable isolation when building a modern source distribution. '
'Build dependencies specified by PEP 518 must be already installed if '
'this option is used.',
)
help=(
'disable isolation when building a modern source distribution'
' (default: use build isolation).'
' Build dependencies specified by pyproject.toml must be already'
' installed if this option is used.'
))
args = parser.parse_args()

ignore = IgnoreList()
Expand Down

0 comments on commit 5ab939f

Please sign in to comment.