-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (70 loc) · 2.33 KB
/
Copy pathtests.yml
File metadata and controls
74 lines (70 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
pruebas:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Instalar
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Pruebas con cobertura
run: pytest -q --cov --cov-report=term-missing
estilo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check .
instalacion-limpia:
# Lo que de verdad prueba "se descarga y funciona": instalar el paquete y
# usarlo DESDE OTRO DIRECTORIO, sin el codigo fuente al lado. Si faltara
# algo en el wheel -- el py.typed, el punto de entrada de la orden -- aqui
# se ve, y en la suite de arriba no, porque alli src/ esta presente.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Instalar el paquete construido
run: pip install .
- name: Usarlo desde fuera del repositorio
shell: bash
run: |
cd "$HOME"
facturae-es autocomprobar
facturae-es plantilla -o factura.json
facturae-es generar factura.json -o factura.xml
python -c "
import xml.etree.ElementTree as ET
NS = {'f': 'http://www.facturae.gob.es/formato/Versiones/Facturaev3_2_2.xml'}
raiz = ET.parse('factura.xml').getroot()
total = raiz.find('.//f:InvoiceTotal', NS).text
assert total == '1362.50', 'total inesperado: ' + total
print('XML generado y verificado fuera del repositorio, total', total)
"
python -c "
import facturae_es, pathlib, sys
p = pathlib.Path(facturae_es.__file__).parent / 'py.typed'
sys.exit(0 if p.exists() else 'falta py.typed en el paquete instalado')
"