15
0
Files
python-flake8-pyi/set-tests-python-path.patch
Markéta Machová 5e5d7cc4a9 Accepting request 1105894 from home:mcalabkova:branches:devel:languages:python
- Update to 23.6.0
  * Y011/Y014/Y015: Allow math constants math.inf, math.nan, math.e, 
    math.pi, math.tau, and their negatives in default values. Some 
    other semantically equivalent values, such as x = inf (from math 
    import inf), or x = np.inf (import numpy as np), should be rewritten 
    to x = math.inf.
  * Y053: Disallow string or bytes literals with length >50 characters. 
    Previously this rule only applied to parameter default values; 
    it now applies everywhere.
  * Y054: Disallow numeric literals with a string representation >10 
    characters long. Previously this rule only applied to parameter 
    default values; it now applies everywhere.
  * Y055: Unions of the form type[X] | type[Y] can be simplified to type[X | Y].
  * The way in which flake8-pyi modifies pyflakes runs has been improved.
  * Introduce Y056: Various type checkers have different levels of support 
    for method calls on __all__. Use __all__ += ["foo", "bar"] instead, 
    as this is known to be supported by all major type checkers.
  * Support Python 3.12
  * Support PEP 695 syntax for declaring type aliases
  * Introduce Y057: Do not use typing.ByteString or collections.abc.ByteString.
  * flake8-pyi no longer supports being run on Python 3.7.
  * flake8-pyi no longer supports being run with flake8 <v6.

OBS-URL: https://build.opensuse.org/request/show/1105894
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-pyi?expand=0&rev=19
2023-08-25 18:47:40 +00:00

29 lines
1.2 KiB
Diff

Index: flake8_pyi-23.6.0/tests/test_pyi_files.py
===================================================================
--- flake8_pyi-23.6.0.orig/tests/test_pyi_files.py
+++ flake8_pyi-23.6.0/tests/test_pyi_files.py
@@ -42,16 +42,21 @@ def test_pyi_file(path: str) -> None:
option = flag.split("=")[0]
assert option != "--ignore", bad_flag_msg
+ pythonpath = os.environ.get("PYTHONPATH")
+ pythonpath = f"PYTHONPATH={pythonpath}:."
+
run_results = [
# Passing a file on command line
subprocess.run(
- ["flake8", "-j0", *flags, path],
+ " ".join([pythonpath, "flake8", "-j0", *flags, path]),
+ shell=True,
env={**os.environ, "PYTHONPATH": "."},
stdout=subprocess.PIPE,
),
# Passing "-" as the file, and reading from stdin instead
subprocess.run(
- ["flake8", "-j0", "--stdin-display-name", path, *flags, "-"],
+ " ".join([pythonpath, "flake8", "-j0", "--stdin-display-name", path, *flags, "-"]),
+ shell=True,
env={**os.environ, "PYTHONPATH": "."},
input=file_contents.encode("utf-8"),
stdout=subprocess.PIPE,