Skip to content

Commit

Permalink
fix: Additional tests, integration with isort and black, and testing …
Browse files Browse the repository at this point in the history
…triggers on the publish GitHub Action
  • Loading branch information
nguaman committed Dec 15, 2024
1 parent 7c5e5a2 commit 349398f
Show file tree
Hide file tree
Showing 10 changed files with 414 additions and 21 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Publish

on:
workflow_run:
workflows: ["Release"]
types:
- completed
release:
types: [published]

jobs:
pypi-publish:
Expand Down
3 changes: 2 additions & 1 deletion notebooks/tender_by_code.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
],
"source": [
"import licitpy\n",
"print(licitpy.__version__)\n"
"\n",
"print(licitpy.__version__)"
]
},
{
Expand Down
212 changes: 211 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ requests-cache = "^1.2.1"


[tool.poetry.group.dev.dependencies]
black = "^24.10.0"
black = {extras = ["jupyter"], version = "^24.10.0"}
isort = "^5.13.2"
pytest = "^8.3.3"
pytest-mock = "^3.14.0"
Expand Down
4 changes: 2 additions & 2 deletions src/licitpy/client/purchase_orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def from_date(
"""
Retrieves purchase orders from a specific date range.
"""

start_date, end_date = determine_date_range(start_date, end_date, time_range)

return self.source.get_monthly_purchase_orders(start_date, end_date)
Expand All @@ -30,5 +30,5 @@ def from_code(self, code: str) -> PurchaseOrder:
"""
Retrieves a purchase order by its code.
"""

return self.source.get_purchase_order(code)
2 changes: 1 addition & 1 deletion src/licitpy/client/tenders.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def from_date(
"""
Retrieves tenders from a specific date range.
"""

start_date, end_date = determine_date_range(start_date, end_date, time_range)

return self.source.get_monthly_tenders(start_date, end_date)
Expand Down
4 changes: 2 additions & 2 deletions src/licitpy/downloader/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_purchase_orders_from_csv(
"""
Gets a list of purchase orders from a given year and month.
"""

# Note about the commune:
# In the CSV file, the commune is linked to the column "CiudadUnidadCompra" (AO).
# Example in CSV format:
Expand Down Expand Up @@ -116,5 +116,5 @@ def get_purchase_orders(self, year: int, month: int) -> List[PurchaseOrderFromCS
Gets a list of purchase orders from a given year and month.
"""
purchase_orders = self.get_purchase_orders_from_csv(year, month)

return sorted(purchase_orders, key=lambda po: po.FechaEnvio, reverse=True)
Loading

0 comments on commit 349398f

Please sign in to comment.