Skip to content
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

.rye folder location #193

Closed
mitsuhiko opened this issue Mar 2, 2024 · 3 comments · Fixed by #194
Closed

.rye folder location #193

mitsuhiko opened this issue Mar 2, 2024 · 3 comments · Fixed by #194

Comments

@mitsuhiko
Copy link

Some time with the latest release of this action, a new .rye folder showed up in the checkout location which now confuses calls like rye fmt etc. I had to add that folder to the pyproject.toml as excluded. This does not seem ideal.

astral-sh/rye#822

@eifinger
Copy link
Owner

eifinger commented Mar 2, 2024

Thanks for reporting that. Moving .rye to any location outside the project root should fix that?

@cnpryer
Copy link

cnpryer commented Mar 3, 2024

Is that Rye's home? Would we be able to place it in another spot like this?

setup-rye on  main [!] via  v18.17.1 
❯ git diff
diff --git a/.github/workflows/test-cache.yml b/.github/workflows/test-cache.yml
index 55b251d..9cbe166 100644
--- a/.github/workflows/test-cache.yml
+++ b/.github/workflows/test-cache.yml
@@ -9,6 +9,9 @@ concurrency:
   group: ${{ github.workflow }}-${{ github.ref }}
   cancel-in-progress: true
 
+env:
+  RYE_HOME: __tests__/fixtures/.rye
+
 jobs:
   test-setup-cache:
     runs-on: ${{ matrix.os }}
diff --git a/src/restore-cache.ts b/src/restore-cache.ts
index eb5c8dc..d43e50e 100644
--- a/src/restore-cache.ts
+++ b/src/restore-cache.ts
@@ -11,7 +11,7 @@ export const STATE_CACHE_MATCHED_KEY = 'cache-matched-key'
 export const workingDirInput = core.getInput('working-directory')
 export const workingDir = workingDirInput ? `/${workingDirInput}` : ''
 export const venvPath = `${process.env['GITHUB_WORKSPACE']}${workingDir}/.venv`
-export const ryeHomePath = `${process.env['GITHUB_WORKSPACE']}${workingDir}/.rye`
+export const ryeHomePath = `${process.env['GITHUB_WORKSPACE']}$/.rye`
 const CACHE_VERSION = '2'

I'm not too familiar with building github actions, so maybe I'm misunderstanding something.

@cnpryer
Copy link

cnpryer commented Mar 3, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants