From 634f2446423fd5a432f9a114b21efe22c7d4ede5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Feb 2023 21:24:43 +0000 Subject: [PATCH 1/2] chore(deps-dev): Bump black from 22.12.0 to 23.1.0 Bumps [black](https://github.com/psf/black) from 22.12.0 to 23.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.12.0...23.1.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.in | 2 +- requirements-dev.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements-dev.in b/requirements-dev.in index cc90527d..e23fbfc6 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -4,7 +4,7 @@ -c requirements.txt -black==22.12.0 +black==23.1.0 bumpversion==0.5.3 codecov==2.1.12 coverage==7.1.0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 990a0073..39afb1b6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ # appdirs==1.4.4 # via virtualenv -black==22.12.0 +black==23.1.0 # via -r requirements-dev.in bleach==5.0.1 # via readme-renderer @@ -66,6 +66,7 @@ mypy-extensions==0.4.3 packaging==23.0 # via # -c requirements.txt + # black # tox pathspec==0.9.0 # via black From 84c1be060c364c7316b1705ef41283b17f1061dc Mon Sep 17 00:00:00 2001 From: Samuel Villegas Date: Thu, 9 Mar 2023 12:51:40 -0300 Subject: [PATCH 2/2] chore: reformat code for 2023 stable style of `black` Ref: https://github.com/psf/black/blob/main/CHANGES.md#stable-style-1 Ref: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html --- cl_sii/dte/parse.py | 1 - cl_sii/libs/dataclass_utils.py | 1 - cl_sii/libs/xml_utils.py | 1 - cl_sii/rcv/data_models.py | 1 - cl_sii/rcv/parse_csv.py | 4 ---- tests/test_dte_constants.py | 14 +++++++------- tests/test_extras_drf_fields.py | 1 - tests/test_extras_mm_fields.py | 4 ---- tests/test_libs_dataclass_utils.py | 3 --- tests/test_libs_io_utils.py | 1 - tests/test_libs_json_utils.py | 1 - tests/test_libs_xml_utils.py | 3 --- tests/test_rcv_parse_csv.py | 5 ----- tests/test_rtc_constants.py | 1 - tests/test_rut.py | 1 - 15 files changed, 7 insertions(+), 35 deletions(-) diff --git a/cl_sii/dte/parse.py b/cl_sii/dte/parse.py index 487017d9..44b0e0a2 100644 --- a/cl_sii/dte/parse.py +++ b/cl_sii/dte/parse.py @@ -544,7 +544,6 @@ def _text_strip_or_raise(xml_em: XmlElement) -> str: def _set_dte_xml_missing_xmlns(xml_doc: XmlElement) -> Tuple[XmlElement, bool]: - # source: name of the XML element without namespace. # cl_sii/data/ref/factura_electronica/schemas-xml/DTE_v10.xsd#L22 (f57a326) # cl_sii/data/ref/factura_electronica/schemas-xml/EnvioDTE_v10.xsd#L92 (f57a326) diff --git a/cl_sii/libs/dataclass_utils.py b/cl_sii/libs/dataclass_utils.py index 129f39ac..8bfa6053 100644 --- a/cl_sii/libs/dataclass_utils.py +++ b/cl_sii/libs/dataclass_utils.py @@ -84,7 +84,6 @@ def dc_deep_compare(value_a: object, value_b: object) -> DcDeepComparison: def _dc_deep_compare_to(value_a: object, value_b: object) -> DcDeepComparison: - if type(value_a) != type(value_b): raise TypeError("Values to be compared must be of the same type.") diff --git a/cl_sii/libs/xml_utils.py b/cl_sii/libs/xml_utils.py index f0728b4f..f204bc26 100644 --- a/cl_sii/libs/xml_utils.py +++ b/cl_sii/libs/xml_utils.py @@ -182,7 +182,6 @@ def parse_untrusted_xml(value: bytes) -> XmlElement: # warning: do NOT change the exception handling order. try: - xml_root_em = defusedxml.lxml.fromstring( text=value, parser=None, # default: None (a custom one will be created) diff --git a/cl_sii/rcv/data_models.py b/cl_sii/rcv/data_models.py index 6754c7b5..d2732d92 100644 --- a/cl_sii/rcv/data_models.py +++ b/cl_sii/rcv/data_models.py @@ -24,7 +24,6 @@ @pydantic.dataclasses.dataclass(frozen=True) class PeriodoTributario: - ########################################################################### # constants ########################################################################### diff --git a/cl_sii/rcv/parse_csv.py b/cl_sii/rcv/parse_csv.py index e17f0176..7b57b5dc 100644 --- a/cl_sii/rcv/parse_csv.py +++ b/cl_sii/rcv/parse_csv.py @@ -519,7 +519,6 @@ def to_detalle_entry(self, data: dict) -> RcvDetalleEntry: class RcvVentaCsvRowSchema(_RcvCsvRowSchemaBase): - FIELD_FECHA_RECEPCION_DT_TZ = SII_OFFICIAL_TZ FIELD_FECHA_ACUSE_DT_TZ = SII_OFFICIAL_TZ FIELD_FECHA_RECLAMO_DT_TZ = SII_OFFICIAL_TZ @@ -666,7 +665,6 @@ def to_detalle_entry(self, data: dict) -> RvDetalleEntry: class RcvCompraRegistroCsvRowSchema(_RcvCsvRowSchemaBase): - FIELD_FECHA_RECEPCION_DT_TZ = SII_OFFICIAL_TZ FIELD_FECHA_ACUSE_DT_TZ = SII_OFFICIAL_TZ @@ -830,7 +828,6 @@ def to_detalle_entry(self, data: dict) -> RcNoIncluirDetalleEntry: class RcvCompraReclamadoCsvRowSchema(_RcvCsvRowSchemaBase): - FIELD_FECHA_RECEPCION_DT_TZ = SII_OFFICIAL_TZ FIELD_FECHA_RECLAMO_DT_TZ = SII_OFFICIAL_TZ @@ -967,7 +964,6 @@ def to_detalle_entry(self, data: dict) -> RcReclamadoDetalleEntry: class RcvCompraPendienteCsvRowSchema(_RcvCsvRowSchemaBase): - FIELD_FECHA_RECEPCION_DT_TZ = SII_OFFICIAL_TZ FIELD_FECHA_ACUSE_DT_TZ = SII_OFFICIAL_TZ diff --git a/tests/test_dte_constants.py b/tests/test_dte_constants.py index 3c737b19..3fdc00dd 100644 --- a/tests/test_dte_constants.py +++ b/tests/test_dte_constants.py @@ -34,7 +34,7 @@ def test_FACTURA_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertEqual(result, expected) def test_FACTURA_NO_AFECTA_O_EXENTA_ELECTRONICA(self) -> None: @@ -52,7 +52,7 @@ def test_FACTURA_NO_AFECTA_O_EXENTA_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertTrue(result is expected) def test_LIQUIDACION_FACTURA_ELECTRONICA(self) -> None: @@ -70,7 +70,7 @@ def test_LIQUIDACION_FACTURA_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertEqual(result, expected) def test_FACTURA_COMPRA_ELECTRONICA(self) -> None: @@ -88,7 +88,7 @@ def test_FACTURA_COMPRA_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, True), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertTrue(result is expected) def test_GUIA_DESPACHO_ELECTRONICA(self) -> None: @@ -106,7 +106,7 @@ def test_GUIA_DESPACHO_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertTrue(result is expected) def test_NOTA_DEBITO_ELECTRONICA(self) -> None: @@ -124,7 +124,7 @@ def test_NOTA_DEBITO_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertTrue(result is expected) def test_NOTA_CREDITO_ELECTRONICA(self) -> None: @@ -142,5 +142,5 @@ def test_NOTA_CREDITO_ELECTRONICA(self) -> None: (value.receptor_is_vendedor, False), ] - for (result, expected) in assertions: + for result, expected in assertions: self.assertTrue(result is expected) diff --git a/tests/test_extras_drf_fields.py b/tests/test_extras_drf_fields.py index 92f5dfd0..083c234c 100644 --- a/tests/test_extras_drf_fields.py +++ b/tests/test_extras_drf_fields.py @@ -9,7 +9,6 @@ class RutFieldTest(unittest.TestCase): - # TODO: implement! pass diff --git a/tests/test_extras_mm_fields.py b/tests/test_extras_mm_fields.py index 23b58333..52a9463b 100644 --- a/tests/test_extras_mm_fields.py +++ b/tests/test_extras_mm_fields.py @@ -44,7 +44,6 @@ class LoadMyMmSchema(marshmallow.Schema): ) class MyMmSchemaStrict(marshmallow.Schema): - emisor_rut = RutField( required=True, data_key='RUT of Emisor', @@ -110,7 +109,6 @@ def test_dump_ok_strange(self) -> None: self.assertEqual(data, {}) def test_load_fail(self) -> None: - schema = self.LoadMyMmSchema() data_invalid_1 = {'RUT of Emisor': '123123123123'} @@ -252,7 +250,6 @@ def test_dump_ok_strange(self) -> None: self.assertEqual(data, {}) def test_load_fail(self) -> None: - schema = self.LoadMyMmSchema() data_invalid_1 = {'source field name': '123'} @@ -406,7 +403,6 @@ def test_dump_ok_strange(self) -> None: self.assertEqual(data, {}) def test_load_fail(self) -> None: - schema = self.LoadMyMmSchema() data_invalid_1 = {'source field name': '123'} diff --git a/tests/test_libs_dataclass_utils.py b/tests/test_libs_dataclass_utils.py index 21633e5c..c773d8b3 100644 --- a/tests/test_libs_dataclass_utils.py +++ b/tests/test_libs_dataclass_utils.py @@ -12,13 +12,11 @@ @dataclasses.dataclass class DataclassA: - field_1: int = dataclasses.field() @dataclasses.dataclass class DataclassBWithoutMixin: - field_1: object = dataclasses.field() field_2: Dict[str, object] = dataclasses.field() field_3: tuple = dataclasses.field() @@ -29,7 +27,6 @@ class DataclassBWithoutMixin: @dataclasses.dataclass class DataclassBWithMixin(DataclassBWithoutMixin, DcDeepCompareMixin): - pass diff --git a/tests/test_libs_io_utils.py b/tests/test_libs_io_utils.py index e278f699..7ad3a6f8 100644 --- a/tests/test_libs_io_utils.py +++ b/tests/test_libs_io_utils.py @@ -128,7 +128,6 @@ def test_with_mode_x(self) -> None: self.assertFalse(with_mode_text(f)) with tempfile.NamedTemporaryFile() as f: - self.assertTrue(isinstance(f, tempfile._TemporaryFileWrapper)) self.assertTrue(with_mode_binary(f)) self.assertFalse(with_mode_text(f)) diff --git a/tests/test_libs_json_utils.py b/tests/test_libs_json_utils.py index ca00b714..37f051e6 100644 --- a/tests/test_libs_json_utils.py +++ b/tests/test_libs_json_utils.py @@ -5,7 +5,6 @@ class FunctionReadJsonSchemaTest(unittest.TestCase): - # TODO: implement pass diff --git a/tests/test_libs_xml_utils.py b/tests/test_libs_xml_utils.py index c6733098..ab2a453e 100644 --- a/tests/test_libs_xml_utils.py +++ b/tests/test_libs_xml_utils.py @@ -96,21 +96,18 @@ def test_type_error(self) -> None: class FunctionReadXmlSchemaTest(unittest.TestCase): - # TODO: implement pass class FunctionValidateXmlDocTest(unittest.TestCase): - # TODO: implement pass class FunctionWriteXmlDocTest(unittest.TestCase): - # TODO: implement for function 'write_xml_doc'. Consider each of the "observations". pass diff --git a/tests/test_rcv_parse_csv.py b/tests/test_rcv_parse_csv.py index e498c0f3..d0665595 100644 --- a/tests/test_rcv_parse_csv.py +++ b/tests/test_rcv_parse_csv.py @@ -19,31 +19,26 @@ class RcvVentaCsvRowSchemaTest(unittest.TestCase): - # TODO: implement for 'RcvVentaCsvRowSchema'. pass class RcvCompraRegistroCsvRowSchemaTest(unittest.TestCase): - # TODO: implement for 'RcvCompraRegistroCsvRowSchema'. pass class RcvCompraNoIncluirCsvRowSchemaTest(unittest.TestCase): - # TODO: implement for 'RcvCompraNoIncluirCsvRowSchema'. pass class RcvCompraReclamadoCsvRowSchemaTest(unittest.TestCase): - # TODO: implement for 'RcvCompraReclamadoCsvRowSchema'. pass class RcvCompraPendienteCsvRowSchemaTest(unittest.TestCase): - # TODO: implement for 'RcvCompraPendienteCsvRowSchema'. pass diff --git a/tests/test_rtc_constants.py b/tests/test_rtc_constants.py index 89b3f277..056a74cb 100644 --- a/tests/test_rtc_constants.py +++ b/tests/test_rtc_constants.py @@ -4,7 +4,6 @@ class TipoDteCediblesTest(unittest.TestCase): - # For 'TIPO_DTE_CEDIBLES' def test_all_are_factura(self) -> None: diff --git a/tests/test_rut.py b/tests/test_rut.py index da7895e7..e7dd2e47 100644 --- a/tests/test_rut.py +++ b/tests/test_rut.py @@ -5,7 +5,6 @@ class RutTest(unittest.TestCase): - valid_rut_canonical: str valid_rut_dv: str valid_rut_digits: str