{"id":26856,"library":"cosmic-ray","title":"Cosmic Ray","description":"Cosmic Ray is a mutation testing tool for Python. It runs tests against mutated versions of your code to assess test suite quality. Current version 8.4.6. Release cadence is irregular with several minor releases per year.","status":"active","version":"8.4.6","language":"python","source_language":"en","source_url":"https://github.com/sixty-north/cosmic-ray","tags":["mutation-testing","testing","quality","test-suite"],"install":[{"cmd":"pip install cosmic-ray","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for running tests with pytest plugin","package":"pytest","optional":true}],"imports":[{"note":"main is in the cli submodule, not top-level","wrong":"from cosmic_ray import main","symbol":"main","correct":"from cosmic_ray.cli import main"}],"quickstart":{"code":"from cosmic_ray.cli import main\nimport sys\n# Run mutation test on a specific module\nsys.argv = ['cosmic-ray', '--baseline=10', 'test', '--tests', 'pytest', '--executor', 'local', 'my_module.py']\nmain()","lang":"python","description":"Quickstart: Run cosmic-ray mutation testing on a module using pytest as the test runner."},"warnings":[{"fix":"Update to new CLI syntax: `cosmic-ray test --tests pytest --executor local my_module.py`","message":"In version 8.0.0, the CLI command structure changed from `cosmic-ray <subcommand>` to `cosmic-ray <subcommand> ...` with different argument order. Old scripts using positional arguments will break.","severity":"breaking","affected_versions":"<8.0.0"},{"fix":"Replace `--baseline` with `--timeout` (value in seconds).","message":"The `--baseline` option is deprecated in version 8.4.0 and may be removed in future versions. Use `--timeout` instead.","severity":"deprecated","affected_versions":">=8.4.0"},{"fix":"Always include `--executor local` for local execution.","message":"Cosmic Ray requires an executor (local, celery, etc.). Default is not set; you must specify `--executor local` or configure one.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with pip: `pip install cosmic-ray`. Import with: `import cosmic_ray`.","cause":"Package name on PyPI is 'cosmic-ray' (with a dash), but the import uses underscore.","error":"ModuleNotFoundError: No module named 'cosmic_ray'"},{"fix":"Use `from cosmic_ray.cli import main` instead of `from cosmic_ray import main`.","cause":"The main entry point is in the cli submodule, not at the package root.","error":"NameError: name 'main' is not defined"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}