Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] Library pattern and standards #23

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d36668c
Merge pull request #8 from akretion/FIX-gramatica_formatacao_texto
rvalyi Mar 17, 2018
2765a09
examplo real, importando uma nota processada
rvalyi Mar 20, 2018
8b3223a
better .gitignore for tests
rvalyi Mar 15, 2019
d305281
added basic input/output tests
rvalyi Mar 15, 2019
49c543e
.gitignore for tests
rvalyi Mar 15, 2019
bd6c689
subclass leiauteNFe for root tag and tag prefix
rvalyi Mar 15, 2019
ffba871
setup.py for Python 2.7 and 3.4+
rvalyi Mar 15, 2019
656a755
Travis CI attempt
rvalyi Mar 15, 2019
1a78fbf
Travis CI
rvalyi Mar 15, 2019
9ea47a9
attempt for README in Markdown
rvalyi Mar 15, 2019
be6612d
proper setup.py
rvalyi Mar 15, 2019
9bcd0a9
Update README.md
rvalyi Mar 15, 2019
974780c
make subclass export usable on any stream
rvalyi Mar 15, 2019
3cb4f2d
simplify in/out test
rvalyi Mar 15, 2019
dd62878
Update README.md
rvalyi Mar 15, 2019
a5fa3b2
better tests + inut
rvalyi Apr 20, 2019
e1fa2e4
travis fix
rvalyi Apr 20, 2019
9178454
documented generation light process
rvalyi Sep 29, 2020
ad2b89f
README
rvalyi Sep 29, 2020
3c2bbb1
drop EOL Python 2.7 support at neflib 0.3
rvalyi Sep 29, 2020
34c0bb9
leiauteNFe_sub fix now that retEnviNFe is used
rvalyi Sep 30, 2020
28196f5
v0.4: Pacote de Liberação Distribuição de DF-e v1.00
rvalyi Sep 30, 2020
c8f0a92
Pacote de Liberação Distribuição de DF-e v1.02
rvalyi Sep 30, 2020
1220b6e
Pacote de Liberação Evento Generico v1.01 (Atualizado em 30/05/2014)
rvalyi Oct 1, 2020
b9cf1b8
Pacote de Liberação Evento Canc v1.01 (30/05/2014)
rvalyi Oct 1, 2020
ed87ccf
IMPORTANT: geracao pacote por pacote para evitar override nos tipos b…
rvalyi Oct 1, 2020
c91413d
Pacote de Liberação Evento CCe v1.01 (30/05/2014)
rvalyi Oct 1, 2020
539ae98
Pacote de Liberação Evento Manifesta Destinatário v1.01 (30/05/2014)
rvalyi Oct 1, 2020
71ca61d
[IMP] Library pattern and standards
mileo Nov 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
version: '{branch}-{build}'
build: off
image: Visual Studio 2019
branches:
except:
- master

environment:
matrix:
- TOXENV: check
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- TOXENV: py36
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- TOXENV: py36
TOXPYTHON: C:\Python36-x64\python.exe
PYTHON_HOME: C:\Python36-x64
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '64'
- TOXENV: py37
TOXPYTHON: C:\Python37\python.exe
PYTHON_HOME: C:\Python37
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '32'
- TOXENV: py37
TOXPYTHON: C:\Python37-x64\python.exe
PYTHON_HOME: C:\Python37-x64
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
- TOXENV: py38
TOXPYTHON: C:\Python38\python.exe
PYTHON_HOME: C:\Python38
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '32'
- TOXENV: py38
TOXPYTHON: C:\Python38-x64\python.exe
PYTHON_HOME: C:\Python38-x64
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'
- TOXENV: py39
TOXPYTHON: C:\Python39\python.exe
PYTHON_HOME: C:\Python39
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '32'
- TOXENV: py39
TOXPYTHON: C:\Python39-x64\python.exe
PYTHON_HOME: C:\Python39-x64
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '64'
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
- '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt'
- '%PYTHON_HOME%\Scripts\virtualenv --version'
- '%PYTHON_HOME%\Scripts\easy_install --version'
- '%PYTHON_HOME%\Scripts\pip --version'
- '%PYTHON_HOME%\Scripts\tox --version'
test_script:
- cmd /E:ON /V:ON /C .\ci\appveyor-with-compiler.cmd %PYTHON_HOME%\Scripts\tox
on_failure:
- ps: dir "env:"
- ps: get-content .tox\*\log\*

### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
20 changes: 20 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[bumpversion]
current_version = 0.5
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:README.rst]
search = v{current_version}.
replace = v{new_version}.

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:nfelib/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[paths]
source =
src
*/site-packages

[run]
branch = true
source =
nfelib
tests
parallel = true

[report]
show_missing = true
precision = 2
omit = *migrations*
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# see https://editorconfig.org/
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8

[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml}]
indent_size = 2
76 changes: 74 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,74 @@
led python files
*.py[co]
*.py[cod]
__pycache__

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
wheelhouse
develop-eggs
.installed.cfg
lib
lib64
venv*/
pyvenv*/
pip-wheel-metadata/

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
.coverage.*
.pytest_cache/
nosetests.xml
coverage.xml
htmlcov

# Translations
*.mo

# Buildout
.mr.developer.cfg

# IDE project files
.project
.pydevproject
.idea
.vscode
*.iml
*.komodoproject

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

.DS_Store
*~
.*.sw[po]
.build
.ve
.env
.cache
.pytest
.benchmarks
.bootstrap
.appveyor.token
*.bak

# Mypy Cache
.mypy_cache/
58 changes: 58 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
language: python
dist: xenial
virt: lxd
cache: false
branches:
except:
- master

env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
- SEGFAULT_SIGNALS=all
- LANG=en_US.UTF-8
matrix:
include:
- python: '3.8'
env:
- TOXENV=check
- python: '3.8'
env:
- TOXENV=docs
- env:
- TOXENV=py35,codecov
python: '3.5'
- env:
- TOXENV=py36,codecov
python: '3.6'
- env:
- TOXENV=py37,codecov
python: '3.7'
- env:
- TOXENV=py38,codecov
python: '3.8'
- env:
- TOXENV=py39,codecov
python: '3.9'
- env:
- TOXENV=pypy3,codecov
python: 'pypy3'
before_install:
- python --version
- uname -a
- lsb_release -a || true
install:
- python -mpip install --progress-bar=off tox -rci/requirements.txt
- virtualenv --version
- easy_install --version
- pip --version
- tox --version
script:
- tox -v
after_failure:
- cat .tox/log/*
- cat .tox/*/log/*
notifications:
email:
on_success: never
on_failure: always
6 changes: 6 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Authors
=======

* `Akretion <https://akretion.com/pt-BR>`__:

* Raphael Valyi <[email protected]>
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

Changelog
=========

0.1.0 (2020-11-08)
~~~~~~~~~~~~~~~~~~

* First release on PyPI.
90 changes: 90 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

Bug reports
===========

When `reporting a bug <https://github.com/erpbrasil/nfselib.ginfes/issues>`_ please include:

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

Documentation improvements
==========================

nfselib.ginfes could always use more documentation, whether as part of the
official nfselib.ginfes docs, in docstrings, or even on the web in blog posts,
articles, and such.

Feature requests and feedback
=============================

The best way to send feedback is to file an issue at https://github.com/erpbrasil/nfselib.ginfes/issues.

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 :)

Development
===========

To set up `nfselib.ginfes` for local development:

1. Fork `nfselib.ginfes <https://github.com/erpbrasil/nfselib.ginfes>`_
(look for the "Fork" button).
2. Clone your fork locally::

git clone [email protected]:YOURGITHUBNAME/nfselib.ginfes.git

3. Create a branch for local development::

git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

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

tox

5. Commit your changes and push your branch to GitHub::

git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature

6. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------

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

For merging, you should:

1. Include passing tests (run ``tox``) [1]_.
2. Update documentation when there's new API, functionality etc.
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/nfselib.ginfes/pull_requests>`_ for each change you add in the pull request.

It will be slower though ...

Tips
----

To run a subset of tests::

tox -e envname -- pytest -k test_myfeature

To run all the test environments in *parallel*::

tox -p auto
File renamed without changes.
Loading