-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from akretion/format
Format + clean tests + pyproject
- Loading branch information
Showing
14 changed files
with
307 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/nfelib | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,4 +69,4 @@ docs/_build/ | |
|
||
# Backup files | ||
*~ | ||
*.swp | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,38 @@ | ||
exclude: | | ||
(?x) | ||
setup.cfg| | ||
^tests| | ||
repos: | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.10.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py37-plus] | ||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v2.4.0 | ||
hooks: | ||
- id: reorder-python-imports | ||
- repo: https://github.com/ambv/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.9.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [ | ||
flake8-bugbear, | ||
flake8-annotations, | ||
flake8-comprehensions, | ||
] | ||
args: ["--suppress-none-returning"] | ||
^README\.md$ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: debug-statements | ||
- repo: [email protected]:humitos/mirrors-docformatter.git | ||
rev: v1.0 | ||
hooks: | ||
- id: docformatter | ||
args: ["--in-place", "--pre-summary-newline"] | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.22.9 | ||
hooks: | ||
- id: typos | ||
exclude: ^tests/|.xsd$ | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.5.0 | ||
hooks: | ||
- id: ruff | ||
args: [ --fix, --show-fixes] | ||
- id: ruff-format | ||
exclude: ^nfelib/[^/]+\.py$ | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.812 | ||
rev: v1.10.1 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [tokenize-rt] | ||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: v1.17.0 | ||
hooks: | ||
- id: setup-cfg-fmt | ||
args: ["--max-py-version=3.9"] | ||
- repo: https://github.com/PyCQA/doc8 | ||
rev: 0.9.0a1 | ||
hooks: | ||
- id: doc8 | ||
files: ^(nfelib/) | ||
args: [ "--check-untyped-defs", "--ignore-missing-imports" ] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v4.0.0-alpha.8 | ||
hooks: | ||
- id: prettier | ||
additional_dependencies: | ||
- [email protected] | ||
types_or: [markdown] | ||
args: [--prose-wrap=always, --print-width=88] | ||
exclude: ^nfelib/[^/]+\.xml$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
[build-system] | ||
requires = ["setuptools>=61.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["nfelib*"] | ||
|
||
[project] | ||
name = "nfelib" | ||
description = "nfelib: electronic invoicing library for Brazil" | ||
authors = [{name = "Raphaël Valyi", email = "[email protected]"}] | ||
license = {text = "MIT"} | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
keywords = ["e-invoicing", "ERP", "Odoo", "NFe", "CTe", "MDFe", "BPe", "NFSe"] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"xsdata", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/akretion/nfelib" | ||
Source = "https://github.com/akretion/nfelib" | ||
Documentation = "https://nfelib.readthedocs.io/" | ||
Changelog = "https://nfelib.readthedocs.io/en/latest/changelog/" | ||
|
||
[project.optional-dependencies] | ||
sign = [ | ||
"erpbrasil.assinatura", | ||
] | ||
pdf = [ | ||
"brazilfiscalreport", | ||
] | ||
test = [ | ||
"pre-commit", | ||
"pytest", | ||
"pytest-benchmark", | ||
"pytest-cov", | ||
"xmldiff", | ||
"requests", | ||
"beautifulsoup4", | ||
"erpbrasil.assinatura", | ||
"brazilfiscalreport", | ||
] | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
license-files = ["MIT-LICENSE"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = {attr = "nfelib.__version__"} | ||
|
||
[tool.ruff] | ||
target-version = "py38" | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
# pycodestyle | ||
"E", | ||
# Pyflakes | ||
"F", | ||
# pyupgrade | ||
"UP", | ||
# flake8-bugbear | ||
"B", | ||
# flake8-simplify | ||
"SIM", | ||
# flake8-annotations | ||
"ANN", | ||
# flake8-comprehensions | ||
"C4", | ||
# isort | ||
"I", | ||
# pydocstyle | ||
"D", | ||
# flake-raise | ||
"RSE", | ||
# flake-return | ||
"RET", | ||
# Ruff rules | ||
"RUF", | ||
] | ||
|
||
ignore = [ | ||
"ANN101", | ||
"ANN102", | ||
"ANN201", | ||
"ANN202", | ||
"ANN204", | ||
"ANN206", | ||
"ANN401", | ||
"E203", | ||
"B028", | ||
"B904", | ||
"D100", | ||
"D104", | ||
"D107", | ||
"RUF009", | ||
"RUF012", | ||
] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"**/{tests}/*" = ["ANN001", "ANN002", "ANN003", "E501", "B018", "D"] | ||
"**/utils/testing.py" = ["D"] | ||
"docs/*" = ["D"] | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" | ||
|
||
[tool.ruff.format] | ||
line-ending = "lf" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--color=yes" | ||
doctest_optionflags = "NORMALIZE_WHITESPACE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.