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

VIRTUAL_ENV is set to wrong directory when using pyproject-file config #251

Open
MarkusSintonen opened this issue Jan 22, 2025 · 4 comments

Comments

@MarkusSintonen
Copy link

We are getting warnings: warning: VIRTUAL_ENV=/home/runner/work/my_repo/my_proj/.venv does not match the project environment path .venv and will be ignored

The VIRTUAL_ENV seems to be pointing to wrong place which is not under the defined pyproject:

    - uses: astral-sh/setup-uv@v5
      with:
        pyproject-file: ./my_subproject/pyproject.toml

Shouldnt the VIRTUAL_ENV in this case be pointing to VIRTUAL_ENV=/home/runner/work/my_repo/my_proj/my_subproject/.venv?

Issue seems to be originating here

core.exportVariable("VIRTUAL_ENV", path.resolve(".venv"));
which was recently changed here #224 But that PR is not considering that the VIRTUAL_ENV should be relative to the defined pyproject-file directory, right?

@MarkusSintonen MarkusSintonen changed the title VIRTUAL_ENV is set to wrong directory which is not relative to given pyproject-file VIRTUAL_ENV is set to wrong directory when using pyproject-file config Jan 22, 2025
@MarkusSintonen
Copy link
Author

How should this anyways work with projects having multiple sub-pyprojects?

@eifinger
Copy link
Collaborator

When I implemented the pyproject-file input I was not thinking about monorepos.

How should this anyways work with projects having multiple sub-pyprojects?

tl;dr: It doesn't.

This action needs breaking changes in order to fix this bug. Might take me a while to find a way which doesn't lead to more breaking changes a few weeks after...

@MarkusSintonen
Copy link
Author

Would it be possible to have option to skipping the setting of this env?

@eifinger
Copy link
Collaborator

If you DON'T use python-version it will be skipped

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

No branches or pull requests

2 participants