You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace Poetry with uv for dependency management and build tooling:
- Rewrite pyproject.toml with PEP 621 project table and PEP 735 dependency-groups
- Switch build backend from poetry-core to hatchling
- Update CI workflows to use astral-sh/setup-uv action
- Update CLAUDE.md with uv commands
- Delete poetry.lock, requirements.txt, docs/requirements.txt
- Add .coverage, coverage.xml, .mypy_cache, *.pyc, .ipynb_checkpoints to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,41 +8,41 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
8
8
9
9
## Python Environment
10
10
11
-
**This project uses Poetry exclusively.** All Python commands must be run via `poetry run` or inside `poetry shell`. Never invoke `python`, `pytest`, `black`, or any other Python tool directly.
11
+
**This project uses uv exclusively.** All Python commands must be run via `uv run`. Never invoke `python`, `pytest`, `black`, or any other Python tool directly.
12
12
13
13
```bash
14
-
poetry run python ...
15
-
poetry run pytest ...
16
-
poetry run black ...
14
+
uv run python ...
15
+
uv run pytest ...
16
+
uv run black ...
17
17
```
18
18
19
19
## Commands
20
20
21
21
### Setup
22
22
```bash
23
-
pip install poetry
24
-
poetry install# install all dependency groups
25
-
poetry install --withtest# install with test dependencies only
23
+
curl -LsSf https://astral.sh/uv/install.sh | sh # install uv
24
+
uv sync # install all dependency groups
25
+
uv sync --grouptest# install with test dependencies only
26
26
```
27
27
28
28
### Running Tests
29
29
```bash
30
-
poetry run pytest # run all tests
31
-
poetry run pytest tests/test_utils.py # run a single test file
32
-
poetry run pytest tests/test_currency.py::test_currency_id # run a single test
30
+
uv run pytest # run all tests
31
+
uv run pytest tests/test_utils.py # run a single test file
32
+
uv run pytest tests/test_currency.py::test_currency_id # run a single test
33
33
```
34
34
35
35
Note: Many tests make live HTTP requests to BCB APIs. Tests marked with `@mark.flaky` may fail intermittently due to network issues or API availability.
36
36
37
37
### Linting / Formatting
38
38
```bash
39
-
poetry run pycodestyle bcb/ # lint with pycodestyle
40
-
poetry run black bcb/ # format with black
39
+
uv run pycodestyle bcb/ # lint with pycodestyle
40
+
uv run black bcb/ # format with black
41
41
```
42
42
43
43
### Docs
44
44
```bash
45
-
cd docs &&make html SPHINXBUILD="poetry run sphinx-build"
45
+
cd docs &&uv run sphinx-build -b html . _build/html
46
46
```
47
47
48
48
## Architecture
@@ -56,9 +56,9 @@ Fetches time series from the BCB's SGS (Sistema Gerenciador de Séries Temporais
56
56
-`bcb/sgs/regional_economy.py` — wrapper for regional non-performing loan series with pre-mapped SGS codes by state/region
57
57
58
58
### `bcb.currency` — Currency Exchange Rates
59
-
Scrapes the BCB PTAX website for daily bid/ask exchange rates. Uses `requests` + `lxml` for HTML parsing.
59
+
Scrapes the BCB PTAX website for daily bid/ask exchange rates. Uses `httpx` + `lxml` for HTML parsing.
60
60
61
-
-`bcb/currency.py` — `get(symbols, start, end, side, groupby)` returns multi-indexed DataFrames. Module-level `CACHE` dict avoids redundant HTTP requests within a session.
61
+
-`bcb/currency.py` — `get(symbols, start, end, side, groupby)` returns multi-indexed DataFrames. Module-level `_CACHE` dict avoids redundant HTTP requests within a session.
62
62
63
63
### `bcb.odata` — OData APIs
64
64
A generic OData client plus named wrappers for specific BCB OData services (hosted at `olinda.bcb.gov.br`).
@@ -76,5 +76,5 @@ A generic OData client plus named wrappers for specific BCB OData services (host
76
76
77
77
-**OData query building**: `api.get_endpoint("EntityName")` returns an `Endpoint`. Call `.get(Property >= value, limit=100)` for one-shot queries, or `.query()` for a chainable `EndpointQuery`.
78
78
-**`ODataAPI` for unlisted services**: Pass any valid OData URL directly to `ODataAPI(url)` to access BCB APIs not yet wrapped.
79
-
-**All network calls** use either `requests` (SGS, currency) or `httpx` (OData). The OData metadata fetch happens lazily on first `BaseODataAPI` instantiation.
79
+
-**All network calls** use `httpx` (sync) with `follow_redirects=True`. The OData metadata fetch happens lazily on first `BaseODataAPI` instantiation.
80
80
-**`@mark.flaky`**: flaky tests use the `flaky` library with `max_runs` retries to handle transient API failures.
0 commit comments