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

use UV tooling #13

Merged
merged 7 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 0 additions & 10 deletions .bumpversion.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

17 changes: 6 additions & 11 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

strategy:
matrix:
Expand All @@ -23,19 +26,11 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install build tools
run: >-
python -m
pip install
--upgrade
setuptools wheel
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Build and wheel
run: >-
python
setup.py
sdist
bdist_wheel
run: uvx --from build pyproject-build --installer uv

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r requirements-dev.txt

- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Test with pytest
run: python -m pytest tests
run: uv run pytest tests

mypy:
name: Type check code
Expand All @@ -48,14 +47,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
python -m pip install .
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Type check code
run: |
python -m mypy src
run: uv run mypy src
- name: Type check tests
run: |
python -m mypy tests
run: uv run mypy tests
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,24 @@ La opción `--help` imprime la ayuda de cada comando en la pantalla.

Tener presente que no se está realizando la verificación de certificados del servidor de XM **neptuno.xm.com.co** al consultar las versiones de liquidación publicadas usando el comando **asic pubs**.

## Tidy data

Los *datos prolijos* ("tidy data" en inglés) son una forma estándar de relacionar el significado de un conjunto de datos a su estructura.
Un conjunto de datos está prolijo o desprolijo dependiendo de cómo se relacionan las filas, columnas y tablas con las observaciones, las variables y los tipos.

En *datos prolijos*:

1. Cada variable es una columna; cada columna es una variable.

1. Cada observación es una fila; cada fila es una observación.

1. Cada valor es una celda; cada celda es un valor único.

Mas detalles en el articulo original [Tidy data][tidy-data]

Esta es la tercera forma normal de Codd, pero con las restricciones enmarcadas en el lenguaje estadístico y el enfoque puesto en un único conjunto de datos en lugar de los muchos conjuntos de datos conectados comunes en las bases de datos relacionales.
Los *datos desprolijos* son cualquier otra disposición de los datos.

[tidy-data]: <http://www.jstatsoft.org/v59/i10/> "Hadley Wickham (2014). Tidy data. The Journal of Statistical Software, 59."

## Contribuir
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[project]
name = "asic"
dynamic = ["version"]
description = "Download and format ASIC files"
license = { file = "LICENSE" }
readme = "README.md"
requires-python = ">=3.10"
Homepage = "https://github.com/enerBit/asic"
Repository = "https://github.com/enerBit/asic.git"
authors = [{ name = "enerBit", email = "jtamayoh@gmail.com" }]
keywords = [
"asic",
"xm",
"colombia",
"mem",
"ftp",
"development",
"integration",
"expertos",
"mercado",
"energia",
"mayorista",
]
dependencies = [
"requests",
"html5lib",
"beautifulsoup4",
"pytz",
"pandas",
"pydantic",
"typer",
]
[project.scripts]
asic = "asic.cli:cli"

[tool.uv]
dev-dependencies = [
"mypy",
"pytest",
"pytest",
"pytest-datafiles",
"types-setuptools",
"types-requests",
"pandas-stubs",
"build",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/asic/VERSION"
pattern = "^(?P<version>.+)$"

[tool.hatch.build.targets.wheel]
packages = ["src/asic"]

[tool.hatch.build.targets.sdist]
packages = ["src/asic"]
include = ["/tests"]

[tool.pytest.ini_options]
pythonpath = "src"
testpaths = ["tests"]
addopts = ["--import-mode=importlib"]

[tool.ruff]
line-length = 119
# max-complexity = 18
indent-width = 4

[tool.ruff.lint]
select = ["B", "C", "E", "F", "W", "B9", "I"]
ignore = ["E501"]

[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
# Whitelisted default arguments
"fastapi.Header",
"fastapi.Depends",
"typer.Option",
"typer.Argument",
]
10 changes: 0 additions & 10 deletions requirements-dev.txt

This file was deleted.

Loading
Loading