pytest-dev / pytest-dev/pytest-rerunfailures

Consider relicensing to a permissive license (MIT/Apache-2.0) for enterprise adoption

Open
#326 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
477
Forks
107
Avg merge
2d 14h
Merged PRs (30d)
21

Description

pytest-rerunfailures is licensed under MPL-2.0 (Mozilla Public License 2.0). While MPL-2.0 is an OSI-approved open source license, its copyleft provisions create adoption barriers in enterprise environments.

From pyproject.toml:
license.text = "MPL-2.0"

Why This Matters

Enterprise organizations running security/license scanners (Snyk, Black Duck, FOSSA, WhiteSource) commonly have policies that flag or block MPL-2.0 dependencies because:

  1. File-level copyleft: Any modifications to MPL-2.0 licensed files must be released under the same license
  2. Distribution triggers: Distributing the software (e.g., in Docker images, CI pipelines, packaged test frameworks) can trigger compliance obligations
  3. Legal review overhead: Each MPL-2.0 dependency typically requires legal review and an exception approval process

In practice, this means teams that want to use pytest-rerunfailures in enterprise CI/CD pipelines either:

  • Go through a lengthy legal exception process
  • Build custom retry plugins from scratch to avoid the dependency

We chose the latter — building a ~190-line custom retry plugin that reimplements the core functionality (--reruns, --reruns-delay, per-test @pytest.mark.flaky) using pytest_runtest_protocol and
runtestprotocol. It works, but it's duplicated effort that wouldn't be necessary under a permissive license.

Context: The pytest Ecosystem is Permissive

Most of the pytest plugin ecosystem uses permissive licenses:

  ┌──────────────────────┬──────────────────────┐
  │       Package        │       License        │
  ├──────────────────────┼──────────────────────┤
  │ pytest               │ MIT                  │
  ├──────────────────────┼──────────────────────┤
  │ pytest-xdist         │ MIT                  │
  ├──────────────────────┼──────────────────────┤
  │ pytest-html          │ MPL-2.0 (same issue) │
  ├──────────────────────┼──────────────────────┤
  │ pytest-playwright    │ Apache-2.0           │
  ├──────────────────────┼──────────────────────┤
  │ pytest-asyncio       │ Apache-2.0           │
  ├──────────────────────┼──────────────────────┤
  │ pytest-cov           │ MIT                  │
  ├──────────────────────┼──────────────────────┤
  │ pytest-mock          │ MIT                  │
  ├──────────────────────┼──────────────────────┤
  │ pytest-timeout       │ MIT                  │
  ├──────────────────────┼──────────────────────┤
  │ pytest-rerunfailures │ MPL-2.0              │
  └──────────────────────┴──────────────────────┘

pytest-rerunfailures is one of the few popular pytest plugins that uses a copyleft license. This creates friction for teams that can freely use the rest of the ecosystem.

Suggestion

Consider relicensing to MIT or Apache-2.0 to align with the broader pytest ecosystem and remove enterprise adoption barriers.

This package has no transitive dependencies beyond packaging and pytest itself (both permissive). A license change would have no upstream implications.

I understand relicensing requires consent from all contributors, and this may not be a simple change. But given the package's role as essential testing infrastructure, a permissive license would
significantly broaden adoption in enterprise environments where license compliance is non-negotiable.

Our Workaround

For reference, we built a custom replacement (~190 lines) that provides:

  • --retries N CLI flag (equivalent to --reruns)
  • --retry-delay CLI flag (equivalent to --reruns-delay)
  • @pytest.mark.retry(count=N) marker (equivalent to @pytest.mark.flaky)
  • Full protocol re-run (setup + call + teardown) so Playwright fixtures get fresh browser contexts

This works but represents duplicated community effort.

Environment

  • pytest-rerunfailures 16.1
  • Python 3.13
  • Snyk enterprise license policy (blocks MPL-2.0)

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 with the license metadata in pyproject.toml and review the contributor history to determine whose consent is required. The maintainers must decide between MIT and Apache-2.0 and obtain agreement from all contributors before changing the project license. Done means the chosen license is approved and the repository metadata reflects it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.