Overview

Request 1069697 accepted

- Add set-tests-python-path.patch to fix tests inside osc build
environment, running the flake8 process with shell=True and forcing
the PYTHONPATH.
- Update to 23.1.2:
* Y011/Y014/Y015: Increase the maximum character length of literal
numbers in default values from 7 to 10, allowing hexadecimal
representation of 32-bit integers. Contributed by Avasam.
- 23.1.1
New error codes:
* Y052: Disallow default values in global or class namespaces where
the assignment does not have a type annotation. Stubs should be
explicit about the type of all variables in the stub; without type
annotations, the type checker is forced to make inferences, which
may have unpredictable consequences. Enum members are excluded
from this check, as are various special assignments such as
__all__ and __match_args__.
Other changes:
* Disallow numeric default values where len(str(default)) > 7. If a
function has a default value where the string representation is
greater than 7 characters, it is likely to be an implementation
detail or a constant that varies depending on the system you're
running on, such as sys.maxsize.
* Disallow str or bytes defaults where the default is >50 characters
long, for similar reasons.
* Allow ast.Attribute nodes as default values for a small number of
special cases, such as sys.maxsize and sys.executable.
* Fewer Y020 false positives are now emitted when encountering
default values in stub files.
- 23.1.0
Bugfixes:
* Do not emit Y020 (quoted annotations) for strings in parameter defaults.
* Fix checking of defaults for functions with positional-only parameters.
Other changes:
* Modify Y036 so that _typeshed.Unused is allowed as an annotation
for parameters in __(a)exit__ methods. Contributed by Avasam
* Several changes have been made to error codes relating to imports:
- The Y027 error code has been removed.
- All errors that used to result in Y027 being emitted now result
in Y022 being emitted instead.
- Some errors that used to result in Y023 being emitted now result
in Y022 being emitted instead.
- typing.Match and typing.Pattern have been added to the list of
imports banned by Y022. Use re.Match and re.Pattern instead.
* flake8-pyi no longer supports stub files that aim to support
Python 2. If your stubs need to support Python 2, pin flake8-pyi
to 22.11.0 or lower.
* Y011, Y014 and Y015 have all been significantly relaxed. None,
bools, ints, floats, complex numbers, strings and bytes are all
now allowed as default values for parameter annotations or
assignments.
* Hatchling is now used as the build backend. This should have
minimal, if any, user-facing impact.

Request History
Daniel Garcia's avatar

dgarcia created request

- Add set-tests-python-path.patch to fix tests inside osc build
environment, running the flake8 process with shell=True and forcing
the PYTHONPATH.
- Update to 23.1.2:
* Y011/Y014/Y015: Increase the maximum character length of literal
numbers in default values from 7 to 10, allowing hexadecimal
representation of 32-bit integers. Contributed by Avasam.
- 23.1.1
New error codes:
* Y052: Disallow default values in global or class namespaces where
the assignment does not have a type annotation. Stubs should be
explicit about the type of all variables in the stub; without type
annotations, the type checker is forced to make inferences, which
may have unpredictable consequences. Enum members are excluded
from this check, as are various special assignments such as
__all__ and __match_args__.
Other changes:
* Disallow numeric default values where len(str(default)) > 7. If a
function has a default value where the string representation is
greater than 7 characters, it is likely to be an implementation
detail or a constant that varies depending on the system you're
running on, such as sys.maxsize.
* Disallow str or bytes defaults where the default is >50 characters
long, for similar reasons.
* Allow ast.Attribute nodes as default values for a small number of
special cases, such as sys.maxsize and sys.executable.
* Fewer Y020 false positives are now emitted when encountering
default values in stub files.
- 23.1.0
Bugfixes:
* Do not emit Y020 (quoted annotations) for strings in parameter defaults.
* Fix checking of defaults for functions with positional-only parameters.
Other changes:
* Modify Y036 so that _typeshed.Unused is allowed as an annotation
for parameters in __(a)exit__ methods. Contributed by Avasam
* Several changes have been made to error codes relating to imports:
- The Y027 error code has been removed.
- All errors that used to result in Y027 being emitted now result
in Y022 being emitted instead.
- Some errors that used to result in Y023 being emitted now result
in Y022 being emitted instead.
- typing.Match and typing.Pattern have been added to the list of
imports banned by Y022. Use re.Match and re.Pattern instead.
* flake8-pyi no longer supports stub files that aim to support
Python 2. If your stubs need to support Python 2, pin flake8-pyi
to 22.11.0 or lower.
* Y011, Y014 and Y015 have all been significantly relaxed. None,
bools, ints, floats, complex numbers, strings and bytes are all
now allowed as default values for parameter annotations or
assignments.
* Hatchling is now used as the build backend. This should have
minimal, if any, user-facing impact.


Factory Auto's avatar

factory-auto added opensuse-review-team as a reviewer

Please review sources


Factory Auto's avatar

factory-auto accepted review

Check script succeeded


Saul Goodman's avatar

licensedigger accepted review

ok


Dominique Leuenberger's avatar

dimstar_suse added openSUSE:Factory:Staging:adi:14 as a reviewer

Being evaluated by staging project "openSUSE:Factory:Staging:adi:14"


Dominique Leuenberger's avatar

dimstar_suse accepted review

Picked "openSUSE:Factory:Staging:adi:14"


Dominique Leuenberger's avatar

dimstar accepted review


Dominique Leuenberger's avatar

dimstar_suse accepted review

Staging Project openSUSE:Factory:Staging:adi:14 got accepted.


Dominique Leuenberger's avatar

dimstar_suse approved review

Staging Project openSUSE:Factory:Staging:adi:14 got accepted.


Dominique Leuenberger's avatar

dimstar_suse accepted request

Staging Project openSUSE:Factory:Staging:adi:14 got accepted.

openSUSE Build Service is sponsored by