-
Notifications
You must be signed in to change notification settings - Fork 34
BFD-4351: Python CI improvements #2848
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
base: master
Are you sure you want to change the base?
Conversation
6818439 to
5599ce5
Compare
d76666e to
00cacbc
Compare
bb0d129 to
a35b143
Compare
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.
I haven't taken too much of a look at everything else quite yet, but from my cursory glance it looks like this is going in the right direction! The pyproject.toml should get moved to the root, first.
38c2688 to
8f110ec
Compare
Pull request was converted to draft
306721e to
7b9df36
Compare
… a uv workspace in apps. It consolidates Python version pinning, dev tools, and lockfile management, and updates CI to run checks at the workspace level. It also removes redundant per-project .python-version files.
7b9df36 to
f4c9889
Compare
|
apps/pyproject.toml and ops/pyproject.toml have been merged into /pyproject.toml |
|





JIRA Ticket:
BFD-4351
What Does This PR Do?
This PR centralizes Python dependency and tooling configuration by introducing a uv workspace in apps. It consolidates Python version pinning, dev tools, and lockfile management, and updates CI to run checks at the workspace level. It also removes redundant per-project
.python-versionfiles.What Should Reviewers Watch For?
If you're reviewing this PR, please check for these things in particular:
opsproject job behaves as expected and didn’t accidentally get included/excluded.pyproject.tomland criticalopsprojects are compatible.Usage
From the
appsdirectory:Install all dependencies
Install dependencies for a specific project
Run commands
Add a dependency to a project
Add a dev dependency
Configuration
Python Version
The Python version (3.13) is specified in:
.python-versionapps/pyproject.toml(requires-pythonfield)Tool Configuration
Tool configurations (ruff, pyright) are centralized in
apps/pyproject.tomlunder the[tool.*]sections. Individual projects can override these settings if needed.Dependency Groups
pyproject.tomllambda-run-locustfor locust_tests) are project specificCI/CD
The CI workflow (
.github/workflows/ci-python.yml) runs workspace level checks:ruff checkruff format --checkpyrightpytestPython and tool versions are pinned in the CI workflow to ensure consistency.
Migrating from Individual Projects
Previously, each Python project had its own:
.python-versionfileuv.lockfileWith the workspace setup:
.python-versionat repository rootuv.lockat workspace root (apps/uv.lock)Troubleshooting
Lock file out of sync
If you see errors about the lock file being out of sync, run:
Virtual environment issues
If you encounter virtual environment issues, remove and recreate:
Project not found
Make sure the project is listed in the
[tool.uv.workspace]section ofapps/pyproject.toml.What Security Implications Does This PR Have?
Please indicate if this PR does any of the following:
Adds any new software dependencies
No
Modifies any security controls
No
Adds new transmission or storage of data
No
Any other changes that could possibly affect security?
No
I have considered the above security implications as it relates to this PR. (If one or more of the above apply, it cannot be merged without the ISSO or team security engineer's (
@sb-benohe) approval.)I have created tests to sufficiently ensure the reliability of my code, if applicable. If this is a modification to an existing piece of code, I have audited the associated tests to ensure everything works as expected.
Validation
Have you fully verified and tested these changes? Is the acceptance criteria met? Please provide reproducible testing instructions, code snippets, or screenshots as applicable.