{"id":13764318,"url":"https://github.com/pawamoy/pdm-multirun","last_synced_at":"2025-05-05T21:21:28.865Z","repository":{"id":64259451,"uuid":"574421485","full_name":"pawamoy/pdm-multirun","owner":"pawamoy","description":"A PDM plugin to run a command on multiple Python versions.","archived":false,"fork":false,"pushed_at":"2024-07-02T14:46:04.000Z","size":1118,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T01:35:46.903Z","etag":null,"topics":["pdm","pdm-plugin"],"latest_commit_sha":null,"homepage":"https://pawamoy.github.io/pdm-multirun/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawamoy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pawamoy","ko_fi":"pawamoy","custom":["https://www.paypal.me/pawamoy"]}},"created_at":"2022-12-05T09:22:15.000Z","updated_at":"2024-12-30T22:27:33.000Z","dependencies_parsed_at":"2024-01-07T18:08:57.687Z","dependency_job_id":"b4b3766c-4284-4805-aa38-9ab822e5895f","html_url":"https://github.com/pawamoy/pdm-multirun","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":"0.17647058823529416","last_synced_commit":"65f72cd53c871e2edabe96e358d4266955a44f99"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Fpdm-multirun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Fpdm-multirun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Fpdm-multirun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawamoy%2Fpdm-multirun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawamoy","download_url":"https://codeload.github.com/pawamoy/pdm-multirun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577116,"owners_count":21770734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pdm","pdm-plugin"],"created_at":"2024-08-03T16:00:18.839Z","updated_at":"2025-05-05T21:21:28.846Z","avatar_url":"https://github.com/pawamoy.png","language":"Python","funding_links":["https://github.com/sponsors/pawamoy","https://ko-fi.com/pawamoy","https://www.paypal.me/pawamoy"],"categories":["Plugins"],"sub_categories":[],"readme":"# PDM Multirun\n\n[![ci](https://github.com/pawamoy/pdm-multirun/workflows/ci/badge.svg)](https://github.com/pawamoy/pdm-multirun/actions?query=workflow%3Aci)\n[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://pawamoy.github.io/pdm-multirun/)\n[![pypi version](https://img.shields.io/pypi/v/pdm-multirun.svg)](https://pypi.org/project/pdm-multirun/)\n[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/pdm-multirun)\n[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#pdm-multirun:gitter.im)\n\nA [PDM](https://github.com/pdm-project/pdm) plugin to run a command on multiple Python versions.\n\n:warning: **Looking for maintainers.** I do not use PDM nor this plugin nowadays, and don't have the time to fix CI failures or upgrade the code base to support new versions of PDM. If you wish to be added as a collaborator on this project in order to help maintaining it, or if you wish the repository to be transfered to you, please open an issue or discussion, with enough information about you for me to trust you :wink:\n\n## Installation\n\nWith [`pipx`](https://github.com/pipxproject/pipx):\n\n```bash\npipx install pdm\npipx inject pdm pdm-multirun\n```\n\nWith [PDM](https://github.com/pdm-project/pdm):\n\n```bash\npdm self add pdm-multirun\n```\n\nAs a local-only plugin:\n\n```toml\n# pyproject.toml\n[tool.pdm]\nplugins = [\n    \"pdm-multirun\",\n]\n```\n\n```bash\npdm install --plugins\n```\n\n## Usage\n\nThis plugin adds a `multirun` command to PDM.\nThe command accepts the same parameters as the `run` command,\nwith an additional `-i`, `--interpreters`, `--versions` parameter\nthat allows to specify the interpreters to use.\n\n```bash\npdm multirun pytest tests/\n```\n\nTo specify interpreters, pass a comma-separated string\nof Python versions:\n\n```bash\npdm multirun -i 3.10,3.11 pytest tests/\n```\n\nIf you use virtual environments instead,\npass their names to the `--interpreters` option\nand add the `-e`, `--venvs` flag:\n\n```bash\npdm multirun -ei 3.10,3.11 pytest tests/\n```\n\n```bash\npdm multirun -ei tests38,tests39 pytest tests/\n```\n\nYou can set PDM Multirun to use virtual environments by default by\nsetting the `PDM_MULTIRUN_USE_VENVS` environment variable to `1`.\n\nBy default, PDM Multirun reads Python versions (or venv names)\nfrom the `PDM_MULTIRUN_VERSIONS` environment variable.\nIt is a string of `{major}.{minor}` versions (or venv names),\nseparated by spaces, that can be found and called by PDM.\n\n```bash\nexport PDM_MULTIRUN_VERSIONS=\"3.8 3.9 3.10 3.11 3.12\"\npdm multirun pytest tests/\n```\n\n```bash\nexport PDM_MULTIRUN_VERSIONS=\"tests38 tests39 tests310\"\npdm multirun pytest tests/\n```\n\nPDM Multirun sets a number of environment variables that can be used by code run\nin each version.\n\n* `PDM_MULTIRUN` set to `1` whenever PDM Multirun is being used.\n* `PDM_MULTIRUN_CURRENT` is set to the name of the current interpreter or\n  virtual environment (such as that passed using `-i` or\n  `PDM_MULTIRUN_VERSIONS`).\n\nYou can use these variables, for example, to output metadata about the current\nPython version or interpreter, like in the example below, which if invoked by\nPDM Multirun, would start by printing the name of the virtual environment or\ninterpeter, and the version of Python being used.\n\n**script.py**\n```python\nimport os\nimport sys\n\nMULTIRUN = os.getenv(\"PDM_MULTIRUN\", \"0\") == \"1\"\n\nif MULTIRUN:\n    int_name = os.getenv('PDM_MULTIRUN_CURRENT', '')\n    py = f\"{int_name}: {sys.version_info[0]}.{sys.version_info[1]}\"\n\n    print(f\"{py} - Hello from python! 👋\")\n\n# continue script as required...\n```\n\nIn a scenario where you had two virtual environments, `tests38` and `tests39`,\nand saved this script in a file named `example.py`, running the command:\n\n    pdm multirun -e tests38,tests39 python example.py\n\nWould output the text below.\n\n```\ntests38: 3.8 - Hello from python! 👋\ntests39: 3.9 - Hello from python! 👋\n```\n\n---\n\nPDM Multirun successively runs the `pdm use` then `pdm run` internal actions.\nBy default, if PDM cannot \"use\" an interpreter/venv, it continues with the next.\n\n```bash\n# will continue with 3.8 even if 3.7 is not available\npdm multirun -i 3.7,3.8 pytest tests/\n```\n\nYou can tell it to fail instead with the `-f`, `--fail-fast` flag:\n\n```bash\n# will stop at 3.7 if it's not available\npdm multirun -fi 3.7,3.8 pytest tests/\n```\n\nIf the command you run fails on a Python version, PDM Multirun stops there.\nIn any case, PDM Multirun will restore the Python interpreter\nsaved in `.pdm-python` (through the `pdm use` command) before exiting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawamoy%2Fpdm-multirun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawamoy%2Fpdm-multirun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawamoy%2Fpdm-multirun/lists"}