{"id":13501186,"url":"https://github.com/tusharsadhwani/yen","last_synced_at":"2025-05-16T02:10:09.163Z","repository":{"id":196202225,"uuid":"695319978","full_name":"tusharsadhwani/yen","owner":"tusharsadhwani","description":"The last Python environment manager you'll ever need.","archived":false,"fork":false,"pushed_at":"2025-03-24T10:05:37.000Z","size":180,"stargazers_count":214,"open_issues_count":12,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T11:55:28.985Z","etag":null,"topics":["pipx","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tusharsadhwani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2023-09-22T21:08:08.000Z","updated_at":"2025-04-12T08:03:27.000Z","dependencies_parsed_at":"2023-12-19T12:26:22.800Z","dependency_job_id":"2df8e62a-04ce-4e21-9fa8-4fff4129e15c","html_url":"https://github.com/tusharsadhwani/yen","commit_stats":{"total_commits":70,"total_committers":5,"mean_commits":14.0,"dds":"0.15714285714285714","last_synced_commit":"8d1bb0c1232c7b0159caefb1bf3a5348b93f7b43"},"previous_names":["tusharsadhwani/yen"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Fyen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Fyen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Fyen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tusharsadhwani%2Fyen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tusharsadhwani","download_url":"https://codeload.github.com/tusharsadhwani/yen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"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":["pipx","python","rust"],"created_at":"2024-07-31T22:01:28.508Z","updated_at":"2025-05-16T02:10:09.111Z","avatar_url":"https://github.com/tusharsadhwani.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# yen\n\nThe last Python environment manager you'll ever need.\n\n![Credits: xkcd.com/1987](https://imgs.xkcd.com/comics/python_environment.png)\n\nWe're finally putting an end to this XKCD.\n\n## So what can `yen` do?\n\n- **Get any Python version running instantly** with just 1 command:\n\n  ```console\n  $ python\n  'python': command not found\n\n  $ yen exec --python 3.12\n  Downloading 3.12.3 ━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 17.4/17.4 MB • 29.1 MB/s\n  Python 3.12.3 (main, Apr 15 2024, 17:43:11) [Clang 17.0.6 ] on darwin\n  Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n  \u003e\u003e\u003e exit()\n\n  $ yen exec --python 3.12  # Cached for subsequent uses:\n  Python 3.12.3 (main, Apr 15 2024, 17:43:11) [Clang 17.0.6 ] on darwin\n  Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n  \u003e\u003e\u003e\n  ```\n\n  Works on Windows, MacOS and Linux (`libc` and `musl`), on Intel and ARM chips.\n\n- **Instant `venv` creation**: Thanks to `microvenv`, `yen` can create virtual\n  environments much faster than the builtin `venv` module:\n\n  ```console\n  $ yen create venv -p 3.9\n  Created venv with Python 3.9.18 ✨\n\n  $ source venv/bin/activate\n\n  (venv) $ python --version\n  Python 3.9.18\n  ```\n\n  \u003e NOTE: It's not that fast right now as I found a bug. Working on it.\n\n- **Zero dependencies**: No need to have Python installed, no need to look into `apt`,\n  `homebrew` etc., just run one shell command to get `yen` set up locally.\n\n- **Python script management**: Never run `pip install` to get a tool like `ruff`,\n  `awscli` etc. in the global Python environment ever again.\n\n**Essentially, `yen` lets you replace various Python environment management tools\nsuch as `pyenv`, `pipx` and `virtualenv`, with a single static binary.**\n\nRunning Python code on any machine has never been this easy.\n\n## Installation\n\nGet `yen` by running the following command:\n\n- MacOS / Linux:\n\n  ```bash\n  curl -L yen.tushar.lol/install.sh | sh\n  ```\n\n- Windows:\n\n  Using cmd:\n\n  ```cmd\n  curl -L yen.tushar.lol/install.bat -o yen-install.bat\n  yen-install.bat\n  ```\n\n  or using Powershell:\n\n  ```pwsh\n  curl yen.tushar.lol/install.ps1 | Invoke-Expression\n  ```\n\nor if you prefer, get it via `pip`:\n\n```bash\npip install yen\n```\n\nor `pipx`:\n\n```bash\npipx run yen\n```\n\n\u003e Yeah, if you already have `yen`, you can do `yen run yen` and that works.\n\u003e But don't do that.\n\nYou can also grab the binary from [GitHub releases](https://github.com/tusharsadhwani/yen/releases).\n\n## Usage\n\n```console\n$ yen list\nAvailable Pythons:\n3.12.3\n3.11.9\n3.10.14\n3.9.19\n3.8.19\n\n$ yen create venv -p 3.12\nDownloading 3.12.3 ━━━━━━━━━━━━━━━━━━━━━━━━━ 100.0% • 17.4/17.4 MB • 12.4 MB/s\nCreated venv with Python 3.12.3 ✨\n\n$ yen install meowsay\nInstalled package meowsay with Python 3.12.3 ✨\n\n$ meowsay hello!\n ________\n\u003c hello! \u003e\n --------\n        \\      |\\---/|\n         \\     | ,_, |\n                \\_`_/-..----.\n             ___/ `   ' ,\\\"\\\"+ \\  sk\n            (__...'   __\\    |`.___.';\n              (_,...'(_,.`__)/'.....+\n\n$ yen run --python 3.9 wttr\nWeather report: Milano, Italy\n\n     \\  /       Partly cloudy\n   _ /\"\".-.     20 °C\n     \\_(   ).   ↑ 4 km/h\n     /(___(__)  10 km\n                0.0 mm\n\n$ wttr paris\nWeather report: paris\n\n      \\   /     Sunny\n       .-.      +22(25) °C\n    ― (   ) ―   ↓ 7 km/h\n       `-’      10 km\n      /   \\     0.0 mm\n```\n\n\u003e By default the Pythons will be downloaded in `~/.yen_pythons`.\n\u003e You can change this location by setting the `YEN_PYTHONS_PATH` environment variable.\n\n## Local Development / Testing\n\n- Run `yen create venv` and `venv/bin/activate`\n- Run `pip install -r requirements-dev.txt` to do an editable install\n- Verify that you're now pointing at the correct `yen`:\n\n  ```console\n  $ which yen\n  /home/your_name/code/yen/venv/bin/yen\n  ```\n\n- Run `pytest` to run tests\n\nTo run Rust tests:\n\n- Compile the rust project: `cd yen-rs \u0026\u0026 cargo build`\n- Run `export YEN_RUST_PATH=./yen-rs/target/debug/yen-rs`\n- Run `pytest`, and ensure that number of tests ran has doubled.\n\n### `microvenv.py` and `userpath.pyz`\n\nThese two files are used by `yen` and downloaded by the `yen` install script.\n\n- `microvenv.py` is just [this file][1] renamed.\n- `userpath.pyz` is created by running `./build-standalone.sh` in\n  [this fork of userpath][2].\n\n[1]: https://github.com/brettcannon/microvenv/blob/3460d1e/microvenv/_create.py\n[2]: https://github.com/tusharsadhwani/userpath-standalone\n\n## Type Checking\n\nRun `mypy .`\n\n## Create and upload a package to PyPI\n\nMake sure to bump the version in `setup.cfg`.\n\nThen run the following commands:\n\n```bash\npip install setuptools wheel twine\nrm -rf build dist\npython setup.py sdist bdist_wheel\n```\n\nThen upload it to PyPI using [twine](https://twine.readthedocs.io/en/latest/#installation):\n\n```bash\ntwine upload dist/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsadhwani%2Fyen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftusharsadhwani%2Fyen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftusharsadhwani%2Fyen/lists"}