From 93c47bfd75c16ad5aba5f95ba21b29b1cd814e28 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 22 Jan 2024 17:10:27 -0300 Subject: [PATCH 1/4] [UPD] Atualizando as Bibliotecas do Pre-Commit. --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5bca29b..d43bcd3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,20 +5,20 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: debug-statements - repo: https://github.com/timothycrosley/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.12.1 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 + rev: 7.0.0 hooks: - id: flake8 From 3d050086ffc31447b670e3d58040e5acde33c7c9 Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 22 Jan 2024 17:12:50 -0300 Subject: [PATCH 2/4] =?UTF-8?q?[FIX]=20Evitar=20conflito=20entre=20a=20val?= =?UTF-8?q?ida=C3=A7=C3=A3o=20feita=20pelo=20Black=20e=20Flake8=20sobre=20?= =?UTF-8?q?o=20E203.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 2da93d7..25e35d2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,10 @@ universal = 1 [flake8] max-line-length = 140 exclude = */migrations/* +# Conflito entre o Black e Flake8 +# https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#slices +# This behaviour may raise E203 whitespace before ':' warnings in style guide enforcement tools like Flake8. Since E203 is not PEP 8 compliant, you should tell Flake8 to ignore these warnings. +extend-ignore = E203 [tool:pytest] testpaths = tests From 93b1f38464568f7effd34d70b604eafe3027078f Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 22 Jan 2024 17:16:59 -0300 Subject: [PATCH 3/4] =?UTF-8?q?[REF]=20Refatora=C3=A7=C3=A3o=20feita=20aut?= =?UTF-8?q?omaticamente=20ao=20rodar=20o=20comando=20pre-commit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ci/bootstrap.py | 16 +++++++++++----- src/erpbrasil/base/fiscal/edoc.py | 2 +- src/erpbrasil/base/gs1/gtin.py | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ci/bootstrap.py b/ci/bootstrap.py index fd2ece4..11db6d0 100755 --- a/ci/bootstrap.py +++ b/ci/bootstrap.py @@ -35,7 +35,7 @@ def exec_in_env(): check_call([bin_path / "pip", "install", "jinja2", "tox"]) python_executable = bin_path / "python" if not python_executable.exists(): - python_executable = python_executable.with_suffix('.exe') + python_executable = python_executable.with_suffix(".exe") print("Re-executing with: {0}".format(python_executable)) print("+ exec", python_executable, __file__, "--no-env") @@ -61,16 +61,22 @@ def main(): # This uses sys.executable the same way that the call in # cookiecutter-pylibrary/hooks/post_gen_project.py # invokes this bootstrap.py itself. - for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines() + for line in subprocess.check_output( + [sys.executable, "-m", "tox", "--listenvs"], universal_newlines=True + ).splitlines() ] - tox_environments = [line for line in tox_environments if line.startswith('py')] + tox_environments = [line for line in tox_environments if line.startswith("py")] - for template in templates_path.rglob('*'): + for template in templates_path.rglob("*"): if template.is_file(): template_path = str(template.relative_to(templates_path)) destination = base_path / template_path destination.parent.mkdir(parents=True, exist_ok=True) - destination.write_text(jinja.get_template(template_path).render(tox_environments=tox_environments)) + destination.write_text( + jinja.get_template(template_path).render( + tox_environments=tox_environments + ) + ) print("Wrote {}".format(template_path)) print("DONE.") diff --git a/src/erpbrasil/base/fiscal/edoc.py b/src/erpbrasil/base/fiscal/edoc.py index e61ed10..865a91b 100644 --- a/src/erpbrasil/base/fiscal/edoc.py +++ b/src/erpbrasil/base/fiscal/edoc.py @@ -347,7 +347,7 @@ def partes(self, num_partes=11): ).format(num_partes) salto = 44 // num_partes - return [self._campos[n: (n + salto)] for n in range(0, 44, salto)] + return [self._campos[n : (n + salto)] for n in range(0, 44, salto)] class ChaveCFeSAT(ChaveEdoc): diff --git a/src/erpbrasil/base/gs1/gtin.py b/src/erpbrasil/base/gs1/gtin.py index e6bb254..cdb9684 100644 --- a/src/erpbrasil/base/gs1/gtin.py +++ b/src/erpbrasil/base/gs1/gtin.py @@ -15,7 +15,7 @@ def calcula_dv(gs1_code, code_length): prod = [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3] # get the product with some gs1_code length - gs1_prod = prod[len(prod) - len(gs1_code):] + gs1_prod = prod[len(prod) - len(gs1_code) :] while len(gs1_code) < code_length: r = sum([x * y for (x, y) in zip(gs1_code, gs1_prod)]) % 10 From 59ffa9c2fe905fb08ce64e8b57e61ffb61b62f9c Mon Sep 17 00:00:00 2001 From: Magno Costa Date: Mon, 22 Jan 2024 19:46:14 -0300 Subject: [PATCH 4/4] =?UTF-8?q?[FIX]=20Imagem=20https://api.travis-ci.org/?= =?UTF-8?q?erpbrasil/erpbrasil.base.svg=20n=C3=A3o=20encontrada.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.rst | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.rst b/README.rst index 07df202..b6a98a5 100644 --- a/README.rst +++ b/README.rst @@ -18,10 +18,6 @@ Overview :target: https://readthedocs.org/projects/erpbrasilbase :alt: Documentation Status -.. |travis| image:: https://api.travis-ci.org/erpbrasil/erpbrasil.base.svg?branch=master - :alt: Travis-CI Build Status - :target: https://travis-ci.org/erpbrasil/erpbrasil.base - .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/erpbrasil/erpbrasil.base?branch=master&svg=true :alt: AppVeyor Build Status :target: https://ci.appveyor.com/project/erpbrasil/erpbrasil.base