Skip to content

Commit

Permalink
Merge branch '8.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Aug 24, 2024
2 parents e16088a + aca1a0c commit 99015e1
Show file tree
Hide file tree
Showing 24 changed files with 247 additions and 185 deletions.
18 changes: 0 additions & 18 deletions .github/dependabot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: generate hash
id: hash
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
path: ./dist
provenance:
Expand Down
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.2
hooks:
- id: ruff
- id: ruff-format
Expand Down
16 changes: 16 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ Unreleased
:issue:`2322`


Version 8.1.8
-------------

Unreleased

- Fix an issue with type hints for ``click.open_file()``. :issue:`2717`
- Fix issue where error message for invalid ``click.Path`` displays on
multiple lines. :issue:`2697`
- Fixed issue that prevented a default value of ``""`` from being displayed in
the help for an option. :issue:`2500`
- The test runner handles stripping color consistently on Windows.
:issue:`2705`
- Show correct value for flag default when using ``default_map``.
:issue:`2632`


Version 8.1.7
-------------

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Start coding
.. code-block:: text
$ git fetch origin
$ git checkout -b your-branch-name origin/8.0.x
$ git checkout -b your-branch-name origin/8.1.x
If you're submitting a feature addition or change, branch off of the
"main" branch.
Expand Down
1 change: 1 addition & 0 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ defined as a context manager:
def __enter__(self):
path = os.path.join(self.home, "repo.db")
self.db = open_database(path)
return self
def __exit__(self, exc_type, exc_value, tb):
self.db.close()
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
autodoc_typehints = "description"
autodoc_preserve_defaults = True
extlinks = {
"issue": ("https://github.com/pallets/flask/issues/%s", "#%s"),
"pr": ("https://github.com/pallets/flask/pull/%s", "#%s"),
"issue": ("https://github.com/pallets/click/issues/%s", "#%s"),
"pr": ("https://github.com/pallets/click/pull/%s", "#%s"),
}
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
Expand Down
24 changes: 14 additions & 10 deletions docs/shell-completion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ through an entry point, not through the ``python`` command. See
:doc:`entry-points`. Once the executable is installed, calling it with
a special environment variable will put Click in completion mode.

In order for completion to be used, the user needs to register a special
function with their shell. The script is different for every shell, and
Click will output it when called with ``_{PROG_NAME}_COMPLETE`` set to
``{shell}_source``. ``{PROG_NAME}`` is the executable name in uppercase
with dashes replaced by underscores. The built-in shells are ``bash``,
``zsh``, and ``fish``.
To enable shell completion, the user needs to register a special
function with their shell. The exact script varies depending on the
shell you are using. Click will output it when called with
``_{FOO_BAR}_COMPLETE`` set to ``{shell}_source``. ``{FOO_BAR}`` is
the executable name in uppercase with dashes replaced by underscores.
It is conventional but not strictly required for environment variable
names to be in upper case. This convention helps distinguish environment
variables from regular shell variables and commands, making scripts
and configuration files more readable and easier to maintain. The
built-in shells are ``bash``, ``zsh``, and ``fish``.

Provide your users with the following instructions customized to your
program name. This uses ``foo-bar`` as an example.
Expand Down Expand Up @@ -194,7 +198,7 @@ require implementing some smaller parts.

First, you'll need to figure out how your shell's completion system
works and write a script to integrate it with Click. It must invoke your
program with the environment variable ``_{PROG_NAME}_COMPLETE`` set to
program with the environment variable ``_{FOO_BAR}_COMPLETE`` set to
``{shell}_complete`` and pass the complete args and incomplete value.
How it passes those values, and the format of the completion response
from Click is up to you.
Expand All @@ -207,7 +211,7 @@ formatting with the following variables:
in the script.
- ``complete_var`` - The environment variable name for passing the
``{shell}_complete`` instruction.
- ``prog_name`` - The name of the executable being completed.
- ``foo_bar`` - The name of the executable being completed.

The example code is for a made up shell "My Shell" or "mysh" for short.

Expand All @@ -218,10 +222,10 @@ The example code is for a made up shell "My Shell" or "mysh" for short.
_mysh_source = """\
%(complete_func)s {
response=$(%(complete_var)s=mysh_complete %(prog_name)s)
response=$(%(complete_var)s=mysh_complete %(foo_bar)s)
# parse response and set completions somehow
}
call-on-complete %(prog_name)s %(complete_func)s
call-on-complete %(foo_bar)s %(complete_func)s
"""
@add_completion_class
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ select = [
"UP", # pyupgrade
"W", # pycodestyle warning
]
ignore-init-module-imports = true

[tool.ruff.lint.isort]
force-single-line = true
order-by-type = false

[tool.gha-update]
tag-only = [
"slsa-framework/slsa-github-generator",
]
4 changes: 2 additions & 2 deletions requirements/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
build==1.2.1
# via -r build.in
packaging==24.0
packaging==24.1
# via build
pyproject-hooks==1.0.0
pyproject-hooks==1.1.0
# via build
Loading

0 comments on commit 99015e1

Please sign in to comment.