Skip to content

Commit

Permalink
feat(constants): update URLs and add new service code
Browse files Browse the repository at this point in the history
- Update `URL_HM` constant to use the correct URL
- Add new service code `805` for "COLETIVO - RETRANSMISSÃO DE RÁDIO (RTR) NA AMAZÔNIA LEGAL"

fix(paths): update file paths in test cases
- Update file paths in `test_certificacao.py` to use `Path` objects instead of hardcoded strings

build(deps): update project dependencies
- Bump `fiscaliza` version to `1.0.2`
- Update `urllib3` to `2.2.2`
- Add new dependencies: `certifi`, `charset-normalizer`, `idna`, `packaging`

refactor(imports): update imports in test cases
- Update imports in `test_fiscaliza.py` to use the correct module path

feat(versioning): add version file
- Add `__version__` attribute to `src/fiscaliza/__init__.py`

refactor(file-structure): move files to `src/fiscaliza`
- Move `constants.py`, `datatypes.py`, `attrs.py`, and `main.py` to the `src/fiscaliza` directory
  • Loading branch information
ronaldokun committed Nov 14, 2024
1 parent 31597f4 commit 9ccb772
Show file tree
Hide file tree
Showing 12 changed files with 184 additions and 125 deletions.
1 change: 0 additions & 1 deletion fiscaliza/__init__.py

This file was deleted.

117 changes: 0 additions & 117 deletions fiscaliza/_modidx.py

This file was deleted.

24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[project]
name = "fiscaliza"
version = "1.0.2"
description = "Implementação de API python a instância do Redmine da Anatel: Fiscaliza"
readme = "README.md"
authors = [
{ name = "Ronaldo S.A. Batista", email = "[email protected]" }
]
requires-python = ">=3.11,<3.12"
dependencies = [
"certifi==2024.6.2",
"fastcore>=1.5.46",
"python-dotenv>=1.0.1",
"python-redmine==2.4.0",
"unidecode>=1.3.8",
"urllib3==2.2.2",
]

[project.scripts]
fiscaliza = "fiscaliza:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Python library ###
repo = fiscaliza
lib_name = %(repo)s
version = 1.0.1
version = 1.0.2
min_python = 3.11
license = apache2
black_formatting = False
Expand Down
1 change: 1 addition & 0 deletions src/fiscaliza/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
File renamed without changes.
15 changes: 12 additions & 3 deletions fiscaliza/constants.py → src/fiscaliza/constants.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_constants.ipynb.

# %% auto 0
__all__ = ['URL_PD', 'URL_PD_INTRA', 'URL_HM', 'STATUS', 'FLOW', 'STATES', 'SERVICOS', 'MUNICIPIOS']
__all__ = [
"URL_PD",
"URL_PD_INTRA",
"URL_HM",
"STATUS",
"FLOW",
"STATES",
"SERVICOS",
"MUNICIPIOS",
]

# %% ../nbs/01_constants.ipynb 2
URL_PD = "https://sistemas.anatel.gov.br/fiscaliza/"
URL_PD_INTRA = "https://sistemasnet/fiscaliza"
URL_HM = "https://sistemasnethm/fiscaliza"
URL_HM = "https://sistemasnethm.anatel.gov.br/fiscaliza"

STATUS = {
"Rascunho": 1,
Expand Down Expand Up @@ -154,6 +163,7 @@
"800": "800 - COLETIVO - RETRANSMISSAO DE T.V.",
"801": "801 - COLETIVO - RETRANSMISSÃO DE RADIODIFUSÃO DE SONS E IMAGENS - DIGITAL",
"802": "802 - COLETIVO - PLANO BÁSICO DE RADIODIFUSÃO DE SONS E IMAGENS - DIGITAL",
"805": "805 - COLETIVO - RETRANSMISSÃO DE RÁDIO (RTR) NA AMAZÔNIA LEGAL",
"810": "810 - COLETIVO - DISTRIBUICAO DE SINAIS DE TELEVISAO - DISTV",
"820": "820 - RESTRITO - DE TELEV. EM CIRCUITO FECHADO (RADIOENLACE)",
"900": "900 - COLETIVO - FUST",
Expand Down Expand Up @@ -5734,4 +5744,3 @@
"TO/Wanderlândia",
"TO/Xambioá",
]

File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions tests/test_certificacao.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import random
from random import randint
from pathlib import Path
from dotenv import load_dotenv
from fiscaliza.main import Fiscaliza
from fiscaliza.constants import MUNICIPIOS, SERVICOS
Expand Down Expand Up @@ -36,10 +37,10 @@
"gerar_plai": 1,
"tipo_do_processo_plai": random.choice(FIELDS["tipo_do_processo_plai"].options),
"coord_fi_plai": random.choice(FIELDS["coord_fi_plai"].options),
"html_path": "/mnt/c/Users/rsilva/code/fiscaliza/tests/Report_2024.02.18_T11.30.55_123456.html",
"html_path": Path(__file__).parent / "Report_2024.02.18_T11.30.55_123456.html",
"uploads": [
{
"path": "/mnt/c/Users/rsilva/code/fiscaliza/tests/Report_2024.02.18_T11.30.55_123456.json",
"path": Path(__file__).parent / "Report_2024.02.18_T11.30.55_123456.json",
"filename": "Info.json",
}
],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fiscaliza.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from redminelib import Redmine
from dotenv import load_dotenv

from main import Fiscaliza
from fiscaliza.main import Fiscaliza

load_dotenv(override=True)

Expand Down
Loading

0 comments on commit 9ccb772

Please sign in to comment.