{"id":14006831,"url":"https://github.com/eifinger/setup-rye","last_synced_at":"2025-04-09T21:20:59.237Z","repository":{"id":180145361,"uuid":"664354347","full_name":"eifinger/setup-rye","owner":"eifinger","description":"Set up your GitHub Actions workflow with a specific version of Rye","archived":false,"fork":false,"pushed_at":"2024-10-24T00:10:39.000Z","size":19131,"stargazers_count":66,"open_issues_count":6,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-24T22:57:01.207Z","etag":null,"topics":["hacktoberfest","python","rye","setup"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/eifinger.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-09T18:07:14.000Z","updated_at":"2024-10-24T01:28:48.000Z","dependencies_parsed_at":"2024-02-13T09:23:58.540Z","dependency_job_id":"2c6dad97-7bbe-4253-818b-1d14e2c537f0","html_url":"https://github.com/eifinger/setup-rye","commit_stats":null,"previous_names":["eifinger/setup-rye","eifinger/install-rye"],"tags_count":87,"template":false,"template_full_name":"actions/typescript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fsetup-rye","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fsetup-rye/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fsetup-rye/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eifinger%2Fsetup-rye/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eifinger","download_url":"https://codeload.github.com/eifinger/setup-rye/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112365,"owners_count":21049646,"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":["hacktoberfest","python","rye","setup"],"created_at":"2024-08-10T10:01:39.748Z","updated_at":"2025-04-09T21:20:59.219Z","avatar_url":"https://github.com/eifinger.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/eifinger","https://paypal.me/kevinstillhammer"],"categories":["TypeScript"],"sub_categories":[],"readme":"# setup-rye\n\nSet up your GitHub Actions workflow with a specific version of [rye](https://rye-up.com/).\n\n* Install a version of rye and add it to the path\n* Cache the installed version of rye to speed up consecutive runs on self-hosted runners\n* Register problem matchers for error output\n* Optional: Cache the virtual environment created by rye\n* Optional: Verify the checksum of the downloaded rye executable\n\n\u003e [!TIP]\n\u003e Want to switch to [uv](https://docs.astral.sh/uv)? Check out [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv)\n\n## Usage\n\nExample workflow can be found [in this repo](https://github.com/eifinger/pywaze/blob/main/.github/workflows/ci.yml)\n\n```yaml\n- name: Install the latest version of rye\n  uses: eifinger/setup-rye@v4\n```\n\n### Install latest version\n\nBy default this action installs the version defined as `default` in `action.yml`.\nThis gets automatically updated in a new release of this action when a new version of rye is released.\nIf you don't want to wait for a new release of this action you can use use `version: latest`.\n\n\u003e [!WARNING]  \n\u003e Using the `latest` version means that the rye executable gets downloaded every single time instead of loaded from the tools cache.\n\u003e This can take up to 20s depending on the download speed.\n\u003e This does not affect the cached version of `.venv` when caching is enabled.\n\n```yaml\n- name: Install a specific version\n  uses: eifinger/setup-rye@v4\n  with:\n    version: 'latest'\n```\n\n### Install specific version\n\nYou can also specify a specific version of rye\n\n```yaml\n- name: Install a specific version\n  uses: eifinger/setup-rye@v4\n  with:\n    version: '0.12.0'\n```\n\n### Validate checksum\n\nYou can also specify a checksum to validate the downloaded file.\nChecksums of versions 0.12.0 and later are automatically verified by this action.\nThe sha265 hashes can be found on the [releases page](https://github.com/astral-sh/rye/releases)\nof the rye repo.\n\n```yaml\n- name: Install a specific version and validate the checksum\n  uses: eifinger/setup-rye@v4\n  with:\n    version: '0.12.0'\n    checksum: 'c48d850e90649d868d512f60af67c74aa844d80f951fdb38589220662e709da7'\n```\n\n### Enable caching\n\nIf you enable caching the virtual environment which gets created by `rye` under `.venv` will\nbe cached. This can speed up runs which can reuse the cache\nby several minutes.\n\nYou can optionally define a custom cache key prefix.\n\n```yaml\n- name: Enable caching and define a custom cache key prefix\n  id: setup-rye\n  uses: eifinger/setup-rye@v4\n  with:\n    enable-cache: true\n    cache-prefix: 'optional-prefix'\n```\n\nWhen the cache was successfully restored the output `cache-hit` will be set to `true` and you can use it in subsequent steps.\nFor the example above you can use it like this:\n\n```yaml\n- name: Do something if the cache was restored\n  if: steps.setup-rye.outputs.cache-hit == 'true'\n  run: echo \"Cache was restored\"\n```\n\n#### Working directory\n\nIf your rye project is not at the root of the repository you can specify the working directory\nrelative to the repository root. This is useful for monorepos.\n\n```yaml\n- name: Enable caching and define a working directory\n  uses: eifinger/setup-rye@v4\n  with:\n    enable-cache: true\n    working-directory: 'path/to/rye/project'\n```\n\n#### Local storage path\n\nIf you want to save the cache to a local path you can specify the path with the `cache-local-storage-path` input.\nThis can be useful if you are on a self hosted runner and want to save time and network traffic.\n\n```yaml\n- name: Enable caching and define a custom cache path\n  uses: eifinger/setup-rye@v4\n  with:\n    enable-cache: true\n    cache-local-storage-path: '/path/to/cache'\n```\n\nIt is recommended to cleanup the storage path to avoid running out of disk space.\nOne option is to use a cron job to delete files older than 7 days like below.\n\n```yaml\n0 0 * * * find /home/ubuntu/setup-rye-cache -type d -mtime +7 -exec rm -rf {} \\;\n```\n\n### API rate limit\n\nTo avoid hitting the error `API rate limit exceeded` you can supply a GitHub token with the `github-token` input.\n\n```yaml\n- name: Install rye and supply a GitHub token\n  uses: eifinger/setup-rye@v4\n  with:\n    github-token: ${{ secrets.GITHUB_TOKEN }}\n```\n\n## How it works\n\nThis action downloads rye from the releases of the [rye repo](https://github.com/astral-sh/rye) and uses the [GitHub Actions Toolkit](https://github.com/actions/toolkit) to cache it as a tool to speed up consecutive runs especially on self-hosted runners.\n\nThe installed version of rye is then added to the runner path so other steps can just use it by calling `rye`.\nTo prevent interfering the other rye processes on the same runner `RYE_HOME` gets set to the repository roots parent and is cleaned up after a workflow run.\n\n## FAQ\n\n### Do I still need actions/setup-python when using this action?\n\nNo! This action was modelled as a drop-in replacement for `actions/setup-python` when using rye.\n\nA simple example workflow could look like this:\n\n```yaml\n- name: Checkout the repository\n  uses: actions/checkout@v2\n- name: Install the latest version of rye\n  uses: eifinger/setup-rye@v4\n  with:\n    enable-cache: true\n- name: Sync dependencies\n  run: rye sync\n- name: Lint\n  run: rye lint\n```\n\n---\n\n[\u003cimg src=\"https://raw.githubusercontent.com/eifinger/setup-rye/main/docs/images/bmc-button.svg\" width=150 height=40 style=\"margin: 5px\"/\u003e](https://www.buymeacoffee.com/eifinger)\n[\u003cimg src=\"https://raw.githubusercontent.com/eifinger/setup-rye/main/docs/images/paypal-button.svg\" width=150 height=40 style=\"margin: 5px\"/\u003e](https://paypal.me/kevinstillhammer)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fsetup-rye","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feifinger%2Fsetup-rye","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feifinger%2Fsetup-rye/lists"}