Skip to content

Commit 6ef5ad4

Browse files
authored
Minor bug fixes (#411)
* Pin C4AI versions * Update CLI docs to automatically pull in new commands * Minor update to explanation for clarity * Add encodings when reading/writing CSV * Update elm dep * Update lockfile * Update lockfile * Fix test * Fix doc build * PR comment * PR review * Fix deps * Use hashes * Add permissions
1 parent a3950d8 commit 6ef5ad4

18 files changed

Lines changed: 9521 additions & 9425 deletions

File tree

.github/workflows/ci-python.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29-
- uses: astral-sh/ruff-action@v3
29+
- uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
3030
with:
3131
version: "latest"
3232
args: "check"
3333
src: "./compass"
34-
- uses: astral-sh/ruff-action@v3
34+
- uses: astral-sh/ruff-action@0ce1b0bf8b818ef400413f810f8a11cdbda0034b # v4.0.0
3535
with:
3636
version: "latest"
3737
args: "format --check"
@@ -52,7 +52,7 @@ jobs:
5252
fetch-depth: 0
5353
fetch-tags: true
5454

55-
- uses: prefix-dev/setup-pixi@v0.9.5
55+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
5656
with:
5757
pixi-version: v0.62.2
5858
locked: true
@@ -81,7 +81,7 @@ jobs:
8181
fetch-depth: 0
8282
fetch-tags: true
8383

84-
- uses: prefix-dev/setup-pixi@v0.9.5
84+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
8585
with:
8686
pixi-version: v0.62.2
8787
locked: true
@@ -110,7 +110,7 @@ jobs:
110110
fetch-depth: 0
111111
fetch-tags: true
112112

113-
- uses: prefix-dev/setup-pixi@v0.9.5
113+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
114114
with:
115115
pixi-version: v0.62.2
116116
locked: true
@@ -141,14 +141,14 @@ jobs:
141141

142142
- name: Set up Python ${{ matrix.python-version }} (with cache)
143143
if: github.ref == 'refs/heads/main'
144-
uses: actions/setup-python@v6
144+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
145145
with:
146146
python-version: ${{ matrix.python-version }}
147147
cache: 'pip'
148148

149149
- name: Set up Python ${{ matrix.python-version }} (no cache)
150150
if: github.ref != 'refs/heads/main'
151-
uses: actions/setup-python@v6
151+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
152152
with:
153153
python-version: ${{ matrix.python-version }}
154154

@@ -172,7 +172,7 @@ jobs:
172172
python -m pip install pdftotext
173173
174174
- name: Load tox cache
175-
uses: actions/cache/restore@v5
175+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
176176
with:
177177
path: .tox/
178178
key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }}
@@ -186,7 +186,7 @@ jobs:
186186

187187
- name: Save tox cache only on main
188188
if: github.ref == 'refs/heads/main'
189-
uses: actions/cache/save@v5
189+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
190190
with:
191191
path: .tox/
192192
key: ${{ runner.os }}-${{ matrix.python-version }}-tox-v1-${{ hashFiles('**/pyproject.toml') }}

.github/workflows/ci-rust.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ jobs:
3232
- name: Checkout sources
3333
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434

35-
- uses: prefix-dev/setup-pixi@v0.9.5
35+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
3636
with:
3737
pixi-version: v0.62.2
3838
frozen: true
3939
cache: true
4040
cache-write: ${{ github.ref == 'refs/heads/main' }}
4141
environments: rdev
4242

43-
- uses: Swatinem/rust-cache@v2
43+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
4444
with:
4545
shared-key: "gha"
4646
# Don't save cache for cargo check!
@@ -59,15 +59,15 @@ jobs:
5959
- name: Checkout sources
6060
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6161

62-
- uses: prefix-dev/setup-pixi@v0.9.5
62+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
6363
with:
6464
pixi-version: v0.62.2
6565
frozen: true
6666
cache: true
6767
cache-write: ${{ github.ref == 'refs/heads/main' }}
6868
environments: rdev
6969

70-
- uses: Swatinem/rust-cache@v2
70+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
7171
with:
7272
shared-key: "gha"
7373
# Don't save cache for cargo fmt or clippy!
@@ -94,15 +94,15 @@ jobs:
9494
steps:
9595
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9696

97-
- uses: prefix-dev/setup-pixi@v0.9.5
97+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
9898
with:
9999
pixi-version: v0.62.2
100100
frozen: true
101101
cache: true
102102
cache-write: ${{ github.ref == 'refs/heads/main' }}
103103
environments: rdev
104104

105-
- uses: Swatinem/rust-cache@v2
105+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
106106
with:
107107
shared-key: "gha"
108108
save-if: ${{ github.ref == 'refs/heads/main' }}
@@ -127,15 +127,15 @@ jobs:
127127
- name: Checkout sources
128128
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
129129

130-
- uses: prefix-dev/setup-pixi@v0.9.5
130+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
131131
with:
132132
pixi-version: v0.62.2
133133
frozen: true
134134
cache: true
135135
cache-write: ${{ github.ref == 'refs/heads/main' }}
136136
environments: rdev
137137

138-
- uses: Swatinem/rust-cache@v2
138+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
139139
with:
140140
shared-key: "gha"
141141
save-if: false
@@ -158,15 +158,15 @@ jobs:
158158
- name: Checkout sources
159159
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
160160

161-
- uses: prefix-dev/setup-pixi@v0.9.5
161+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
162162
with:
163163
pixi-version: v0.62.2
164164
frozen: true
165165
cache: true
166166
cache-write: ${{ github.ref == 'refs/heads/main' }}
167167
environments: rdev
168168

169-
- uses: Swatinem/rust-cache@v2
169+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
170170
with:
171171
shared-key: "gha"
172172
save-if: false
@@ -187,15 +187,15 @@ jobs:
187187
- name: Checkout sources
188188
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
189189

190-
- uses: prefix-dev/setup-pixi@v0.9.5
190+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
191191
with:
192192
pixi-version: v0.62.2
193193
frozen: true
194194
cache: true
195195
cache-write: ${{ github.ref == 'refs/heads/main' }}
196196
environments: rdev
197197

198-
- uses: Swatinem/rust-cache@v2
198+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
199199
with:
200200
shared-key: "gha"
201201
save-if: false

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
fetch-depth: 0
3131
fetch-tags: true
3232

33-
- uses: prefix-dev/setup-pixi@v0.9.5
33+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
3434
with:
3535
pixi-version: v0.62.2
3636
locked: true
@@ -44,7 +44,7 @@ jobs:
4444
pixi run -e pdev --locked tests-p
4545
4646
- name: Upload coverage to Codecov
47-
uses: codecov/codecov-action@v6
47+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
4848
with:
4949
token: ${{ secrets.CODECOV_TOKEN }}
5050
files: ./coverage.xml

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434

3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@v4
36+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
3737
with:
3838
languages: ${{ matrix.language }}
3939
build-mode: ${{ matrix.build-mode }}
4040

4141
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@v4
42+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4
4343
with:
4444
category: "/language:${{matrix.language}}"

.github/workflows/docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release Documentation
22

3-
permissions: write-all
3+
permissions:
4+
contents: write
45

56
on:
67
pull_request:
@@ -34,7 +35,7 @@ jobs:
3435
fetch-depth: 0
3536
fetch-tags: true
3637

37-
- uses: prefix-dev/setup-pixi@v0.9.5
38+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
3839
with:
3940
pixi-version: v0.62.2
4041
locked: true
@@ -45,7 +46,7 @@ jobs:
4546
run: pixi run -e pdoc python-docs # This errors on warnings
4647

4748
- name: deploy
48-
uses: peaceiris/actions-gh-pages@v4.0.0
49+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
4950
if: startsWith(github.ref, 'refs/tags/v')
5051
with:
5152
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish_to_pypi.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fetch-depth: 0
2222
fetch-tags: true
2323

24-
- uses: prefix-dev/setup-pixi@v0.9.5
24+
- uses: prefix-dev/setup-pixi@1b2de7f3351f171c8b4dfeb558c639cb58ed4ec0 # v0.9.5
2525
with:
2626
pixi-version: v0.62.2
2727
locked: true
@@ -32,4 +32,5 @@ jobs:
3232
run: pixi run -e pbuild build-wheels
3333

3434
- name: Publish package distributions to PyPI
35-
uses: pypa/gh-action-pypi-publish@release/v1
35+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.14.0
36+

.github/workflows/release-cli.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ on:
66
- 'c*.*.*'
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
publish:
1114
name: ${{ matrix.target }}
15+
permissions:
16+
contents: write
1217
runs-on: ${{ matrix.os }}
1318
strategy:
1419
fail-fast: false
@@ -38,7 +43,7 @@ jobs:
3843
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3944

4045
- name: Install Rust
41-
uses: actions-rs/toolchain@v1
46+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.6
4247
with:
4348
toolchain: stable
4449
profile: minimal
@@ -62,7 +67,7 @@ jobs:
6267
fi
6368
6469
- name: Build
65-
uses: actions-rs/cargo@v1
70+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.6
6671
with:
6772
use-cross: ${{ matrix.use-cross }}
6873
command: build
@@ -73,7 +78,7 @@ jobs:
7378
run: ${{ matrix.strip }} target/${{ matrix.target }}/release/infra-compass-cli${{ matrix.binary_ext }}
7479

7580
- name: Upload binaries to release
76-
uses: svenstaro/upload-release-action@v2
81+
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # v2.11.5
7782
with:
7883
repo_token: ${{ secrets.GITHUB_TOKEN }}
7984
file: target/${{ matrix.target }}/release/infra-compass-cli${{ matrix.binary_ext }}

compass/_cli/finalize.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"-c",
2020
required=True,
2121
type=click.Path(exists=True),
22-
help="Path to ordinance configuration JSON or JSON5 file. This file "
22+
help="Path to COMPASS run configuration JSON or JSON5 file. This file "
2323
"should contain any/all the arguments to pass to "
24-
":func:`compass.scripts.process.process_jurisdictions_with_openai`."
25-
"The directory that this config points to will be finalized.",
24+
":func:`compass.scripts.process.process_jurisdictions_with_openai`. "
25+
"The output directory that this config points to will be finalized.",
2626
)
2727
def finalize(config):
2828
"""Finalize a partially-completed COMPASS run"""

compass/extraction/water/plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def save_structured_data(cls, doc_infos, out_dir):
248248
"""
249249
db = []
250250
for doc_info in doc_infos:
251-
ord_db = pd.read_csv(doc_info["ord_db_fp"])
251+
ord_db = pd.read_csv(doc_info["ord_db_fp"], encoding="utf-8-sig")
252252
if len(ord_db) == 0:
253253
continue
254254

@@ -265,7 +265,11 @@ def save_structured_data(cls, doc_infos, out_dir):
265265
return 0
266266

267267
db = pd.concat([df.dropna(axis=1, how="all") for df in db], axis=0)
268-
db.to_csv(Path(out_dir) / "water_rights.csv", index=False)
268+
db.to_csv(
269+
Path(out_dir) / "water_rights.csv",
270+
index=False,
271+
encoding="utf-8-sig",
272+
)
269273
return len(db["WCD_ID"].unique())
270274

271275

compass/services/threaded.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _write_ord_db(extraction_context, out_dir, out_fn=None):
9898
return None
9999

100100
out_fp = Path(out_dir) / out_fn
101-
ord_db.to_csv(out_fp, index=False)
101+
ord_db.to_csv(out_fp, index=False, encoding="utf-8-sig")
102102
return out_fp
103103

104104

0 commit comments

Comments
 (0)