chore: add tox.ini for local development#38
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the pull request, @salman2013! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
=======================================
Coverage 79.80% 79.80%
=======================================
Files 41 41
Lines 1139 1139
Branches 75 75
=======================================
Hits 909 909
Misses 203 203
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a tox.ini configuration to make it easy to run the repo’s existing linting, tests (with coverage), and docs build locally via tox, using uv-native tox environments (tox-uv).
Changes:
- Introduces
lint,test, anddocstox environments. - Uses
uv-venv-lock-runnerwith extras mapped to existing optional-dependency groups (dev,test,docs).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I think we can follow two approaches for command orchestration:
[tox]
envlist = lint, test, docs
requires =
tox-uv>=1
[testenv:lint]
runner = uv-venv-lock-runner
extras = dev
allowlist_externals = make
commands =
make lint
[testenv:test]
runner = uv-venv-lock-runner
extras = test
allowlist_externals = make
commands =
make test-with-coverage
[testenv:docs]
runner = uv-venv-lock-runner
extras = docs
allowlist_externals = make
commands =
make docs
I think we should follow second option: Reasons:
@feanil @kdmccormick @openedx/axim-aximprovements |
|
@farhan I agree, I think the 2nd option is the way to go. Tox for codifying the testing env and then makefile for convenience/consistency aliases for calling Tox. |
|
@salman2013 Let's go for second option then Please study xblocks-core tox.ini to run tests for different environments; different django versions; and keep it consistent in all the repositories. |
Summary
tox.inito support running lint, tests, and docs locally via toxuv-venv-lock-runnerwithtox-uv>=1for uv-native tox environments[project.optional-dependencies]viaextras(no changes topyproject.toml)Environments
tox -e lintruff check+ruff format --checkdevtox -e testpytest --cov=src --cov-report=xmltesttox -e docsmake -C docs htmldocsTest plan
tox -e lintpasses (ruff check + format)tox -e testpasses (82 tests, 80.76% coverage)🤖 Generated with Claude Code