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

Use uv instead of pip #57

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,39 @@ inputs:
runs:
using: composite
steps:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up environment
run: uv venv
fchareyr marked this conversation as resolved.
Show resolved Hide resolved
shell: bash

- id: install-local-requirements
if: ${{ inputs.requirements-file-paths != '' }}
run: |
IFS=',' read -ra requirements_paths <<< "${{ inputs.requirements-file-paths }}"
for req in ${requirements_paths[@]}; do
pip install -r $req
uv pip install -r $req
done
shell: bash

- id: install-from-pyproject-toml
if: ${{ inputs.pyproject-toml-path != '' }}
run: |
cd $(dirname ${{ inputs.pyproject-toml-path }})
pip install .
uv pip install .
shell: bash

- id: prefect-deploy
run: |
pip install prefect -U "prefect>=3,<4"
uv pip install prefect -U "prefect>=3,<4"
if [ ${{ inputs.all-deployments }} == "true" ];
then
prefect --no-prompt deploy --all --prefect-file "${{ inputs.deployment-file-path }}"
uv run prefect --no-prompt deploy --all --prefect-file "${{ inputs.deployment-file-path }}"
else
IFS=',' read -ra deployment_names <<< "${{ inputs.deployment-names }}"
for name in "${deployment_names[@]}"; do
prefect --no-prompt deploy --prefect-file "${{ inputs.deployment-file-path }}" --name "$name"
uv run prefect --no-prompt deploy --prefect-file "${{ inputs.deployment-file-path }}" --name "$name"
Comment on lines +79 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these uv runs necessary? it looks like the setup-uv thing adds the new interpreter to the path already

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It adds uv to the path but does not activate the virtual environment. This makes uv run required I believe.

done
fi
shell: bash