-
Notifications
You must be signed in to change notification settings - Fork 148
feat: Support Enum, @staticmethod, @classmethod mutations #476
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
Open
nicklafleur
wants to merge
4
commits into
boxed:main
Choose a base branch
from
lyft:nicklafleur/enum_class_static_support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
04f7259
fix: improve dockerfile caching
nicklafleur 79989ed
Refactor Config to singleton pattern and timeout fix
nicklafleur 7ed9aa0
Add enum, static/class method support, and pragma: no mutate: class/f…
nicklafleur f45e35a
fix: improve setproctitle workaround
nicklafleur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # Mutant files | ||
| e2e_projects/**/mutants | ||
| e2e_projects/**/mutants* | ||
| /mutants | ||
| tests/data/**/*.py.meta | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,21 @@ | ||
| FROM python:3.10.19-slim-trixie AS base | ||
| ARG PYTHON_VERSION=3.10 | ||
|
|
||
| FROM python:${PYTHON_VERSION}-slim-trixie AS base | ||
|
|
||
| WORKDIR /mutmut | ||
|
|
||
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
|
||
| ENV UV_PROJECT_ENVIRONMENT=/opt/venv | ||
| ARG PYTHON_VERSION | ||
| ENV UV_PROJECT_ENVIRONMENT=/opt/venv \ | ||
| UV_PYTHON_PREFERENCE=only-system \ | ||
| UV_PYTHON=${PYTHON_VERSION} | ||
|
|
||
| COPY . . | ||
| COPY pyproject.toml uv.lock ./ | ||
|
|
||
| RUN uv sync --group dev | ||
| RUN uv sync --group dev --no-install-project | ||
|
|
||
| COPY . . | ||
|
|
||
| ENTRYPOINT ["uv", "run", "pytest"] | ||
| CMD ["--verbose"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,70 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| cd "$(dirname "$0")/.." | ||
| docker build -t mutmut -f ./docker/Dockerfile.test . | ||
| docker run --rm -t -v "$(pwd)":/mutmut mutmut "$@" | ||
|
|
||
| usage() { | ||
| echo "Usage: $0 [--py 3.10,3.12,3.14] [--ff] [-- pytest args...]" | ||
| echo " --py Comma-separated Python versions to test." | ||
| echo " Default: 3.10" | ||
| echo " --ff Stop on first failure instead of running all versions." | ||
| echo "" | ||
| echo " Everything after '--' is forwarded to pytest." | ||
| exit 1 | ||
| } | ||
|
|
||
| PY_VERSIONS="3.10" | ||
| FAIL_FAST=false | ||
|
|
||
| while [[ $# -gt 0 ]]; do | ||
| case "$1" in | ||
| --py) | ||
| PY_VERSIONS="$2" | ||
| shift 2 | ||
| ;; | ||
| --ff) | ||
| FAIL_FAST=true | ||
| shift | ||
| ;; | ||
| -h|--help) | ||
| usage | ||
| ;; | ||
| --) | ||
| shift | ||
| break | ||
| ;; | ||
| *) | ||
| break | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| IFS=',' read -r -a VERSIONS <<< "$PY_VERSIONS" | ||
| RESULTS=() | ||
| EXIT_CODE=0 | ||
|
|
||
| print_results() { | ||
| echo "" | ||
| echo "=== Results ===" | ||
| for RESULT in "${RESULTS[@]}"; do | ||
| echo " $RESULT" | ||
| done | ||
| } | ||
|
|
||
| for VER in "${VERSIONS[@]}"; do | ||
| IMAGE_NAME="mutmut-test-${VER}" | ||
| docker build -t "$IMAGE_NAME" --build-arg "PYTHON_VERSION=$VER" -f ./docker/Dockerfile.test . | ||
| if docker run --rm -t -v "$(pwd)":/mutmut "$IMAGE_NAME" "$@"; then | ||
| RESULTS+=("Python $VER: PASSED") | ||
| else | ||
| EXIT_CODE=1 | ||
| RESULTS+=("Python $VER: FAILED") | ||
| if [[ "$FAIL_FAST" == true ]]; then | ||
| print_results | ||
| exit 1 | ||
| fi | ||
| fi | ||
| done | ||
|
|
||
| print_results | ||
|
|
||
| exit $EXIT_CODE | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.