Skip to content

Commit aa0397a

Browse files
authored
Fix format script (#918)
* remove version check for `pipx` Does not appear needed. `pkg_resources` is removed in Python 3.12 * add `MONGOCRYPT_PYTHON` to use a specified python install * add a CONTRIBUTING.md
1 parent 588f33a commit aa0397a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.evergreen/init.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ run_ctest() {
222222

223223
run_python() {
224224
pys=(
225+
"${MONGOCRYPT_PYTHON:-}"
225226
py
226227
python3.14
227228
python3.13

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Formatting
2+
3+
To format, install `pipx` and run:
4+
```bash
5+
./etc/format-all.sh
6+
```
7+
8+
To use a specified python install, set `MONGOCRYPT_PYTHON`:
9+
10+
```bash
11+
# Set MONGOCRYPT_PYTHON to a python install with pipx installed.
12+
export MONGOCRYPT_PYTHON=python
13+
./etc/format-all.sh
14+
```

etc/format.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ if ! run_python -c ''; then
99
fail "No Python found?"
1010
fi
1111

12-
# Check that we have a pipx of the proper version:
13-
run_python -c 'import pkg_resources; pkg_resources.require("pipx>=0.17.0,<2.0")'
1412

1513
# Give default clang-format an empty string on stdin if there are no inputs files
1614
printf '' | run_python -m pipx run "clang-format==${CLANG_FORMAT_VERSION:?}" "$@"

0 commit comments

Comments
 (0)