Migrate Skyvern to uv from poetry (#3554)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: stas <stas@skyvern.com>
This commit is contained in:
committed by
GitHub
parent
878ef36a36
commit
d61179e132
4
.github/sync.yml
vendored
4
.github/sync.yml
vendored
@@ -4,8 +4,8 @@ Skyvern-AI/skyvern-cloud:
|
||||
deleteOrphaned: true
|
||||
- source: pyproject.toml
|
||||
dest: pyproject.toml
|
||||
- source: poetry.lock
|
||||
dest: poetry.lock
|
||||
- source: uv.lock
|
||||
dest: uv.lock
|
||||
- source: setup.sh
|
||||
dest: setup.sh
|
||||
- source: .env.example
|
||||
|
||||
72
.github/workflows/ci.yml
vendored
72
.github/workflows/ci.yml
vendored
@@ -32,52 +32,38 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
|
||||
# reference the matrixe python version here.
|
||||
- uses: actions/setup-python@v4
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.11"
|
||||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
|
||||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
|
||||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
|
||||
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
|
||||
# mildly cleaner by using an environment variable, but I don't really care.
|
||||
- name: cache poetry install
|
||||
uses: actions/cache@v3
|
||||
# Install uv (fast, single-file binary)
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
# Cache uv's download/resolve cache to speed up CI (optional but nice)
|
||||
- name: Cache uv global cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.local
|
||||
key: poetry-1.7.1
|
||||
# Install Poetry. You could do this manually, or there are several actions that do this.
|
||||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
|
||||
# Poetry's default install script, which feels correct. I pin the Poetry version here
|
||||
# because Poetry does occasionally change APIs between versions and I don't want my
|
||||
# actions to break if it does.
|
||||
#
|
||||
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
|
||||
# venv as a `.venv` in your testing directory, which allows the next step to easily
|
||||
# cache it.
|
||||
- uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.7.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
|
||||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
|
||||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
|
||||
- name: cache deps
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
path: ~/.cache/uv
|
||||
key: uv-cache-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
|
||||
# Cache the project virtualenv (keyed by Python version + lockfile)
|
||||
- name: Cache venv
|
||||
id: cache-venv
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .venv
|
||||
key: pydeps-${{ hashFiles('**/poetry.lock') }}
|
||||
# Install dependencies. `--no-root` means "install all dependencies but not the project
|
||||
# itself", which is what you want to avoid caching _your_ code. The `if` statement
|
||||
# ensures this only runs on a cache miss.
|
||||
- run: poetry install --no-interaction --no-root
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
# Now install _your_ project. This isn't necessary for many types of projects -- particularly
|
||||
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
|
||||
# pyproject.toml and makes that if you add things like console-scripts at some point that
|
||||
# they'll be installed and working.
|
||||
- run: poetry install --no-interaction
|
||||
key: venv-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version || '3.11' }}-${{ hashFiles('**/uv.lock') }}
|
||||
# Create/refresh the environment (installs main + dev groups)
|
||||
- name: Sync deps with uv
|
||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
uv lock
|
||||
uv sync --group dev
|
||||
# Ensure venv is current even on cache hit (cheap no-op if up to date)
|
||||
- name: Ensure environment is up to date
|
||||
if: steps.cache-venv.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
uv sync --group dev
|
||||
# Finally, run pre-commit.
|
||||
- name: Run all pre-commit hooks
|
||||
uses: pre-commit/action@v3.0.0
|
||||
@@ -102,14 +88,14 @@ jobs:
|
||||
AZURE_GPT4O_MINI_API_VERSION: "dummy"
|
||||
AWS_REGION: "us-east-1"
|
||||
ENABLE_BEDROCK: "true"
|
||||
run: poetry run ./run_alembic_check.sh
|
||||
run: uv run ./run_alembic_check.sh
|
||||
- name: trigger tests
|
||||
env:
|
||||
ENABLE_OPENAI: "true"
|
||||
OPENAI_API_KEY: "sk-dummy"
|
||||
AWS_ACCESS_KEY_ID: "dummy"
|
||||
AWS_SECRET_ACCESS_KEY: "dummy"
|
||||
run: poetry run pytest
|
||||
run: uv run pytest
|
||||
fe-lint-build:
|
||||
name: Frontend Lint and Build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
23
.github/workflows/codeflash.yaml
vendored
23
.github/workflows/codeflash.yaml
vendored
@@ -22,22 +22,23 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- name: Install Project Dependencies
|
||||
- name: Install uv
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install poetry
|
||||
poetry install --all-extras
|
||||
poetry add codeflash
|
||||
- name: create test dir
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
- name: Sync project dependencies
|
||||
run: |
|
||||
mkdir -p codeflash-tests
|
||||
uv sync --group dev
|
||||
- name: Install Codeflash into venv
|
||||
run: |
|
||||
uv pip install codeflash
|
||||
- name: Create test dir
|
||||
run: mkdir -p codeflash-tests
|
||||
- name: Run Codeflash to optimize code
|
||||
run: |
|
||||
poetry env use python
|
||||
poetry run codeflash
|
||||
run: uv run codeflash
|
||||
- name: remove test dir
|
||||
run: |-
|
||||
rm -rf codeflash-tests
|
||||
|
||||
72
.github/workflows/sdk-release.yml
vendored
72
.github/workflows/sdk-release.yml
vendored
@@ -45,58 +45,44 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
|
||||
# reference the matrixe python version here.
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Setup Python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.11"
|
||||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
|
||||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
|
||||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
|
||||
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be
|
||||
# mildly cleaner by using an environment variable, but I don't really care.
|
||||
- name: cache poetry install
|
||||
uses: actions/cache@v3
|
||||
# Cache the installation of `uv` itself, e.g. the next step. This prevents the workflow
|
||||
# from installing `uv` every time, which can be slow.
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
# Cache uv's global cache (resolver/downloads) for speed
|
||||
- name: Cache uv cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.local
|
||||
key: poetry-1.7.1
|
||||
# Install Poetry. You could do this manually, or there are several actions that do this.
|
||||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
|
||||
# Poetry's default install script, which feels correct. I pin the Poetry version here
|
||||
# because Poetry does occasionally change APIs between versions and I don't want my
|
||||
# actions to break if it does.
|
||||
#
|
||||
# The key configuration value here is `virtualenvs-in-project: true`: this creates the
|
||||
# venv as a `.venv` in your testing directory, which allows the next step to easily
|
||||
# cache it.
|
||||
- uses: snok/install-poetry@v1
|
||||
with:
|
||||
version: 1.7.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
|
||||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
|
||||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
|
||||
- name: cache deps
|
||||
id: cache-deps
|
||||
uses: actions/cache@v3
|
||||
path: ~/.cache/uv
|
||||
key: uv-cache-${{ runner.os }}-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }}
|
||||
# Cache the project venv (keyed by lockfile + Python)
|
||||
- name: Cache venv
|
||||
id: cache-venv
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: .venv
|
||||
key: pydeps-${{ hashFiles('**/poetry.lock') }}
|
||||
# Install dependencies. `--no-root` means "install all dependencies but not the project
|
||||
# itself", which is what you want to avoid caching _your_ code. The `if` statement
|
||||
# ensures this only runs on a cache miss.
|
||||
- run: poetry install --no-interaction --no-root
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
# Now install _your_ project. This isn't necessary for many types of projects -- particularly
|
||||
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
|
||||
# pyproject.toml and makes that if you add things like console-scripts at some point that
|
||||
# they'll be installed and working.
|
||||
- run: poetry install --no-interaction
|
||||
key: venv-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version || '3.11' }}-${{ hashFiles('**/uv.lock') }}
|
||||
# Create/refresh environment. We install dev deps to get twine/build.
|
||||
- name: Sync dependencies
|
||||
if: steps.cache-venv.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
uv sync --group dev
|
||||
- name: Ensure environment is up to date (on cache hit)
|
||||
if: steps.cache-venv.outputs.cache-hit == 'true'
|
||||
run: uv sync --group dev
|
||||
- name: Clean dist directory
|
||||
run: rm -rf dist
|
||||
- name: Build Package
|
||||
run: poetry build
|
||||
run: uv build
|
||||
- name: Publish to PyPI
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
run: poetry run twine upload --repository pypi dist/*
|
||||
run: uv run twine upload --repository pypi dist/*
|
||||
|
||||
Reference in New Issue
Block a user