From 6086f6fcba14df7c35fa28c6ffb7abe78a1ea1ca Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 25 Mar 2026 06:52:41 -0400 Subject: [PATCH 1/3] wip Attempt to fix bundler install failures --- examples/sandbox_07_ruby_sinatra.py | 17 +++++++++++++---- examples/sandbox_09_rails_api.py | 25 +++++++++++++++++++------ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/examples/sandbox_07_ruby_sinatra.py b/examples/sandbox_07_ruby_sinatra.py index 200bd82..fb99901 100644 --- a/examples/sandbox_07_ruby_sinatra.py +++ b/examples/sandbox_07_ruby_sinatra.py @@ -47,6 +47,12 @@ async def main() -> None: runtime = ( os.getenv("SANDBOX_RUNTIME") or "node22" ) # note: ruby runtime is not supported so we have to install ruby via dnf + bundle_env = ( + "BUNDLE_APP_CONFIG=.bundle " + "BUNDLE_USER_HOME=.bundle-home " + "BUNDLE_PATH=vendor/bundle " + "BUNDLE_CACHE_PATH=vendor/cache" + ) # Sinatra default port is 4567 port = 4567 @@ -101,8 +107,10 @@ async def main() -> None: "-lc", ( f"cd {sandbox.sandbox.cwd} && " - "bundle config set --local path vendor/bundle && " - "bundle config set --local without 'development:test'" + "mkdir -p .bundle-home vendor/cache && " + f"{bundle_env} bundle config set --local path vendor/bundle && " + f"{bundle_env} bundle config set --local cache_path vendor/cache && " + f"{bundle_env} bundle config set --local without 'development:test'" ), ], ) @@ -118,7 +126,7 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {sandbox.sandbox.cwd} && bundle install --jobs 4 --retry 3"), + (f"cd {sandbox.sandbox.cwd} && {bundle_env} bundle install --jobs 4 --retry 3"), ], ) async for line in bundle_install_cmd.logs(): @@ -135,7 +143,8 @@ async def main() -> None: ( f"cd {sandbox.sandbox.cwd} && " # Start via rackup using WEBrick, binding to 0.0.0.0 and selected port - f"RACK_ENV=production bundle exec rackup -s webrick -o 0.0.0.0 -p {port}" + f"RACK_ENV=production {bundle_env} " + f"bundle exec rackup -s webrick -o 0.0.0.0 -p {port}" ), ], ) diff --git a/examples/sandbox_09_rails_api.py b/examples/sandbox_09_rails_api.py index 6a533cd..a7b9c33 100644 --- a/examples/sandbox_09_rails_api.py +++ b/examples/sandbox_09_rails_api.py @@ -41,6 +41,12 @@ async def main() -> None: runtime = ( os.getenv("SANDBOX_RUNTIME") or "node22" ) # note: ruby runtime is not supported so we install ruby via dnf + bundle_env = ( + "BUNDLE_APP_CONFIG=.bundle " + "BUNDLE_USER_HOME=.bundle-home " + "BUNDLE_PATH=vendor/bundle " + "BUNDLE_CACHE_PATH=vendor/cache" + ) # Rails default port is 3000 port = 3000 @@ -104,6 +110,7 @@ async def main() -> None: "--skip-action-cable " "--skip-system-test " "--skip-git " + "--skip-bundle " "--force" ), ], @@ -122,7 +129,12 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && bundle config set --local path vendor/bundle"), + ( + f"cd {app_path} && " + "mkdir -p .bundle-home vendor/cache && " + f"{bundle_env} bundle config set --local path vendor/bundle && " + f"{bundle_env} bundle config set --local cache_path vendor/cache" + ), ], ) async for line in bundler_cfg_cmd.logs(): @@ -137,7 +149,7 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && bundle install --jobs 4 --retry 3"), + (f"cd {app_path} && {bundle_env} bundle install --jobs 4 --retry 3"), ], ) async for line in bundle_install_cmd.logs(): @@ -154,7 +166,7 @@ async def main() -> None: "-lc", ( f"cd {app_path} && " - "bundle exec rails generate scaffold Post title:string body:text" + f"{bundle_env} bundle exec rails generate scaffold Post title:string body:text" ), ], ) @@ -183,7 +195,7 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && bundle exec rails db:migrate"), + (f"cd {app_path} && {bundle_env} bundle exec rails db:migrate"), ], ) async for line in migrate_cmd.logs(): @@ -198,7 +210,7 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && bundle exec rails db:seed"), + (f"cd {app_path} && {bundle_env} bundle exec rails db:seed"), ], ) async for line in seed_cmd.logs(): @@ -218,7 +230,8 @@ async def main() -> None: "-lc", ( f"cd {app_path} && " - f"ALLOWED_HOST={allowed_host} bundle exec rails server -b 0.0.0.0 -p {port}" + f"ALLOWED_HOST={allowed_host} {bundle_env} " + f"bundle exec rails server -b 0.0.0.0 -p {port}" ), ], ) From a904db9d51b15014e63b50a0707a249d4f7d30a0 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 25 Mar 2026 07:07:23 -0400 Subject: [PATCH 2/3] Use `env` dictionary --- examples/sandbox_07_ruby_sinatra.py | 24 ++++++++++--------- examples/sandbox_09_rails_api.py | 36 +++++++++++++++-------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/examples/sandbox_07_ruby_sinatra.py b/examples/sandbox_07_ruby_sinatra.py index fb99901..168fd7c 100644 --- a/examples/sandbox_07_ruby_sinatra.py +++ b/examples/sandbox_07_ruby_sinatra.py @@ -47,12 +47,12 @@ async def main() -> None: runtime = ( os.getenv("SANDBOX_RUNTIME") or "node22" ) # note: ruby runtime is not supported so we have to install ruby via dnf - bundle_env = ( - "BUNDLE_APP_CONFIG=.bundle " - "BUNDLE_USER_HOME=.bundle-home " - "BUNDLE_PATH=vendor/bundle " - "BUNDLE_CACHE_PATH=vendor/cache" - ) + bundle_env = { + "BUNDLE_APP_CONFIG": ".bundle", + "BUNDLE_USER_HOME": ".bundle-home", + "BUNDLE_PATH": "vendor/bundle", + "BUNDLE_CACHE_PATH": "vendor/cache", + } # Sinatra default port is 4567 port = 4567 @@ -108,11 +108,12 @@ async def main() -> None: ( f"cd {sandbox.sandbox.cwd} && " "mkdir -p .bundle-home vendor/cache && " - f"{bundle_env} bundle config set --local path vendor/bundle && " - f"{bundle_env} bundle config set --local cache_path vendor/cache && " - f"{bundle_env} bundle config set --local without 'development:test'" + "bundle config set --local path vendor/bundle && " + "bundle config set --local cache_path vendor/cache && " + "bundle config set --local without 'development:test'" ), ], + env=bundle_env, ) async for line in bundler_cfg_cmd.logs(): print(line.data, end="") @@ -126,8 +127,9 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {sandbox.sandbox.cwd} && {bundle_env} bundle install --jobs 4 --retry 3"), + (f"cd {sandbox.sandbox.cwd} && bundle install --jobs 4 --retry 3"), ], + env=bundle_env, ) async for line in bundle_install_cmd.logs(): print(line.data, end="") @@ -143,10 +145,10 @@ async def main() -> None: ( f"cd {sandbox.sandbox.cwd} && " # Start via rackup using WEBrick, binding to 0.0.0.0 and selected port - f"RACK_ENV=production {bundle_env} " f"bundle exec rackup -s webrick -o 0.0.0.0 -p {port}" ), ], + env={**bundle_env, "RACK_ENV": "production"}, ) # Stream logs and open browser once server is ready. diff --git a/examples/sandbox_09_rails_api.py b/examples/sandbox_09_rails_api.py index a7b9c33..19ec3e9 100644 --- a/examples/sandbox_09_rails_api.py +++ b/examples/sandbox_09_rails_api.py @@ -41,12 +41,12 @@ async def main() -> None: runtime = ( os.getenv("SANDBOX_RUNTIME") or "node22" ) # note: ruby runtime is not supported so we install ruby via dnf - bundle_env = ( - "BUNDLE_APP_CONFIG=.bundle " - "BUNDLE_USER_HOME=.bundle-home " - "BUNDLE_PATH=vendor/bundle " - "BUNDLE_CACHE_PATH=vendor/cache" - ) + bundle_env = { + "BUNDLE_APP_CONFIG": ".bundle", + "BUNDLE_USER_HOME": ".bundle-home", + "BUNDLE_PATH": "vendor/bundle", + "BUNDLE_CACHE_PATH": "vendor/cache", + } # Rails default port is 3000 port = 3000 @@ -132,10 +132,11 @@ async def main() -> None: ( f"cd {app_path} && " "mkdir -p .bundle-home vendor/cache && " - f"{bundle_env} bundle config set --local path vendor/bundle && " - f"{bundle_env} bundle config set --local cache_path vendor/cache" + "bundle config set --local path vendor/bundle && " + "bundle config set --local cache_path vendor/cache" ), ], + env=bundle_env, ) async for line in bundler_cfg_cmd.logs(): print(line.data, end="") @@ -149,8 +150,9 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && {bundle_env} bundle install --jobs 4 --retry 3"), + (f"cd {app_path} && bundle install --jobs 4 --retry 3"), ], + env=bundle_env, ) async for line in bundle_install_cmd.logs(): print(line.data, end="") @@ -166,9 +168,10 @@ async def main() -> None: "-lc", ( f"cd {app_path} && " - f"{bundle_env} bundle exec rails generate scaffold Post title:string body:text" + "bundle exec rails generate scaffold Post title:string body:text" ), ], + env=bundle_env, ) async for line in scaffold_cmd.logs(): print(line.data, end="") @@ -195,8 +198,9 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && {bundle_env} bundle exec rails db:migrate"), + (f"cd {app_path} && bundle exec rails db:migrate"), ], + env=bundle_env, ) async for line in migrate_cmd.logs(): print(line.data, end="") @@ -210,8 +214,9 @@ async def main() -> None: "bash", [ "-lc", - (f"cd {app_path} && {bundle_env} bundle exec rails db:seed"), + (f"cd {app_path} && bundle exec rails db:seed"), ], + env=bundle_env, ) async for line in seed_cmd.logs(): print(line.data, end="") @@ -228,12 +233,9 @@ async def main() -> None: "bash", [ "-lc", - ( - f"cd {app_path} && " - f"ALLOWED_HOST={allowed_host} {bundle_env} " - f"bundle exec rails server -b 0.0.0.0 -p {port}" - ), + (f"cd {app_path} && bundle exec rails server -b 0.0.0.0 -p {port}"), ], + env={**bundle_env, "ALLOWED_HOST": allowed_host}, ) # Stream logs and open browser once server is ready. From a8b2171adacdff13e771b402dedfaa01a490d242 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Wed, 25 Mar 2026 07:17:22 -0400 Subject: [PATCH 3/3] Try to fix missing `pip` Getting this new runtime error: * Creating isolated environment: venv+pip... * Installing packages in isolated environment: - setuptools>=61.0 > /home/runner/work/vercel-py/vercel-py/.venv/bin/python3 -m pip --python /tmp/build-env-3ee0ml40/bin/python install --use-pep517 --no-warn-script- location --no-compile -r /tmp/build-requirements-_p80z08g.txt < /home/runner/work/vercel-py/vercel-py/.venv/bin/python3: No module named pip ERROR Command '['/home/runner/work/vercel-py/vercel-py/.venv/bin/python3', '-m', 'pip', '--python', '/tmp/build-env-3ee0ml40/bin/python', 'install', '--use-pep517', '--no-warn-script-location', '--no-compile', '-r', '/tmp/build-requirements-_p80z08g.txt']' returned non-zero exit status 1. --- .github/workflows/publish.yml | 3 +-- scripts/build.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8037428..86c5917 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,7 +45,6 @@ jobs: python-version: "3.14" - uses: astral-sh/setup-uv@v3 - run: uv venv --python 3.14 - - run: uv pip install build - name: Create tag from version run: | VERSION=$(python scripts/get-version.py) @@ -66,6 +65,6 @@ jobs: TAG="v$VERSION" echo "Verifying tag $TAG matches version $VERSION" - name: Build - run: uv run python -m build + run: uv build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/scripts/build.sh b/scripts/build.sh index cab0c02..ccbaf5e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -euo pipefail -uv run python -m build +uv build