Repository navigation
Move from pipenv to uv #286
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
Changes from all commits
234abb0
f263d1a
75347c5
682484b
f4e4b63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,4 +19,5 @@ tests | |
| assets/data/OneBuilding*.zip | ||
|
|
||
| assets/data/Region*.kml | ||
| file_system_store | ||
| file_system_store | ||
| .venv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,33 +11,30 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v10.3.1 | ||
|
|
||
| - name: Build Clima | ||
| run: |- | ||
| pip install pipenv | ||
| pipenv install --dev | ||
| uv sync --frozen | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Reject an outdated lockfile in CI. If a dependency changes in Based on learnings, a changed CI dependency step needs an equivalent manifest/lockfile consistency assertion. 🧰 Tools
🤖 Prompt for AI Agents
Source: Learnings |
||
|
|
||
| - name: Ruff Check | ||
| run: |- | ||
| pipenv run ruff check . --output-format=github | ||
| uv run ruff check . --output-format=github | ||
|
|
||
| - name: Ruff Format (verify) | ||
| run: |- | ||
| pipenv run ruff format --check . | ||
| uv run ruff format --check . | ||
|
|
||
| - name: Install Playwright Browsers | ||
| run: | | ||
| pipenv run playwright install chromium | ||
| uv run playwright install chromium | ||
|
|
||
| - name: Start Clima | ||
| run: |- | ||
| pipenv run python main.py & | ||
| uv run python main.py & | ||
|
|
||
| - name: Wait for Clima to be ready | ||
| run: | | ||
|
|
@@ -46,4 +43,4 @@ jobs: | |
| - name: Test Clima | ||
| run: |- | ||
| cd tests | ||
| pipenv run pytest --base-url=http://127.0.0.1:8080 -vv | ||
| uv run pytest --base-url=http://127.0.0.1:8080 -vv | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 3.10 | ||
| 3.11 |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Adds the CARTO vector basemap, drawn by MapLibre GL, to every Leaflet map | ||
| // whose container has the "carto-basemap" class (set via dl.Map(className=...)). | ||
| // MapLibre and its Leaflet plugin are only loaded once such a map is created. | ||
| // dash-leaflet's own "load" event fires before custom handlers are bound, | ||
| // so we use a Leaflet init hook instead. | ||
| (function () { | ||
| const MAPLIBRE = "https://cdn.jsdelivr.net/npm/maplibre-gl@4.7.1/dist/maplibre-gl"; | ||
| const PLUGIN = "https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-leaflet@0.0.22/leaflet-maplibre-gl.js"; | ||
| const STYLE = "/basemap/positron.json"; | ||
| const ATTRIBUTION = | ||
| '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>' + | ||
| ' contributors © <a href="https://carto.com/">CARTO</a>'; | ||
| let loading = null; | ||
|
|
||
| function loadScript(src) { | ||
| return new Promise(function (resolve, reject) { | ||
| const script = document.createElement("script"); | ||
| script.src = src; | ||
| script.onload = resolve; | ||
| script.onerror = reject; | ||
| document.head.appendChild(script); | ||
| }); | ||
| } | ||
|
|
||
| function loadMapLibre() { | ||
| if (!loading) { | ||
| const css = document.createElement("link"); | ||
| css.rel = "stylesheet"; | ||
| css.href = MAPLIBRE + ".css"; | ||
| document.head.appendChild(css); | ||
| loading = loadScript(MAPLIBRE + ".js").then(function () { | ||
| return loadScript(PLUGIN); | ||
| }); | ||
| } | ||
| return loading; | ||
| } | ||
|
|
||
| if (!window.L) { | ||
| return; | ||
| } | ||
| L.Map.addInitHook(function () { | ||
| const map = this; | ||
| if (!map.getContainer().classList.contains("carto-basemap")) { | ||
| return; | ||
| } | ||
| loadMapLibre().then(function () { | ||
| L.maplibreGL({ style: STYLE, attribution: ATTRIBUTION }).addTo(map); | ||
| }); | ||
| }); | ||
| })(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: CenterForTheBuiltEnvironment/clima
Length of output: 4845
Disable persisted checkout credentials in both workflows.
The
pull_requesttrigger runs checked-out code from pull requests targetingdevelopment.actions/checkoutcurrently persists the GitHub token, so commands run throughuv runcan access it. Set read-only contents permission and disable credential persistence. The deploy workflow also has no later step that requires a writable checkout token.Suggested fix
🧰 Tools
🪛 zizmor (1.30.1)
[warning] 13-14: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 10-47: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
Source: Linters/SAST tools