Skip to content

Commit 85c1321

Browse files
reduce stuff done for linting
1 parent 544fd7c commit 85c1321

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

ci/input_files/build.yaml.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ lint python:
6767
image: registry.ddbuild.io/images/mirror/python:{{ $runtime.image }}
6868
cache: &{{ $runtime.name }}-{{ $runtime.arch }}-cache
6969
before_script:
70-
- PYTHON_VERSION={{ $runtime.python_version }} ARCH={{ $runtime.arch }} ./scripts/setup_python_env.sh
70+
- PYTHON_VERSION={{ $runtime.python_version }} ARCH={{ $runtime.arch }} IS_LINT="1" ./scripts/setup_python_env.sh
7171
script:
7272
- source venv/bin/activate
7373
- ./scripts/check_format.sh

scripts/setup_python_env.sh

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,25 @@
4545

4646
set -e
4747

48-
# Normalize Python version shorthand (e.g. 12 -> 3.12, 3.12 -> 3.12)
49-
if [ -n "${PYTHON_VERSION:-}" ]; then
50-
if [[ "$PYTHON_VERSION" =~ ^[0-9]+$ ]]; then
51-
PYTHON_VERSION="3.${PYTHON_VERSION}"
48+
if [ -z "${IS_LINT:-}" ] || [ "${IS_LINT}" = "0" ] || [ "${IS_LINT}" = "false" ]; then
49+
# Normalize Python version shorthand (e.g. 12 -> 3.12, 3.12 -> 3.12)
50+
if [ -n "${PYTHON_VERSION:-}" ]; then
51+
if [[ "$PYTHON_VERSION" =~ ^[0-9]+$ ]]; then
52+
PYTHON_VERSION="3.${PYTHON_VERSION}"
53+
fi
5254
fi
53-
fi
5455

55-
# Backup pyproject.toml so the rewrite doesn't persist across runs (matters
56-
# for local invocations; CI runners are ephemeral but cheap to be tidy).
57-
cp pyproject.toml pyproject.toml.bak
58-
cleanup() {
59-
mv pyproject.toml.bak pyproject.toml 2>/dev/null || true
60-
}
61-
trap cleanup EXIT
56+
# Backup pyproject.toml so the rewrite doesn't persist across runs (matters
57+
# for local invocations; CI runners are ephemeral but cheap to be tidy).
58+
cp pyproject.toml pyproject.toml.bak
59+
cleanup() {
60+
mv pyproject.toml.bak pyproject.toml 2>/dev/null || true
61+
}
62+
trap cleanup EXIT
6263

63-
source "$(dirname "$0")/_spec_ddtrace_dep.sh"
64-
spec_ddtrace_dep
64+
source "$(dirname "$0")/_spec_ddtrace_dep.sh"
65+
spec_ddtrace_dep
66+
fi
6567

6668
pip install virtualenv
6769
virtualenv venv

0 commit comments

Comments
 (0)