Fix: Migración a pyproject.toml y poetry
- Reemplaza setup.py/setup.cfg por pyproject.toml (PEP 621) + poetry.lock - Dev dependencies en [tool.poetry.group.dev.dependencies] - Elimina requirements_dev.txt (deps dev en pyproject.toml) - Actualiza tox.ini, Makefile, Makefile.dev, Dockerfile y docs
This commit is contained in:
@@ -69,7 +69,7 @@ Ready to contribute? Here's how to set up `facho` for local development.
|
|||||||
$ python3 -mvenv facho-venv && source facho-venv/bin/activate
|
$ python3 -mvenv facho-venv && source facho-venv/bin/activate
|
||||||
$ cd facho/
|
$ cd facho/
|
||||||
$ pre-commit install
|
$ pre-commit install
|
||||||
$ python setup.py develop
|
$ pip install -e .
|
||||||
|
|
||||||
4. Create a branch for local development::
|
4. Create a branch for local development::
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ Ready to contribute? Here's how to set up `facho` for local development.
|
|||||||
tests, including testing other Python versions with tox::
|
tests, including testing other Python versions with tox::
|
||||||
|
|
||||||
$ flake8 facho tests
|
$ flake8 facho tests
|
||||||
$ python setup.py test or py.test
|
$ py.test
|
||||||
$ tox
|
$ tox
|
||||||
|
|
||||||
To get flake8 and tox, just pip install them into your virtualenv.
|
To get flake8 and tox, just pip install them into your virtualenv.
|
||||||
@@ -97,10 +97,10 @@ Ready to contribute? Here's how to set up `facho` for local development.
|
|||||||
Using docker
|
Using docker
|
||||||
------------
|
------------
|
||||||
|
|
||||||
1. make -f Makefile.dev build
|
1. make -f Makefile.dev dev-setup
|
||||||
2. make -f Makefile.dev dev-shell
|
2. make -f Makefile.dev dev-shell
|
||||||
3. make -f Makefile.dev python3.8 setup.py develop
|
3. make -f Makefile.dev test
|
||||||
4. make -f Makefile.dev python3.8 setup.py test
|
4. make -f Makefile.dev tox
|
||||||
|
|
||||||
Pull Request Guidelines
|
Pull Request Guidelines
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|||||||
@@ -44,3 +44,8 @@ RUN pip3.12 install setuptools setuptools-rust --break-system-packages
|
|||||||
RUN pip3.13 install setuptools setuptools-rust --break-system-packages
|
RUN pip3.13 install setuptools setuptools-rust --break-system-packages
|
||||||
|
|
||||||
RUN pip3 install tox pytest --break-system-packages
|
RUN pip3 install tox pytest --break-system-packages
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY pyproject.toml README.rst ./
|
||||||
|
COPY facho ./facho
|
||||||
|
RUN pip3.13 install -e . --break-system-packages
|
||||||
|
|||||||
5
Makefile
5
Makefile
@@ -80,9 +80,8 @@ release: dist ## package and upload a release
|
|||||||
twine upload dist/*
|
twine upload dist/*
|
||||||
|
|
||||||
dist: clean ## builds source and wheel package
|
dist: clean ## builds source and wheel package
|
||||||
python setup.py sdist
|
python -m build
|
||||||
python setup.py bdist_wheel
|
|
||||||
ls -l dist
|
ls -l dist
|
||||||
|
|
||||||
install: clean ## install the package to the active Python's site-packages
|
install: clean ## install the package to the active Python's site-packages
|
||||||
python setup.py install
|
pip install .
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ dev-shell:
|
|||||||
docker run --rm -ti -v "$(PWD):/app" -w /app --name facho-cli facho bash
|
docker run --rm -ti -v "$(PWD):/app" -w /app --name facho-cli facho bash
|
||||||
|
|
||||||
test:
|
test:
|
||||||
docker run -t -v $(PWD):/app -w /app facho sh -c 'cd /app; python3.13 -m pytest'
|
docker run -t -v $(PWD):/app -w /app facho sh -c 'cd /app; python3.13 -m pytest -vv'
|
||||||
|
|
||||||
tox:
|
tox:
|
||||||
docker run -it -v $(PWD)/:/app -w /app facho tox
|
docker run -it -v $(PWD)/:/app -w /app facho tox
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ Once you have a copy of the source, you can install it with:
|
|||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ python setup.py install
|
$ pip install .
|
||||||
|
|
||||||
|
|
||||||
.. _Github repo: https://github.com/bit4bit/facho
|
.. _Github repo: https://github.com/bit4bit/facho
|
||||||
|
|||||||
1499
poetry.lock
generated
Normal file
1499
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
79
pyproject.toml
Normal file
79
pyproject.toml
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
[build-system]
|
||||||
|
requires = ["setuptools>=68", "wheel"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "facho"
|
||||||
|
version = "0.1.0"
|
||||||
|
description = "Facturacion Electronica Colombia"
|
||||||
|
readme = "README.rst"
|
||||||
|
license = { text = "GPL-3.0-or-later" }
|
||||||
|
authors = [
|
||||||
|
{ name = "Jovany Leandro G.C", email = "bit4bit@riseup.net" },
|
||||||
|
]
|
||||||
|
keywords = ["facho"]
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 2 - Pre-Alpha",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
|
||||||
|
"Natural Language :: English",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
|
]
|
||||||
|
requires-python = ">=3.10"
|
||||||
|
dependencies = [
|
||||||
|
"Click>=8.1.7",
|
||||||
|
"zeep>=4.2.1",
|
||||||
|
"lxml>=5.2.2",
|
||||||
|
"cryptography>=41.0.0",
|
||||||
|
"pyOpenSSL>=23.2.0",
|
||||||
|
"xmlsig>=0.1.9",
|
||||||
|
"xades>=1.0.0",
|
||||||
|
"xmlsec>=1.3.12",
|
||||||
|
"python-dateutil>=2.9.0",
|
||||||
|
# usamos esta dependencia en runtime
|
||||||
|
# para forzar uso de policy_id de archivo local
|
||||||
|
"mock>=5.1.0",
|
||||||
|
"xmlschema>=3.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
facho = "facho.cli:main"
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Repository = "https://github.com/bit4bit/facho"
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
build = ">=1.2.2"
|
||||||
|
coverage = ">=7.8.0"
|
||||||
|
flake8 = ">=7.0.0"
|
||||||
|
pytest = ">=9.1.1,<10.0.0"
|
||||||
|
tox = ">=4.23.2"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
packages = { find = { exclude = ["tests*"] } }
|
||||||
|
|
||||||
|
[tool.setuptools.package-data]
|
||||||
|
"*" = ["*.gc", "*.xsd", "politicadefirmav2.pdf"]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
testpaths = ["tests"]
|
||||||
|
|
||||||
|
[tool.bumpversion]
|
||||||
|
current_version = "0.1.0"
|
||||||
|
commit = true
|
||||||
|
tag = true
|
||||||
|
|
||||||
|
[[tool.bumpversion.files]]
|
||||||
|
filename = "pyproject.toml"
|
||||||
|
search = 'version = "{current_version}"'
|
||||||
|
replace = 'version = "{new_version}"'
|
||||||
|
|
||||||
|
[[tool.bumpversion.files]]
|
||||||
|
filename = "facho/__init__.py"
|
||||||
|
search = "__version__ = '{current_version}'"
|
||||||
|
replace = "__version__ = '{new_version}'"
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
attrs==24.2.0
|
|
||||||
distlib==0.3.9
|
|
||||||
filelock==3.16.1
|
|
||||||
iniconfig==2.0.0
|
|
||||||
packaging==24.1
|
|
||||||
platformdirs==4.3.6
|
|
||||||
pluggy==1.5.0
|
|
||||||
pyparsing==3.2.0
|
|
||||||
pytest==8.3.4
|
|
||||||
semantic-version==2.10.0
|
|
||||||
setuptools-rust==1.10.2
|
|
||||||
six==1.16.0
|
|
||||||
tomli==2.2.1
|
|
||||||
tox==4.23.2
|
|
||||||
virtualenv==20.28.0
|
|
||||||
25
setup.cfg
25
setup.cfg
@@ -1,25 +0,0 @@
|
|||||||
[bumpversion]
|
|
||||||
current_version = 0.1.0
|
|
||||||
commit = True
|
|
||||||
tag = True
|
|
||||||
|
|
||||||
[bumpversion:file:setup.py]
|
|
||||||
search = version='{current_version}'
|
|
||||||
replace = version='{new_version}'
|
|
||||||
|
|
||||||
[bumpversion:file:facho/__init__.py]
|
|
||||||
search = __version__ = '{current_version}'
|
|
||||||
replace = __version__ = '{new_version}'
|
|
||||||
|
|
||||||
[bdist_wheel]
|
|
||||||
universal = 1
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
exclude = docs
|
|
||||||
|
|
||||||
[aliases]
|
|
||||||
# Define setup.py command aliases here
|
|
||||||
test = pytest
|
|
||||||
|
|
||||||
[tool:pytest]
|
|
||||||
addopts = --ignore=setup.py
|
|
||||||
89
setup.py
89
setup.py
@@ -1,89 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# This file is part of facho. The COPYRIGHT file at the top level of
|
|
||||||
# this repository contains the full copyright notices and license terms.
|
|
||||||
|
|
||||||
"""The setup script."""
|
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
|
|
||||||
with open('README.rst') as readme_file:
|
|
||||||
readme = readme_file.read()
|
|
||||||
|
|
||||||
with open('HISTORY.rst') as history_file:
|
|
||||||
history = history_file.read()
|
|
||||||
|
|
||||||
requirements = ['Click>=8.1.7',
|
|
||||||
'zeep>=4.2.1',
|
|
||||||
'lxml>=5.2.2',
|
|
||||||
'cryptography>=41.0.0',
|
|
||||||
'pyOpenSSL>=23.2.0',
|
|
||||||
'xmlsig>=0.1.9',
|
|
||||||
'xades>=1.0.0',
|
|
||||||
'xmlsec>=1.3.12',
|
|
||||||
'python-dateutil>=2.9.0',
|
|
||||||
# usamos esta dependencia en runtime
|
|
||||||
# para forzar uso de policy_id de archivo local
|
|
||||||
'mock>=5.1.0',
|
|
||||||
'xmlschema>=3.0.0']
|
|
||||||
|
|
||||||
"""
|
|
||||||
Listado de Versiones Anteriores
|
|
||||||
requirements = ['Click>=6.0',
|
|
||||||
'zeep==4.0.0',
|
|
||||||
'lxml==4.6.3',
|
|
||||||
'cryptography==3.3.2',
|
|
||||||
'pyOpenSSL==20.0.1',
|
|
||||||
'xmlsig==0.1.7',
|
|
||||||
'xades==0.2.2',
|
|
||||||
'xmlsec==1.3.12',
|
|
||||||
# usamos esta dependencia en runtime
|
|
||||||
# para forzar uso de policy_id de archivo local
|
|
||||||
'mock>=2.0.0',
|
|
||||||
'xmlschema>=1.8']
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
setup_requirements = ['pytest-runner', ]
|
|
||||||
|
|
||||||
test_requirements = ['pytest', ]
|
|
||||||
|
|
||||||
setup(
|
|
||||||
author="Jovany Leandro G.C",
|
|
||||||
author_email='bit4bit@riseup.net',
|
|
||||||
classifiers=[
|
|
||||||
'Development Status :: 2 - Pre-Alpha',
|
|
||||||
'Intended Audience :: Developers',
|
|
||||||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
|
|
||||||
'Natural Language :: English',
|
|
||||||
'Programming Language :: Python :: 3',
|
|
||||||
'Programming Language :: Python :: 3.10',
|
|
||||||
'Programming Language :: Python :: 3.11',
|
|
||||||
'Programming Language :: Python :: 3.12',
|
|
||||||
'Programming Language :: Python :: 3.13',
|
|
||||||
],
|
|
||||||
description="Facturacion Electronica Colombia",
|
|
||||||
entry_points={
|
|
||||||
'console_scripts': [
|
|
||||||
'facho=facho.cli:main',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
install_requires=requirements,
|
|
||||||
license="GNU General Public License v3",
|
|
||||||
long_description=readme + '\n\n' + history,
|
|
||||||
long_description_content_type='text/x-rst',
|
|
||||||
include_package_data=True,
|
|
||||||
package_data = {
|
|
||||||
# If any package contains *.txt or *.rst files, include them:
|
|
||||||
'': ['*.gc', '*.xsd', 'politicadefirmav2.pdf']
|
|
||||||
},
|
|
||||||
keywords='facho',
|
|
||||||
name='facho',
|
|
||||||
packages=find_packages(exclude=("tests",)),
|
|
||||||
setup_requires=setup_requirements,
|
|
||||||
test_suite='tests',
|
|
||||||
tests_require=test_requirements,
|
|
||||||
url='https://github.com/bit4bit/facho',
|
|
||||||
version='0.2.0',
|
|
||||||
zip_safe=False,
|
|
||||||
)
|
|
||||||
23
tox.ini
23
tox.ini
@@ -1,27 +1,18 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py39, py310, py311, py312, py313, flake8
|
envlist = py310, py311, py312, py313, flake8
|
||||||
|
|
||||||
[travis]
|
[flake8]
|
||||||
python =
|
exclude = docs, build, venv, .tox, .git, .pytest_cache, *.egg-info
|
||||||
3.9: py39
|
|
||||||
3.10: py310
|
|
||||||
3.11: py311
|
|
||||||
3.12: py312
|
|
||||||
3.13: py313
|
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
basepython = python
|
basepython = python3.13
|
||||||
deps = flake8
|
deps = flake8>=7.0.0
|
||||||
commands = flake8 facho
|
commands = flake8 facho tests examples
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONPATH = {toxinidir}
|
PYTHONPATH = {toxinidir}
|
||||||
deps =
|
deps = pytest>=9.1.1,<10.0.0
|
||||||
-r{toxinidir}/requirements_dev.txt
|
|
||||||
; If you want to make tox run the tests with the same versions, create a
|
|
||||||
; requirements.txt with the pinned versions and uncomment the following line:
|
|
||||||
; -r{toxinidir}/requirements.txt
|
|
||||||
commands =
|
commands =
|
||||||
pip install -U pip
|
pip install -U pip
|
||||||
py.test --basetemp={envtmpdir}
|
py.test --basetemp={envtmpdir}
|
||||||
|
|||||||
Reference in New Issue
Block a user