Merge ~cjwatson/lazr.restfulclient:pyupgrade into lazr.restfulclient:main

Proposed by Colin Watson
Status: Merged
Merged at revision: 7f612076114eb8171e51ba056ebf7ae03e26cb38
Proposed branch: ~cjwatson/lazr.restfulclient:pyupgrade
Merge into: lazr.restfulclient:main
Diff against target: 39 lines (+10/-7)
2 files modified
.pre-commit-config.yaml (+5/-0)
src/lazr/restfulclient/resource.py (+5/-7)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+412006@code.launchpad.net

Commit message

Apply pyupgrade

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

LGTM

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
2index e27ba98..0f47890 100644
3--- a/.pre-commit-config.yaml
4+++ b/.pre-commit-config.yaml
5@@ -14,6 +14,11 @@ repos:
6 - id: debug-statements
7 - id: end-of-file-fixer
8 - id: trailing-whitespace
9+- repo: https://github.com/asottile/pyupgrade
10+ rev: v2.29.0
11+ hooks:
12+ - id: pyupgrade
13+ args: [--keep-percent-format]
14 - repo: https://github.com/PyCQA/isort
15 rev: 5.10.1
16 hooks:
17diff --git a/src/lazr/restfulclient/resource.py b/src/lazr/restfulclient/resource.py
18index a330676..b11cbbc 100644
19--- a/src/lazr/restfulclient/resource.py
20+++ b/src/lazr/restfulclient/resource.py
21@@ -609,13 +609,11 @@ class NamedOperation(RestfulBase):
22 "form-urlencoded request representation."
23 )
24 params = definition.params(self.resource._wadl_resource)
25- send_as_is_params = set(
26- [
27- param.name
28- for param in params
29- if param.type == "binary" or len(param.options) > 0
30- ]
31- )
32+ send_as_is_params = {
33+ param.name
34+ for param in params
35+ if param.type == "binary" or len(param.options) > 0
36+ }
37 for key, value in args.items():
38 # Certain parameter values should not be JSON-encoded:
39 # binary parameters (because they can't be JSON-encoded)

Subscribers

People subscribed via source and target branches