diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0dc601d6..749aa6ba 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.10.0.a3 +current_version = 0.10.0 commit = True tag = True diff --git a/HISTORY.rst b/HISTORY.rst index d3baba6d..78e0a1fb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,28 @@ History ------- +0.10.0 (2020-04-14) ++++++++++++++++++++++++ + +0.10.0.a3 +~~~~~~~~~~~~~~~~~~~~~~ + +* (PR #116, 2020-04-14) rcv.data_models: remove unnecessary fields +* (PR #114, 2020-04-14) rcv.parse_csv: remove param ``razon_social`` from parse functions + +0.10.0.a2 +~~~~~~~~~~~~~~~~~~~~~~ + +* (PR #112, 2020-04-14) data_models: make some fields optional + +0.10.0.a1 +~~~~~~~~~~~~~~~~~~~~~~ + +* (PR #110, 2020-04-13) rcv.data_models: move some fields to subclasses +* (PR #109, 2020-04-13) rcv.parse_csv: move code from 'fd-cl-data' in here +* (PR #108, 2020-04-13) dte.data_models: add 'DteXmlData' +* (PR #107, 2020-04-10) requirements: several updates + 0.9.1 (2020-03-20) +++++++++++++++++++++++ diff --git a/cl_sii/__init__.py b/cl_sii/__init__.py index 691835d7..f73bf4cf 100644 --- a/cl_sii/__init__.py +++ b/cl_sii/__init__.py @@ -5,4 +5,4 @@ """ -__version__ = '0.10.0.a3' +__version__ = '0.10.0' diff --git a/cl_sii/rcv/data_models.py b/cl_sii/rcv/data_models.py index 4c68fc2c..aa94131f 100644 --- a/cl_sii/rcv/data_models.py +++ b/cl_sii/rcv/data_models.py @@ -224,11 +224,6 @@ class RvDetalleEntry(RcvDetalleEntry): RCV_KIND = RcvKind.VENTAS RC_ESTADO_CONTABLE = None - emisor_razon_social: Optional[str] = dc_field() - """ - "Razón social" (legal name) of the "emisor" of the "documento". - """ - # TODO: docstring # TODO: can it be None? What happens for those "tipo docto" that do not have a receptor? receptor_razon_social: str = dc_field() @@ -244,11 +239,6 @@ class RvDetalleEntry(RcvDetalleEntry): def __post_init__(self) -> None: super().__post_init__() - if self.emisor_razon_social is not None: - if not isinstance(self.emisor_razon_social, str): - raise TypeError("Inappropriate type of 'emisor_razon_social'.") - cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social) - if not isinstance(self.receptor_razon_social, str): raise TypeError("Inappropriate type of 'receptor_razon_social'.") cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social) @@ -279,10 +269,6 @@ class RcRegistroDetalleEntry(RcvDetalleEntry): "Razón social" (legal name) of the "emisor" of the "documento". """ - # TODO: docstring - # TODO: can it be None? What happens for those "tipo docto" that do not have a receptor? - receptor_razon_social: Optional[str] = dc_field() - # TODO: docstring # note: must be timezone-aware. fecha_acuse_dt: Optional[datetime] = dc_field() @@ -294,11 +280,6 @@ def __post_init__(self) -> None: raise TypeError("Inappropriate type of 'emisor_razon_social'.") cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social) - if self.receptor_razon_social is not None: - if not isinstance(self.receptor_razon_social, str): - raise TypeError("Inappropriate type of 'receptor_razon_social'.") - cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social) - if self.fecha_acuse_dt is not None: if not isinstance(self.fecha_acuse_dt, datetime): raise TypeError("Inappropriate type of 'fecha_acuse_dt'.") @@ -331,10 +312,6 @@ class RcReclamadoDetalleEntry(RcvDetalleEntry): "Razón social" (legal name) of the "emisor" of the "documento". """ - # TODO: docstring - # TODO: can it be None? What happens for those "tipo docto" that do not have a receptor? - receptor_razon_social: Optional[str] = dc_field() - # TODO: docstring # note: must be timezone-aware. fecha_reclamo_dt: Optional[datetime] = dc_field() @@ -346,11 +323,6 @@ def __post_init__(self) -> None: raise TypeError("Inappropriate type of 'emisor_razon_social'.") cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social) - if self.receptor_razon_social is not None: - if not isinstance(self.receptor_razon_social, str): - raise TypeError("Inappropriate type of 'receptor_razon_social'.") - cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social) - if self.fecha_reclamo_dt is not None: if not isinstance(self.fecha_reclamo_dt, datetime): raise TypeError("Inappropriate type of 'fecha_reclamo_dt'.") @@ -372,18 +344,9 @@ class RcPendienteDetalleEntry(RcvDetalleEntry): "Razón social" (legal name) of the "emisor" of the "documento". """ - # TODO: docstring - # TODO: can it be None? What happens for those "tipo docto" that do not have a receptor? - receptor_razon_social: Optional[str] = dc_field() - def __post_init__(self) -> None: super().__post_init__() if not isinstance(self.emisor_razon_social, str): raise TypeError("Inappropriate type of 'emisor_razon_social'.") cl_sii.dte.data_models.validate_contribuyente_razon_social(self.emisor_razon_social) - - if self.receptor_razon_social is not None: - if not isinstance(self.receptor_razon_social, str): - raise TypeError("Inappropriate type of 'receptor_razon_social'.") - cl_sii.dte.data_models.validate_contribuyente_razon_social(self.receptor_razon_social) diff --git a/cl_sii/rcv/parse_csv.py b/cl_sii/rcv/parse_csv.py index c5d64ad7..55f4698c 100644 --- a/cl_sii/rcv/parse_csv.py +++ b/cl_sii/rcv/parse_csv.py @@ -656,8 +656,6 @@ def to_detalle_entry(self, data: dict) -> RvDetalleEntry: receptor_rut=receptor_rut, monto_total=monto_total, receptor_razon_social=receptor_razon_social, - # FIXME: remove after field 'emisor_razon_social' is removed from the dataclass - emisor_razon_social=None, fecha_recepcion_dt=fecha_recepcion_dt, fecha_acuse_dt=fecha_acuse_dt, fecha_reclamo_dt=fecha_reclamo_dt, @@ -791,8 +789,6 @@ def to_detalle_entry(self, data: dict) -> RcRegistroDetalleEntry: receptor_rut=receptor_rut, monto_total=monto_total, emisor_razon_social=emisor_razon_social, - # FIXME: remove after field 'receptor_razon_social' is removed from the dataclass - receptor_razon_social=None, fecha_recepcion_dt=fecha_recepcion_dt, fecha_acuse_dt=fecha_acuse_dt, ) @@ -827,8 +823,6 @@ def to_detalle_entry(self, data: dict) -> RcNoIncluirDetalleEntry: receptor_rut=receptor_rut, monto_total=monto_total, emisor_razon_social=emisor_razon_social, - # FIXME: remove after field 'receptor_razon_social' is removed from the dataclass - receptor_razon_social=None, fecha_recepcion_dt=fecha_recepcion_dt, fecha_acuse_dt=fecha_acuse_dt, ) @@ -967,8 +961,6 @@ def to_detalle_entry(self, data: dict) -> RcReclamadoDetalleEntry: receptor_rut=receptor_rut, monto_total=monto_total, emisor_razon_social=emisor_razon_social, - # FIXME: remove after field 'receptor_razon_social' is removed from the dataclass - receptor_razon_social=None, fecha_recepcion_dt=fecha_recepcion_dt, fecha_reclamo_dt=fecha_reclamo_dt, ) @@ -1090,8 +1082,6 @@ def to_detalle_entry(self, data: dict) -> RcPendienteDetalleEntry: receptor_rut=receptor_rut, monto_total=monto_total, emisor_razon_social=emisor_razon_social, - # FIXME: remove after field 'receptor_razon_social' is removed from the dataclass - receptor_razon_social=None, fecha_recepcion_dt=fecha_recepcion_dt, ) except (TypeError, ValueError): diff --git a/setup.cfg b/setup.cfg index 86ed2822..9c4a8b24 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,6 +27,11 @@ disallow_untyped_defs = True check_untyped_defs = True warn_return_any = True +show_column_numbers = True +show_error_codes = True +show_error_context = True +error_summary = True + [mypy-cryptography.*] ignore_missing_imports = True