Skip to content

chore: add tox.ini for local development#38

Open
salman2013 wants to merge 1 commit into
mainfrom
salman/modernize-branch
Open

chore: add tox.ini for local development#38
salman2013 wants to merge 1 commit into
mainfrom
salman/modernize-branch

Conversation

@salman2013

Copy link
Copy Markdown
Contributor

Summary

  • Adds tox.ini to support running lint, tests, and docs locally via tox
  • Uses uv-venv-lock-runner with tox-uv>=1 for uv-native tox environments
  • Maps to existing [project.optional-dependencies] via extras (no changes to pyproject.toml)

Environments

Env Command Extras used
tox -e lint ruff check + ruff format --check dev
tox -e test pytest --cov=src --cov-report=xml test
tox -e docs make -C docs html docs

Test plan

  • tox -e lint passes (ruff check + format)
  • tox -e test passes (82 tests, 80.76% coverage)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels May 19, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @salman2013!

This repository is currently maintained by @openedx/axim-engineering.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.80%. Comparing base (9061e3a) to head (d297bb4).

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           
Flag Coverage Δ
unittests 79.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and docs tox environments.
  • Uses uv-venv-lock-runner with extras mapped to existing optional-dependency groups (dev, test, docs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tox.ini
Comment on lines +1 to +4
[tox]
envlist = lint, test, docs
requires =
tox-uv>=1
Comment thread tox.ini
Comment on lines +18 to +22
[testenv:docs]
runner = uv-venv-lock-runner
extras = docs
commands =
make -C docs html
@farhan

farhan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I think we can follow two approaches for command orchestration:

  1. Current: Commands defined in Makefile; both ci.yml and tox.ini (PR need updates) delegate to make targets.
    • suggested tox file changes are below
[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
  1. Alternative: Commands defined in tox.ini; both ci.yml and Makefile delegate to tox -e .

I think we should follow second option:

Reasons:

  • tox is the Python & Open edX community standard for this — it's what contributors expect
  • CI and local environments are guaranteed to match (tox manages the venv)
  • Makefile becomes a convenience layer, not a logic layer — make test just calls tox -e test

@feanil @kdmccormick @openedx/axim-aximprovements

@feanil

feanil commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

@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.

@farhan

farhan commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

6 participants