From 4776de0f266a6c7470a167bb5d9c41e2d3b018e5 Mon Sep 17 00:00:00 2001 From: Buck Evan Date: Tue, 18 Feb 2025 14:44:56 -0600 Subject: [PATCH 1/2] touch up envrc, venv creation I needed these changes when checking out devservices for the first time. --- .envrc | 16 ++++++---------- lib/make/venv | 7 +++++++ requirements.txt | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) create mode 100755 lib/make/venv diff --git a/.envrc b/.envrc index d30a4028..39e841dc 100644 --- a/.envrc +++ b/.envrc @@ -1,16 +1,12 @@ #!/bin/bash # shellcheck disable=SC1091 if [[ -f .env ]]; then - dotenv .env + dotenv .env fi -if [ ! -d .venv ]; then - echo "warning: creating virtualenv for the first time" - python3 -m venv .venv - source .venv/bin/activate - pip install -r requirements.txt - pip install -r requirements-dev.txt -else - source .venv/bin/activate - unset PS1 +export REPO=$PWD +export VIRTUAL_ENV=$REPO/.venv +path_add PATH $VIRTUAL_ENV/bin +if [ ! -x "$VIRTUAL_ENV/bin/devservices" ]; then + printf >&2 '\033[33mNOTE: please run `make`\033[m' fi diff --git a/lib/make/venv b/lib/make/venv new file mode 100755 index 00000000..814ffb48 --- /dev/null +++ b/lib/make/venv @@ -0,0 +1,7 @@ +#!/bin/bash +set -euxo pipefail +rm -rf venv .venv.tmp +python3 -m venv .venv.tmp +./.venv.tmp/bin/pip install -e '.[dev]' -c requirements.txt -c requirements-dev.txt +mv .venv.tmp .venv +python3 -m venv .venv # handle relocation diff --git a/requirements.txt b/requirements.txt index 7f1ae871..889d7d52 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ --index-url https://pypi.devinfra.sentry.io/simple -pyyaml==6.0.1 +pyyaml==6.0.2 packaging==24.0 sentry-devenv==1.8.0 sentry-sdk==2.20.0 From 21c07913065f0ce45cd4542ec9d95b86427bf6ba Mon Sep 17 00:00:00 2001 From: Buck Evan Date: Tue, 18 Feb 2025 14:48:50 -0600 Subject: [PATCH 2/2] upgrade actions/cache In order to prevent this error: Error: This request has been automatically failed because it uses a deprecated version of `actions/cache: ab5e6d0c87105b4c9c2047343972218f562e4319`. Please update your workflow to use v3/v4 of actions/cache to avoid interruptions. Learn more: https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 420cabe1..7c14454a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: run: python -m build - name: Cache dist - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: dist key: devservices-dist-${{ github.sha }} @@ -70,12 +70,11 @@ jobs: cp $BINARY_PATH binaries/${{ matrix.asset_name }} - name: Cache binary - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: binaries/${{ matrix.asset_name }} key: ${{ matrix.asset_name }}-${{ github.sha }} - upload-artifacts: name: Upload build artifacts runs-on: ubuntu-22.04 @@ -83,19 +82,19 @@ jobs: if: github.event_name != 'pull_request' steps: - name: Restore dist cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: dist key: devservices-dist-${{ github.sha }} - name: Restore Linux binary cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: binaries/devservices-linux key: devservices-linux-${{ github.sha }} - name: Restore macOS binary cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1 with: path: binaries/devservices-darwin key: devservices-darwin-${{ github.sha }}