Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
clapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
software
clapper
Commits
b9943d10
Verified
Commit
b9943d10
authored
1 year ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
fix: fixing typos and formatting issues.
parent
6f5b20fa
No related branches found
No related tags found
1 merge request
!18
Draft: feat: add a list of available entry-points in the CLI help
Pipeline
#75377
failed
1 year ago
Stage: qa
Stage: test
Stage: doc
Stage: dist
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/clapper/click.py
+13
-12
13 additions, 12 deletions
src/clapper/click.py
src/clapper/config.py
+3
-3
3 additions, 3 deletions
src/clapper/config.py
with
16 additions
and
15 deletions
src/clapper/click.py
+
13
−
12
View file @
b9943d10
...
...
@@ -71,7 +71,7 @@ def verbosity_option(
name: Long name of the option. If not set, then use ``verbose`` --
this will also become the name of the contextual parameter for click.
d
l
ft: The default verbosity level to use (defaults to 0).
df
l
t: The default verbosity level to use (defaults to 0).
**kwargs: Further keyword-arguments to be forwarded to the underlying
:py:func:`click.option`
...
...
@@ -106,12 +106,13 @@ def verbosity_option(
type
=
click
.
IntRange
(
min
=
0
,
max
=
3
,
clamp
=
True
),
default
=
dflt
,
show_default
=
True
,
help
=
(
f
"
Increase the verbosity level from 0 (only error and
"
f
"
critical) messages will be displayed, to 1 (like 0, but adds
"
f
"
warnings), 2 (like 1, but adds info messags), and 3 (like 2,
"
f
"
but also adds debugging messages) by adding the --
{
name
}
"
f
"
option as often as desired (e.g.
'
-vvv
'
for debug).
"
help
=
dedent
(
f
"""
Increase the verbosity level from 0 (only error and
critical) messages will be displayed, to 1 (like 0, but adds
warnings), 2 (like 1, but adds info messages), and 3 (like 2,
but also adds debugging messages) by adding the --
{
name
}
option
as often as desired (e.g.
'
-vvv
'
for debug).
"""
),
callback
=
callback
,
**
kwargs
,
...
...
@@ -323,12 +324,12 @@ class ResourceOption(click.Option):
1. Using this class (without using :py:class:`ConfigCommand`) AND
(providing ``entry_point_group``).
2. Using this class (with :py:class:`ConfigCommand`) AND (providing
`entry_point_group`).
`
`entry_point_group`
`
).
3. Using this class (with :py:class:`ConfigCommand`) AND (without providing
`entry_point_group`).
`
`entry_point_group`
`
).
Using this class without :py:class:`ConfigCommand` and without providing
`entry_point_group` does nothing and is not allowed.
`
`entry_point_group`
`
does nothing and is not allowed.
Attributes:
...
...
@@ -424,7 +425,7 @@ class ResourceOption(click.Option):
)
->
tuple
[
typing
.
Any
,
ParameterSource
]:
"""
Retrieves value for parameter from appropriate context.
This method will retrive the value of its own parameter from the
This method will retri
e
ve the value of its own parameter from the
appropriate context, by trying various sources.
...
...
@@ -698,7 +699,7 @@ def config_group(
configurations.
This decorator adds a whole command group to a user predefined function
which is part of the user
'
s CLI. The command group provdes an interface to
which is part of the user
'
s CLI. The command group prov
i
des an interface to
list, fully describe or locally copy configuration files distributed with
the package. Commands accept both entry-point or module names to be
provided as input.
...
...
This diff is collapsed.
Click to expand it.
src/clapper/config.py
+
3
−
3
View file @
b9943d10
...
...
@@ -131,7 +131,7 @@ def _resolve_entry_point_or_modules(
entry-point names and module names to a set of file system paths.
Examples of things that can be resolved by this function are:
``[
"
/tmp/config.py
"
,
"
my-config
"
,
"
expose.config
"
]`` (an actual
y
filesystem
``[
"
/tmp/config.py
"
,
"
my-config
"
,
"
expose.config
"
]`` (an actual filesystem
path, an entry-point described in a ``setup.py`` file, or the name of a
python module.
...
...
@@ -291,7 +291,7 @@ def load(
# remove the keys that might break the loading of the next config file.
ctxt
.
__dict__
.
pop
(
"
__name__
"
,
None
)
ctxt
.
__dict__
.
pop
(
"
__package__
"
,
None
)
# do not prop
o
gate __ variables
# do not prop
a
gate __ variables
context
=
{
k
:
v
for
k
,
v
in
ctxt
.
__dict__
.
items
()
if
not
k
.
startswith
(
"
__
"
)
}
...
...
@@ -350,7 +350,7 @@ def resource_keys(
that entry point distribution (``.dist`` attribute) was only added to
Python in version 3.10. We therefore currently only verify if the named
resource does not start with any of the strings provided in
`exclude_package``.
`
`exclude_package``.
Arguments:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment