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

[pull] main from pallets:main #144

Merged
merged 31 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
91b8406
adjust type hint for filename parameter in open_file to also take an …
May 20, 2024
74ab60a
adjust type hint for filename parameter in open_file to also take an …
aenglander May 20, 2024
920d0d7
Doc Update Resolving Issue #2206
j7an May 20, 2024
e88c112
Doc Update Resolving Issue #2206 (#2726)
aenglander May 20, 2024
3f91d21
Prevent multiline error message on invalid path
t-payne May 20, 2024
3da552b
Skip test on Windows
t-payne May 20, 2024
cd72d7e
Update test name
t-payne May 20, 2024
67cefe7
Match line space formatting
t-payne May 20, 2024
1991d4c
Don't use raw string when creating file
t-payne May 21, 2024
38c0579
Bring back skip for Windows due to invalid syntax
t-payne May 21, 2024
c021f05
Prevent multiline error message on invalid path (#2728)
davidism May 21, 2024
61f8101
Fix printing of default option value to handle empty strings
stefmolin May 20, 2024
d3e3852
Fix printing of default option value to handle empty strings (#2724)
davidism May 21, 2024
d83868a
test runner handles color on windows
Tyl13 May 21, 2024
5b1624b
fix color handling in test runner (#2729)
davidism May 21, 2024
bf1e8be
show correct value for flag default when using default_map
ChrisPappalardo May 21, 2024
bc16dbf
fix bug in show defaults when using a flag option and a default map (…
davidism May 22, 2024
619f947
add missing backticks in `format_filename` docs
naglis Apr 8, 2024
396c1b9
add missing backticks in `format_filename` docs (#2704)
davidism May 22, 2024
e660d44
Fix broken code example in docs under Advanced Patterns
pbhuss Apr 17, 2024
52072a9
Fix broken code example in docs under Advanced Patterns (#2708)
davidism May 22, 2024
a2ce394
Fix extlinks in conf.py
chestnutprog Apr 26, 2024
ac56c45
Fix extlinks in docs/conf.py (#2714)
davidism May 22, 2024
16b8672
add gha-update
davidism Aug 23, 2024
619f4cc
remove dependabot
davidism Aug 23, 2024
3ec3ac5
update dev dependencies
davidism Aug 23, 2024
ab91b5a
apply ruff fixes
davidism Aug 23, 2024
f24a9fb
fixup! add gha-update
davidism Aug 24, 2024
4d7ce02
fix mypy findings
davidism Aug 24, 2024
aca1a0c
remove pre-commit.ci update
davidism Aug 24, 2024
99015e1
Merge branch '8.1.x'
davidism Aug 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading