GeezerVison is showing github.com — Python: switch to uv package manager (formerly: pdm) (#62951) · code-dot-org/code-dot-org@633a07e
File treeExpand file treeCollapse file tree Open diff view settings integration/default/inspec
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .drone.yml +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 82 | 82 | - name: unit-tests | 83 | 83 | # see: docker/ci/Dockerfile | 84 | 84 | # TODO: switch to codedotorg/cdo-ci | 85 | | - image: codedotorg/code-dot-org:1.11.1 | | 85 | + image: codedotorg/code-dot-org:1.14 | 86 | 86 | pull: always | 87 | 87 | volumes: | 88 | 88 | - name: rbenv | @@ -215,7 +215,7 @@ steps: | 215 | 215 | - name: ui-tests | 216 | 216 | # see: docker/ci/Dockerfile | 217 | 217 | # TODO: switch to codedotorg/cdo-ci | 218 | | - image: codedotorg/code-dot-org:1.11.1 | | 218 | + image: codedotorg/code-dot-org:1.14 | 219 | 219 | pull: always | 220 | 220 | volumes: | 221 | 221 | - name: rbenv | @@ -316,6 +316,6 @@ trigger: | 316 | 316 | - push | 317 | 317 | --- | 318 | 318 | kind: signature | 319 | | -hmac: 38a0cef75d2449a37668b441e20c4d71ab55a1809191b792fc7b2e6297f57ddb | | 319 | +hmac: 438911a0c59ad180adae90c55e5bf3f15713df10458caf0f44347f7fff00eb4c | 320 | 320 |
| 321 | 321 | ... |
Collapse file Copy file name to clipboardExpand all lines: .gitignore +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -101,5 +101,6 @@ npm-debug.log | 101 | 101 | /i18n/locales/*/standards/ | 102 | 102 | /i18n/locales/*/docs/ | 103 | 103 |
| 104 | | -# Specifies the user-specific path to the venv for pdm | | 104 | +# python venv: | | 105 | +.venv | 105 | 106 | .pdm-python |
Collapse file Copy file name to clipboardExpand all lines: SETUP.md +5-5Lines changed: 5 additions & 5 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ You can do Code.org development using macOS, Ubuntu, or Windows (running Ubuntu | 24 | 24 | ruby --version # --> ruby 3.0.5 | 25 | 25 | node --version # --> v18.16.0 | 26 | 26 | git-lfs --version # >= git-lfs/3.0 | 27 | | - pdm --version # >= 2.17 | | 27 | + uv --version # >= 0.5.8 | 28 | 28 | ``` | 29 | 29 |
| 30 | 30 | 1. `git lfs pull` | @@ -118,7 +118,7 @@ These steps are for Apple devices running **macOS 14.x**, including those runnin | 118 | 118 |
| 119 | 119 | 1. Install **brew packages**: | 120 | 120 | ``` | 121 | | - brew install rbenv ruby-build nvm pdm [email protected] redis git-lfs enscript gs imagemagick coreutils parallel tidy-html5 openssl libffi pdftk-java | | 121 | + brew install rbenv ruby-build nvm uv [email protected] redis git-lfs enscript gs imagemagick coreutils parallel tidy-html5 openssl libffi pdftk-java | 122 | 122 | ``` | 123 | 123 |
| 124 | 124 | 1. Initialize **Git LFS**: | @@ -250,9 +250,9 @@ Note: Virtual Machine Users should check the [Alternative note](#alternative-use | 250 | 250 | 1. If your PATH is missing `~/.rbenv/shims`, the next two commands might not work. Edit your .bashrc to include the following line: | 251 | 251 | `export PATH="$HOME/.rbenv/bin:~/.rbenv/shims:$PATH"`, then run `source .bashrc` for the change to take effect (as seen in [this github issue](https://github.com/rbenv/rbenv/issues/877)). | 252 | 252 | 1. `rbenv rehash` | 253 | | -1. Install pdm, which will be used later by `rake install` to install python | 254 | | - 1. `sudo pip3 install --prefix=/usr/local --upgrade pdm` | 255 | | - - alternatively, if you prefer pipx and have it configured path-wise: `pipx install pdm` | | 253 | +1. Install uv, which will be used later by `rake install` to install python | | 254 | + 1. `curl -LsSf https://astral.sh/uv/install.sh | sh` | | 255 | + - alternatively, if you prefer pipx and have it configured path-wise: `pipx install uv` | 256 | 256 | 1. Enable **corepack** to install **yarn**: `corepack enable` | 257 | 257 | 1. Make it so that you can run apps tests locally | 258 | 258 | 1. Add the following to `~/.bashrc` or your desired shell configuration file: | |
Collapse file Copy file name to clipboard +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -apt_package 'python3-pip' | | 1 | +apt_package 'curl' | 2 | 2 |
| 3 | | -execute 'install pdm' do | 4 | | - command 'pip install --system --prefix=/usr/local pdm' | 5 | | - not_if 'pip show pdm' | | 3 | +execute 'install uv' do | | 4 | + # By default uv's install.sh will install to the user's homedir and modify the user's PATH. | | 5 | + # Instead we wish to install uv to /usr/local/bin, which is already in the PATH. | | 6 | + command 'curl -LsSf https://astral.sh/uv/0.5.18/install.sh | XDG_BIN_HOME=/usr/local/bin UV_NO_MODIFY_PATH=1 sh' | | 7 | + not_if 'which uv' | 6 | 8 | end |
Collapse file Copy file name to clipboard +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -describe command('which pdm') do | 2 | | - its('exit_status') {should eq 0} | 3 | | -end | | 1 | +require_relative '../../../shared/helper_spec' | | 2 | + | | 3 | +file_exist '/usr/local/bin/uv' | | 4 | +cmd 'uv --version', '0.5.18' |
Collapse file Copy file name to clipboard +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +def file_not_exist(file) | | 2 | + describe file(file) do | | 3 | + it {should_not exist} | | 4 | + end | | 5 | +end | | 6 | + | | 7 | +def file_exist(file) | | 8 | + describe file(file) do | | 9 | + it {should exist} | | 10 | + end | | 11 | +end | | 12 | + | | 13 | +def cmd(exec, match) | | 14 | + describe command(exec) do | | 15 | + its(:stdout) {should match match} | | 16 | + end | | 17 | +end |
Collapse file Copy file name to clipboardExpand all lines: docker/ci/Dockerfile +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -190,8 +190,11 @@ RUN curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.4/fixuid-0. | 190 | 190 | mkdir -p /etc/fixuid && \ | 191 | 191 | printf "user: ${USER}\ngroup: ${GROUP}\n" > /etc/fixuid/config.yml | 192 | 192 |
| 193 | | -# install pdm for managing our python dependencies | 194 | | -RUN pip install --system --prefix=/usr/local pdm | | 193 | +# install uv for managing our python dependencies | | 194 | +# | | 195 | +# By default uv's install.sh will install to the user's homedir and modify the user's PATH. | | 196 | +# Instead we wish to install uv to /usr/local/bin, which is already in the PATH. | | 197 | +RUN curl -LsSf https://astral.sh/uv/0.5.18/install.sh | XDG_BIN_HOME=/usr/local/bin UV_NO_MODIFY_PATH=1 sh | 195 | 198 |
| 196 | 199 | # install sc, the sauce connect proxy for running UI tests | 197 | 200 | RUN mkdir sauce_connect && \ | |
Collapse file Copy file name to clipboardExpand all lines: docker/setup-compose.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ version: "3" | 14 | 14 | services: | 15 | 15 | site: | 16 | 16 | # TODO: switch to codedotorg/cdo-ci or other new image | 17 | | - image: codedotorg/code-dot-org:1.11.1 | | 17 | + image: codedotorg/code-dot-org:1.14 | 18 | 18 | user: ${FIXUID:-1000}:${FIXGID:-1000} | 19 | 19 | volumes: | 20 | 20 | - ../:/home/ci/code-dot-org:delegated | |
Collapse file Copy file name to clipboardExpand all lines: docker/site-compose.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,7 @@ version: "3" | 17 | 17 | services: | 18 | 18 | site: | 19 | 19 | # TODO: switch to codedotorg/cdo-ci or other new image | 20 | | - image: codedotorg/code-dot-org:1.11.1 | | 20 | + image: codedotorg/code-dot-org:1.14 | 21 | 21 | user: ${FIXUID:-1000}:${FIXGID:-1000} | 22 | 22 | volumes: | 23 | 23 | - ../:/home/ci/code-dot-org:delegated | |
Collapse file Copy file name to clipboardExpand all lines: docker/ui-tests-compose.yml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -23,7 +23,7 @@ version: "3" | 23 | 23 | services: | 24 | 24 | site: | 25 | 25 | # TODO: switch to codedotorg/cdo-ci or other new image | 26 | | - image: codedotorg/code-dot-org:1.11.1 | | 26 | + image: codedotorg/code-dot-org:1.14 | 27 | 27 | user: ${FIXUID:-1000}:${FIXGID:-1000} | 28 | 28 | volumes: | 29 | 29 | - ../:/home/ci/code-dot-org:delegated | |
|