Skip to content

Commit 61630c4

Browse files
committed
get rid of prefix variables in sh
1 parent 6d121ea commit 61630c4

8 files changed

Lines changed: 1446 additions & 64 deletions

File tree

scripts/build

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
#!/bin/sh -e
22

3-
if [ -d 'venv' ] ; then
4-
PREFIX="venv/bin/"
5-
else
6-
PREFIX=""
7-
fi
8-
93
set -x
104

11-
${PREFIX}python -m build
12-
${PREFIX}twine check dist/*
13-
${PREFIX}mkdocs build
5+
uv run python -m build
6+
uv run twine check dist/*
7+
uv run mkdocs build

scripts/check

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
#!/bin/sh -e
22

3-
export PREFIX=""
4-
if [ -d 'venv' ] ; then
5-
export PREFIX="venv/bin/"
6-
fi
73
export SOURCE_FILES="httpx tests"
84

95
set -x
106

117
./scripts/sync-version
12-
${PREFIX}ruff format $SOURCE_FILES --diff
13-
${PREFIX}mypy $SOURCE_FILES
14-
${PREFIX}ruff check $SOURCE_FILES
8+
9+
echo "==> Checking formatting…"
10+
uv run ruff format $SOURCE_FILES --diff
11+
12+
echo "==> Running type checks and linting…"
13+
uv run mypy $SOURCE_FILES
14+
15+
echo "==> Running linting checks…"
16+
uv run ruff check $SOURCE_FILES

scripts/coverage

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
#!/bin/sh -e
22

3-
export PREFIX=""
4-
if [ -d 'venv' ] ; then
5-
export PREFIX="venv/bin/"
6-
fi
73
export SOURCE_FILES="httpx tests"
84

95
set -x
106

11-
${PREFIX}coverage report --show-missing --skip-covered --fail-under=100
7+
uv run coverage report --show-missing --skip-covered --fail-under=100

scripts/docs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/bin/sh -e
22

3-
export PREFIX=""
4-
if [ -d 'venv' ] ; then
5-
export PREFIX="venv/bin/"
6-
fi
7-
83
set -x
94

10-
${PREFIX}mkdocs serve
5+
uv run mkdocs serve

scripts/lint

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/sh -e
22

3-
export PREFIX=""
4-
if [ -d 'venv' ]; then
5-
export PREFIX="venv/bin/"
6-
fi
73
export SOURCE_FILES="httpx tests"
84

95
set -x
106

11-
${PREFIX}ruff check --fix $SOURCE_FILES
12-
${PREFIX}ruff format $SOURCE_FILES
7+
echo "==> Running linting checks…"
8+
uv run ruff check --fix $SOURCE_FILES
9+
10+
echo "==> Formatting source code…"
11+
uv run ruff format $SOURCE_FILES

scripts/publish

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
VERSION_FILE="httpx/__version__.py"
44

5-
if [ -d 'venv' ] ; then
6-
PREFIX="venv/bin/"
7-
else
8-
PREFIX=""
9-
fi
105

116
if [ ! -z "$GITHUB_ACTIONS" ]; then
127
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
@@ -22,5 +17,5 @@ fi
2217

2318
set -x
2419

25-
${PREFIX}twine upload dist/*
26-
${PREFIX}mkdocs gh-deploy --force
20+
uv run twine upload dist/*
21+
uv run mkdocs gh-deploy --force

tests/test_content.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,18 @@ def test_response_invalid_argument():
489489
def test_ensure_ascii_false_with_french_characters():
490490
data = {"greeting": "Bonjour, ça va ?"}
491491
response = httpx.Response(200, json=data)
492-
assert (
493-
"ça va" in response.text
494-
), "ensure_ascii=False should preserve French accented characters"
492+
assert "ça va" in response.text, (
493+
"ensure_ascii=False should preserve French accented characters"
494+
)
495495
assert response.headers["Content-Type"] == "application/json"
496496

497497

498498
def test_separators_for_compact_json():
499499
data = {"clé": "valeur", "liste": [1, 2, 3]}
500500
response = httpx.Response(200, json=data)
501-
assert (
502-
response.text == '{"clé":"valeur","liste":[1,2,3]}'
503-
), "separators=(',', ':') should produce a compact representation"
501+
assert response.text == '{"clé":"valeur","liste":[1,2,3]}', (
502+
"separators=(',', ':') should produce a compact representation"
503+
)
504504
assert response.headers["Content-Type"] == "application/json"
505505

506506

uv.lock

Lines changed: 1419 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)