mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
Update ruff requirement from <=0.4.7,>=0.4.1 to <=0.5.0,>=0.5.0 (#6990)
* Update ruff requirement from <=0.4.7,>=0.4.1 to <=0.5.0,>=0.5.0 Updates the requirements on [ruff](https://github.com/astral-sh/ruff) to permit the latest version. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.1...0.5.0) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * fixup * fixup * fixuppppps * fixups --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Maximilian Hils <github@maximilianhils.com>
This commit is contained in:
parent
c1e187c6e7
commit
5496045e0b
5 changed files with 13 additions and 13 deletions
2
.github/workflows/autofix.yml
vendored
2
.github/workflows/autofix.yml
vendored
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
with:
|
||||
python-version-file: .github/python-version.txt
|
||||
- run: pip install -e .[dev]
|
||||
- run: ruff --fix-only .
|
||||
- run: ruff check --fix-only .
|
||||
- run: ruff format .
|
||||
|
||||
- run: web/gen/all
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class OptManager:
|
|||
if attr not in self._options:
|
||||
raise KeyError("No such option: %s" % attr)
|
||||
o = self._options[attr]
|
||||
if o.typespec != bool:
|
||||
if o.typespec is not bool:
|
||||
raise ValueError("Toggler can only be used with boolean options")
|
||||
|
||||
def toggle():
|
||||
|
|
@ -379,7 +379,7 @@ class OptManager:
|
|||
optstr = None
|
||||
|
||||
if o.typespec in (str, Optional[str]):
|
||||
if o.typespec == str and optstr is None:
|
||||
if o.typespec is str and optstr is None:
|
||||
raise exceptions.OptionsError(f"Option is required: {o.name}")
|
||||
return optstr
|
||||
elif o.typespec in (int, Optional[int]):
|
||||
|
|
@ -388,11 +388,11 @@ class OptManager:
|
|||
return int(optstr)
|
||||
except ValueError:
|
||||
raise exceptions.OptionsError(f"Not an integer: {optstr}")
|
||||
elif o.typespec == int:
|
||||
elif o.typespec is int:
|
||||
raise exceptions.OptionsError(f"Option is required: {o.name}")
|
||||
else:
|
||||
return None
|
||||
elif o.typespec == bool:
|
||||
elif o.typespec is bool:
|
||||
if optstr == "toggle":
|
||||
return not o.current()
|
||||
if not optstr or optstr == "true":
|
||||
|
|
@ -424,7 +424,7 @@ class OptManager:
|
|||
|
||||
flags = mkf(optname, short)
|
||||
|
||||
if o.typespec == bool:
|
||||
if o.typespec is bool:
|
||||
g = parser.add_mutually_exclusive_group(required=False)
|
||||
onf = mkf(optname, None)
|
||||
offf = mkf("no-" + optname, None)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class OptionItem(urwid.WidgetWrap):
|
|||
|
||||
def get_widget(self):
|
||||
val = self.opt.current()
|
||||
if self.opt.typespec == bool:
|
||||
if self.opt.typespec is bool:
|
||||
displayval = "true" if val else "false"
|
||||
elif not val:
|
||||
displayval = ""
|
||||
|
|
@ -190,7 +190,7 @@ class OptionsList(urwid.ListBox):
|
|||
self.walker._modified()
|
||||
elif key == "m_select":
|
||||
foc, idx = self.get_focus()
|
||||
if foc.opt.typespec == bool:
|
||||
if foc.opt.typespec is bool:
|
||||
self.master.options.toggler(foc.opt.name)()
|
||||
# Bust the focus widget cache
|
||||
self.set_focus(self.walker.index)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ dev = [
|
|||
"wheel>=0.36.2,<=0.43",
|
||||
"build>=0.10.0,<=1.2.1",
|
||||
"mypy<=1.10.1,>=1.10.1",
|
||||
"ruff>=0.4.1,<=0.4.7",
|
||||
"ruff<=0.5.0,>=0.5.0",
|
||||
"types-certifi>=2021.10.8.3,<=2021.10.8.3",
|
||||
"types-Flask>=1.1.6,<=1.1.6",
|
||||
"types-Werkzeug>=1.0.9,<=1.0.9",
|
||||
|
|
@ -299,7 +299,7 @@ uv_resolution = lowest-direct
|
|||
|
||||
[testenv:lint]
|
||||
commands =
|
||||
ruff .
|
||||
ruff check .
|
||||
|
||||
[testenv:filename_matching]
|
||||
deps =
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ filename = here / "../src/js/ducks/_options_gen.ts"
|
|||
|
||||
|
||||
def _ts_type(t):
|
||||
if t == bool:
|
||||
if t is bool:
|
||||
return "boolean"
|
||||
if t == str:
|
||||
if t is str:
|
||||
return "string"
|
||||
if t == int:
|
||||
if t is int:
|
||||
return "number"
|
||||
if t == Sequence[str]:
|
||||
return "string[]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue