Skip to content

Commit

Permalink
Merge pull request #71 from Engenere/refactor-ci-tests
Browse files Browse the repository at this point in the history
Refatoração do CI, Github Actions, Pre-commit e Testes
  • Loading branch information
antoniospneto authored Mar 12, 2024
2 parents ac4967b + 3f247f3 commit ea5c705
Show file tree
Hide file tree
Showing 54 changed files with 2,080 additions and 2,330 deletions.
46 changes: 0 additions & 46 deletions .appveyor.yml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: build
on: [push, pull_request]
jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: 'check'
python: '3.9'
toxpython: 'python3.9'
tox_env: 'check'
os: 'ubuntu-latest'
- name: 'docs'
python: '3.9'
toxpython: 'python3.9'
tox_env: 'docs'
os: 'ubuntu-latest'
- name: 'py37 (ubuntu)'
python: '3.7'
toxpython: 'python3.7'
python_arch: 'x64'
tox_env: 'py37'
os: 'ubuntu-latest'
- name: 'py37 (windows)'
python: '3.7'
toxpython: 'python3.7'
python_arch: 'x64'
tox_env: 'py37'
os: 'windows-latest'
- name: 'py37 (macos)'
python: '3.7'
toxpython: 'python3.7'
python_arch: 'x64'
tox_env: 'py37'
os: 'macos-latest'
- name: 'py38 (ubuntu)'
python: '3.8'
toxpython: 'python3.8'
python_arch: 'x64'
tox_env: 'py38'
os: 'ubuntu-latest'
- name: 'py38 (windows)'
python: '3.8'
toxpython: 'python3.8'
python_arch: 'x64'
tox_env: 'py38'
os: 'windows-latest'
- name: 'py38 (macos)'
python: '3.8'
toxpython: 'python3.8'
python_arch: 'x64'
tox_env: 'py38'
os: 'macos-latest'
- name: 'py39 (ubuntu)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
tox_env: 'py39'
os: 'ubuntu-latest'
- name: 'py39 (windows)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
tox_env: 'py39'
os: 'windows-latest'
- name: 'py39 (macos)'
python: '3.9'
toxpython: 'python3.9'
python_arch: 'x64'
tox_env: 'py39'
os: 'macos-latest'
- name: 'py310 (ubuntu)'
python: '3.10'
toxpython: 'python3.10'
python_arch: 'x64'
tox_env: 'py310'
os: 'ubuntu-latest'
- name: 'py310 (windows)'
python: '3.10'
toxpython: 'python3.10'
python_arch: 'x64'
tox_env: 'py310'
os: 'windows-latest'
- name: 'py310 (macos)'
python: '3.10'
toxpython: 'python3.10'
python_arch: 'x64'
tox_env: 'py310'
os: 'macos-latest'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.python_arch }}
- name: install dependencies
run: |
python -mpip install --progress-bar=off -r ci/requirements.txt
virtualenv --version
pip --version
tox --version
pip list --format=freeze
- name: test
env:
TOXPYTHON: '${{ matrix.toxpython }}'
run: >
tox -e ${{ matrix.tox_env }} -v
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pre-commit

on: [push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
exclude: tests/fixtures
exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
hooks:
- id: ruff
args: [ --fix, --show-fixes ]
- id: ruff-format
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
hooks:
- id: doc8
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ Changelog
~~~~~~~~~~~~~~~~~~

- Nota Paulistana

15 changes: 9 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Bug reports
When `reporting a bug <https://github.com/erpbrasil/erpbrasil.edoc/issues>`_ please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Any details about your local setup that might be helpful
in troubleshooting.
* Detailed steps to reproduce the bug.

Documentation improvements
Expand All @@ -30,7 +31,8 @@ If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that code contributions are welcome :)
* Remember that this is a volunteer-driven project, and that code contributions
are welcome :)

Development
===========
Expand All @@ -49,7 +51,7 @@ To set up `erpbrasil.edoc` for local development:

Now you can make your changes locally.

4. When you're done making changes, run all the checks, doc builder and spell checker with `tox <https://tox.readthedocs.io/en/latest/install.html>`_ one command::
4. When you're done making changes, run all the checks, doc builder and spell checker with `tox <https://tox.wiki/en/latest/installation.html>`_ one command::

tox

Expand All @@ -64,7 +66,8 @@ To set up `erpbrasil.edoc` for local development:
Pull Request Guidelines
-----------------------

If you need some code review or feedback while you're developing the code just make the pull request.
If you need some code review or feedback while you're developing the code just
make the pull request.

For merging, you should:

Expand All @@ -73,8 +76,8 @@ For merging, you should:
3. Add a note to ``CHANGELOG.rst`` about the changes.
4. Add yourself to ``AUTHORS.rst``.

.. [1] If you don't have all the necessary python versions available locally you can rely on Travis - it will
`run the tests <https://travis-ci.org/erpbrasil/erpbrasil.edoc/pull_requests>`_ for each change you add in the pull request.
.. [1] If you don't have all the necessary python versions available locally, you can rely on GitHub Actions - it will
`run the tests <https://github.com/erpbrasil/erpbrasil.edoc/actions>`_ for each change you add in the pull request.
It will be slower though ...
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of

The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6 changes: 4 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ graft src
graft ci
graft tests

include .github/workflows/github-actions.yml
include .github/workflows/pre-commit.yml
include .pre-commit-config.yaml
include .bumpversion.cfg
include .coveragerc
include .cookiecutterrc
Expand All @@ -13,8 +16,7 @@ include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include README.rst

include tox.ini .travis.yml .appveyor.yml
include tox.ini

global-exclude *.py[cod] __pycache__/* *.so *.dylib

Expand Down
25 changes: 9 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,10 @@ Overview
:stub-columns: 1

* - tests
- | |travis| |appveyor|
| |codecov|
- |codecov|
* - package
- | |version| |wheel| |supported-versions| |supported-implementations|
| |commits-since|
.. |travis| image:: https://api.travis-ci.org/erpbrasil/erpbrasil.edoc.svg?branch=master
:alt: Travis-CI Build Status
:target: https://travis-ci.org/erpbrasil/erpbrasil.edoc

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/erpbrasil/erpbrasil.edoc?branch=master&svg=true
:alt: AppVeyor Build Status
:target: https://ci.appveyor.com/project/erpbrasil/erpbrasil.edoc
- |version| |wheel| |supported-versions| |supported-implementations|
|commits-since|

.. |codecov| image:: https://codecov.io/github/erpbrasil/erpbrasil.edoc/coverage.svg?branch=master
:alt: Coverage Status
Expand Down Expand Up @@ -49,7 +40,8 @@ Overview

.. end-badges
Emissão de documentos fiscais e outras obrigações (NF-E, NFS-E, MDF-E, CT-E, REINF, E-SOCIAL)
Emissão de documentos fiscais e outras obrigações
(NF-E, NFS-E, MDF-E, CT-E, REINF, E-SOCIAL)


Documentação
Expand All @@ -60,7 +52,7 @@ https://erpbrasil.github.io/
Créditos
========

Esta é uma biblioteca criada atravês do esforço de das empresas:
Esta é uma biblioteca criada através do esforço das empresas:

* Akretion https://akretion.com/pt-BR/
* KMEE https://www.kmee.com.br
Expand All @@ -77,10 +69,11 @@ Licença
Instalação
==========

Para permitir que a instalação do seu ERP cresça somente com a necessidade do cliente
é possível instalar as dependências da biblioteca de forma opcional:
Para permitir que a instalação do seu ERP cresça somente com a necessidade
do cliente é possível instalar as dependências da biblioteca de forma opcional:

::

pip install erpbrasil.edoc

# Documentos do Sefaz
Expand Down
Loading

0 comments on commit ea5c705

Please sign in to comment.