Skip to content

Commit 613c428

Browse files
authored
build: require Python 3.12+, add smoke-test Make target (#15162)
Update Makefile and README to require Python 3.12 or newer, allow configurable Python executable, and add a 'smoke-test' target for smoketester. Update setup instructions and usage examples accordingly. Closes #14556
1 parent ae34a87 commit 613c428

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

dev-tools/scripts/Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ export PYTHONDONTWRITEBYTECODE=true
1313
# don't self-check, don't ask questions
1414
PIP_INSTALL_ARGS=--disable-pip-version-check --no-input --upgrade
1515

16+
# override to specific python executable if you need
17+
PYTHON?=python3
18+
1619
# venv with dependencies in the standard location
1720
VENV=${PWD}/.venv
1821

1922
# don't behave strangely if these files exist
20-
.PHONY: lint format reformat autofix ruff ruff-fix pyright env clean
23+
.PHONY: lint format reformat autofix ruff ruff-fix pyright env clean smoke-test
2124

2225
# list of directories we check
2326
SOURCES=$(wildcard *.py)
@@ -57,13 +60,22 @@ pyright: env
5760
# type-check sources with basedpyright
5861
$(VENV)/bin/basedpyright $(SOURCES)
5962

63+
# runs smoketester against a release
64+
smoke-test: env
65+
# ensure that you provided URL so that we know what to test
66+
# run this command like: make smoke-test URL=https://dist.apache.org/...
67+
test -n "$(URL)"
68+
$(VENV)/bin/python smokeTestRelease.py $(URL)
69+
6070
# rebuild venv if dependencies change
6171
env: $(VENV)/bin/activate
62-
$(VENV)/bin/activate: requirements.txt
72+
$(VENV)/bin/activate: requirements.txt Makefile
6373
# remove any existing venv
6474
rm -rf $(VENV)
65-
# create new venv
66-
python3 -m venv $(VENV)
75+
# check that python meets minimum version requirements
76+
$(PYTHON) -c "import sys; assert sys.version_info[0] == 3 and sys.version_info[1] >= 12, 'UPGRADE PYTHON'"
77+
# create virtual environment
78+
$(PYTHON) -m venv $(VENV)
6779
# install dependencies into venv
6880
$(VENV)/bin/pip install $(PIP_INSTALL_ARGS) -r requirements.txt
6981
# adjust timestamp for safety

dev-tools/scripts/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
This folder contains various useful scripts for developers, mostly related to
2121
releasing new versions of Lucene and testing those.
2222

23-
Python scripts require Python 3.6 or above. To install necessary python modules, please run:
23+
Python scripts require Python 3.12 or above. To install necessary python modules, please run:
2424

25-
pip3 install -r requirements.txt
25+
make env
26+
source .env/bin/activate
2627

2728
## Scripts description
2829

@@ -62,7 +63,7 @@ the full tests.
6263
--download-only Only perform download and sha hash check steps
6364

6465
Example usage:
65-
python3 -u dev-tools/scripts/smokeTestRelease.py https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.1-RC2-revc7510a0...
66+
make smoke-test URL=https://dist.apache.org/repos/dist/dev/lucene/lucene-9.0.1-RC2-revc7510a0...
6667

6768
### releaseWizard.py
6869

0 commit comments

Comments
 (0)