openedx / openedx/openedx-platform

Consider removing `pact` from requirements

Open
#32,798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discovery
Dominant language
Python
Stars
8.2k
Forks
4.4k
Avg merge
6d 18h
Merged PRs (30d)
42

Description

pact is currently the platform's single largest dev depenedency, taking ~30s to install into the dev image:

$ tutor dev run lms bash
app@04531af885b0:~/edx-platform$ cd /openedx/venv/lib/python3.8/site-packages
app@04531af885b0:~/venv/lib/python3.8/site-packages$ du -hs * | sort -h -r | head -n 10
145M	pact
101M	scipy
82M	snowflake
52M	sympy
48M	openassessment
45M	_sass.cpython-38-x86_64-linux-gnu.so
44M	django
35M	numpy.libs
34M	scipy.libs
34M	botocore

pact is a testing dependency of the platform, added by this PR: https://github.com/openedx/edx-platform/pull/28289

I believe only a handful of tests use pact:

~/openedx/edx-platform 🍀 find . -wholename */pacts/*
./common/test/pacts/__init__.py
./common/test/pacts/middleware.py
./openedx/core/djangoapps/courseware_api/tests/pacts/views.py
./openedx/core/djangoapps/courseware_api/tests/pacts/__init__.py
./openedx/core/djangoapps/courseware_api/tests/pacts/api-courseware-contract.json
./openedx/core/djangoapps/courseware_api/tests/pacts/verify_pact.py
./lms/djangoapps/courseware/tests/pacts/views.py
./lms/djangoapps/courseware/tests/pacts/__init__.py
./lms/djangoapps/courseware/tests/pacts/verify_pact.py
./lms/djangoapps/courseware/tests/pacts/course-xblock-handler-contract.json
./lms/djangoapps/course_api/blocks/tests/pacts/views.py
./lms/djangoapps/course_api/blocks/tests/pacts/__init__.py
./lms/djangoapps/course_api/blocks/tests/pacts/api-block-contract.json
./lms/djangoapps/course_api/blocks/tests/pacts/verify_pact.py
Questions
  • What is the value of Pact, and it is worth 145M and extra build time for all devs?
  • The PR, from 2021, refers to a "contact testing pilot". Is this still going?
  • Are there plans to add more Pact tests?
  • How hard would it be to migrate those test cases off of Pact?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the dependency declaration and the Pact-related files under common/test/pacts, openedx/core/djangoapps/courseware_api/tests/pacts, lms/djangoapps/courseware/tests/pacts, and lms/djangoapps/course_api/blocks/tests/pacts. Read the 2021 PR #28289 and determine whether these tests remain active, what depends on them, and whether removing or migrating the dependency is feasible; done means a documented decision and corresponding dependency or test changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.