rhythmic-morning-87313
05/30/2022, 4:56 AMenough-analyst-54434
05/30/2022, 5:03 AMsys.version_info
, sys.executable
, etc. This is the same as for any other Python program. What context do you want to use this information in?rhythmic-morning-87313
05/30/2022, 5:04 AMrhythmic-morning-87313
05/30/2022, 5:05 AMdist/export/python/virtualenvs/python-default/3.10.4/
rhythmic-morning-87313
05/30/2022, 5:05 AM3.10.4
piece automaticallyenough-analyst-54434
05/30/2022, 5:06 AMinterpreter_constraints
.enough-analyst-54434
05/30/2022, 5:07 AMrhythmic-morning-87313
05/30/2022, 5:07 AMenough-analyst-54434
05/30/2022, 5:08 AMrhythmic-morning-87313
05/30/2022, 5:08 AM./pants version
or source-building the github clone after ./pants version
fails (e.g., linux-aarch64)rhythmic-morning-87313
05/30/2022, 5:08 AMrhythmic-morning-87313
05/30/2022, 5:09 AMrhythmic-morning-87313
05/30/2022, 5:09 AMenough-analyst-54434
05/30/2022, 5:10 AMinterpreter_constraints = ["==3.10.1"]
then you can get the value from pants.toml
.enough-analyst-54434
05/30/2022, 5:11 AMinterpreter_constraints = ["==3.10.*"]
?rhythmic-morning-87313
05/30/2022, 5:11 AMrhythmic-morning-87313
05/30/2022, 5:12 AMenough-analyst-54434
05/30/2022, 5:12 AMrhythmic-morning-87313
05/30/2022, 5:12 AMrhythmic-morning-87313
05/30/2022, 5:12 AMenough-analyst-54434
05/30/2022, 5:12 AMrhythmic-morning-87313
05/30/2022, 5:12 AMrhythmic-morning-87313
05/30/2022, 5:13 AMenough-analyst-54434
05/30/2022, 5:13 AMenough-analyst-54434
05/30/2022, 5:14 AM%(env.VAR_NAME)s
that can be interpolated in pants.toml.enough-analyst-54434
05/30/2022, 5:14 AMrhythmic-morning-87313
05/30/2022, 5:15 AMrhythmic-morning-87313
05/30/2022, 5:15 AMenough-analyst-54434
05/30/2022, 5:15 AM./pants
or use a wrapper script to run pants?rhythmic-morning-87313
05/30/2022, 5:16 AMrhythmic-morning-87313
05/30/2022, 5:16 AM./pants
enough-analyst-54434
05/30/2022, 5:16 AMrhythmic-morning-87313
05/30/2022, 5:16 AMrhythmic-morning-87313
05/30/2022, 5:17 AMrhythmic-morning-87313
05/30/2022, 5:17 AMrhythmic-morning-87313
05/30/2022, 5:18 AMrhythmic-morning-87313
05/30/2022, 5:18 AMcurved-television-6568
05/30/2022, 6:59 AMpython-behave
for writing a set of tests in Gherkin (cucumber), and to get going quickly we didn’t start off with writing a Pants plugin to support running it natively with ./pants test
but instead ended up with this Makefile
to get going:
$ cat Makefile
VENV_ROOT ?= dist/export/python/virtualenvs/python-default
BEHAVE ?= $(shell find -x $(VENV_ROOT) -name behave -type f)
# Testrun event data
BACKEND ?=
BUILD_URL ?= local
JOB ?= sputnik.api.cucumber.python
PROJECT_NAME ?= tooling/systemtest
TENANT ?= common
TEST_TYPE ?= api
TPNS ?= test1
check: venv
$(BEHAVE) \
-D backend=$(BACKEND) \
-D build_url=$(BUILD_URL) \
-D job=$(JOB) \
-D project_name=$(PROJECT_NAME) \
-D tenant=$(TENANT) \
-D test_type=$(TEST_TYPE) \
-D tpns=$(TPNS) \
src/features
%.lock: %.txt
./pants generate-lockfiles
venv: $(VENV_ROOT)
$(VENV_ROOT): deps/requirements.lock
./pants export ::
So a simple make check
is all that you need to know from a clean git clone
🙂