Repository navigation
build: adopt uv workspace for credit + investing (#182) #187
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
db74fd1
build: adopt uv workspace for credit and investing
cursoragent 44acee7
docs: record Poetry to uv ADR and replace Poetry refs
cursoragent 0c75e56
fix(investing): isolate MLflow tracking from /workspaces leftovers
cursoragent 82e47a9
docs(agents): prefer fixing MLflow URI over rm mlruns
cursoragent 91a293d
build: freeze uv sync in make install for CI
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| --- | ||
| description: Python 3.11 and uv workspace conventions | ||
| globs: **/*.py | ||
| alwaysApply: false | ||
| --- | ||
|
|
||
| # Python and uv | ||
|
|
||
| - Runtime: **Python 3.11+** via uv (`pyproject.toml` workspace + `uv.lock`). | ||
| - Install: `uv sync --group dev` or `make install`. | ||
| - Run scripts: `uv run <script>` or `uv run python ...` | ||
| - Add dependencies on the owning member (`credit/pyproject.toml` or `investing/pyproject.toml`), then `uv lock` / `uv sync`. Do not pip-install into the global env. | ||
|
|
||
| ## Style | ||
|
|
||
| - Prefer type hints on public functions. | ||
| - Short English docstrings for non-obvious business logic. | ||
| - Match existing module style when extending code. | ||
|
|
||
| ## Libraries | ||
|
|
||
| Use dependencies declared in the relevant member `pyproject.toml` (pandas, yfinance, etc.) as directed by the **feature spec**, not by default habit. | ||
|
|
||
| ## Financial domain | ||
|
|
||
| - **No look-ahead bias:** only data available on or before the decision `as_of_date`. | ||
| - Document `as_of_date`, data sources, and formula versions in the feature spec when adding metrics. | ||
|
|
||
| ## Tooling | ||
|
|
||
| No project-wide tests or linter unless configured in root `pyproject.toml`. Do not add heavy CI scaffolding unless requested. | ||
|
|
||
| ## Network | ||
|
|
||
| `yfinance` and external APIs require network access; handle failures explicitly in implementation specs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| .PHONY: install lint test download-fundamentals format platform-tf-check | ||
|
|
||
| install: | ||
| poetry install --with dev | ||
| uv sync --frozen --group dev | ||
|
|
||
| lint: | ||
| poetry run ruff check . | ||
| poetry run ruff format --check . | ||
| uv run ruff check . | ||
| uv run ruff format --check . | ||
|
|
||
| test: | ||
| poetry run pytest --cov=investing --cov=credit --cov-branch --cov-report=term-missing | ||
| uv run pytest --cov=investing --cov=credit --cov-branch --cov-report=term-missing | ||
|
|
||
| # Requires SEC_IDENTITY in the environment. See investing/docs/guides/download-fundamentals.md | ||
| download-fundamentals: | ||
| poetry run download-fundamentals --universe dow30 | ||
| uv run download-fundamentals --universe dow30 | ||
|
|
||
| # formatting command | ||
| format: | ||
| poetry run ruff format . | ||
| uv run ruff format . | ||
|
|
||
| # Terraform fmt + validate for credit CSS serve demo (no apply; no AWS creds required). | ||
| platform-tf-check: | ||
| cd platform/terraform/credit-css-serve-demo && terraform fmt -check -recursive && terraform init -backend=false -input=false && terraform validate | ||
| cd platform/terraform/credit-css-serve-demo && terraform fmt -check -recursive && terraform init -backend=false -input=false && terraform validate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI sync does not freeze lock
Low Severity
PR CI installs and runs via
uv sync/uv runwithout--frozenor--locked, while credit Docker images useuv sync --frozen. Ifuv.lockdrifts from the memberpyproject.tomlfiles, CI can re-resolve and stay green while Docker builds fail, or tests can run a different graph than the images.Additional Locations (1)
Makefile#L2-L11Reviewed by Cursor Bugbot for commit 0c75e56. Configure here.