get rid of prefix variables in sh

This commit is contained in:
Kar Petrosyan 2025-12-10 17:41:54 +04:00
parent 6d121eae8d
commit 61630c4a4b
8 changed files with 1448 additions and 66 deletions

View File

@ -1,13 +1,7 @@
#!/bin/sh -e
if [ -d 'venv' ] ; then
PREFIX="venv/bin/"
else
PREFIX=""
fi
set -x
${PREFIX}python -m build
${PREFIX}twine check dist/*
${PREFIX}mkdocs build
uv run python -m build
uv run twine check dist/*
uv run mkdocs build

View File

@ -1,14 +1,16 @@
#!/bin/sh -e
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="httpx tests"
set -x
./scripts/sync-version
${PREFIX}ruff format $SOURCE_FILES --diff
${PREFIX}mypy $SOURCE_FILES
${PREFIX}ruff check $SOURCE_FILES
echo "==> Checking formatting…"
uv run ruff format $SOURCE_FILES --diff
echo "==> Running type checks and linting…"
uv run mypy $SOURCE_FILES
echo "==> Running linting checks…"
uv run ruff check $SOURCE_FILES

View File

@ -1,11 +1,7 @@
#!/bin/sh -e
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="httpx tests"
set -x
${PREFIX}coverage report --show-missing --skip-covered --fail-under=100
uv run coverage report --show-missing --skip-covered --fail-under=100

View File

@ -1,10 +1,5 @@
#!/bin/sh -e
export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
set -x
${PREFIX}mkdocs serve
uv run mkdocs serve

View File

@ -1,12 +1,11 @@
#!/bin/sh -e
export PREFIX=""
if [ -d 'venv' ]; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="httpx tests"
set -x
${PREFIX}ruff check --fix $SOURCE_FILES
${PREFIX}ruff format $SOURCE_FILES
echo "==> Running linting checks…"
uv run ruff check --fix $SOURCE_FILES
echo "==> Formatting source code…"
uv run ruff format $SOURCE_FILES

View File

@ -2,11 +2,6 @@
VERSION_FILE="httpx/__version__.py"
if [ -d 'venv' ] ; then
PREFIX="venv/bin/"
else
PREFIX=""
fi
if [ ! -z "$GITHUB_ACTIONS" ]; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
@ -22,5 +17,5 @@ fi
set -x
${PREFIX}twine upload dist/*
${PREFIX}mkdocs gh-deploy --force
uv run twine upload dist/*
uv run mkdocs gh-deploy --force

View File

@ -489,18 +489,18 @@ def test_response_invalid_argument():
def test_ensure_ascii_false_with_french_characters():
data = {"greeting": "Bonjour, ça va ?"}
response = httpx.Response(200, json=data)
assert (
"ça va" in response.text
), "ensure_ascii=False should preserve French accented characters"
assert "ça va" in response.text, (
"ensure_ascii=False should preserve French accented characters"
)
assert response.headers["Content-Type"] == "application/json"
def test_separators_for_compact_json():
data = {"clé": "valeur", "liste": [1, 2, 3]}
response = httpx.Response(200, json=data)
assert (
response.text == '{"clé":"valeur","liste":[1,2,3]}'
), "separators=(',', ':') should produce a compact representation"
assert response.text == '{"clé":"valeur","liste":[1,2,3]}', (
"separators=(',', ':') should produce a compact representation"
)
assert response.headers["Content-Type"] == "application/json"

1441
uv.lock generated

File diff suppressed because it is too large Load Diff