Skip to content

Commit

Permalink
Merge pull request #117 from fyntex/release/v0.10.0
Browse files Browse the repository at this point in the history
Release v0.10.0
  • Loading branch information
glarrain committed Apr 15, 2020
2 parents d84d127 + a2adc48 commit 267c1a5
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.10.0.a3
current_version = 0.10.0
commit = True
tag = True

Expand Down
22 changes: 22 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
+++++++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion cl_sii/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""


__version__ = '0.10.0.a3'
__version__ = '0.10.0'
37 changes: 0 additions & 37 deletions cl_sii/rcv/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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'.")
Expand Down Expand Up @@ -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()
Expand All @@ -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'.")
Expand All @@ -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)
10 changes: 0 additions & 10 deletions cl_sii/rcv/parse_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 267c1a5

Please sign in to comment.