quaint-telephone-89068
12/20/2022, 11:33 AM2.15.0rc0, but the installation just hangs infinitely. It is not getting any further than:
Bootstrapping Pants using /usr/bin/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.103/pex> verified.
Installing pantsbuild.pants==2.15.0.dev2 into a virtual environment at /home/vscode/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0.dev2_py39
New virtual environment successfully created at /home/vscode/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0.dev2_py39.
It was working with 2.14.0. I also tried other 2.15. versions and noticed that it stopped working when I use 2.15.0.dev2. Is there anything introduced that might be related? I could not find anything related in the changelog.
Pants version
2.15.0rc0
OS
I am installing Pants in a VSCode devcontainer with a base image python:3.8-bullseye.
Additional info
My pants.toml looks like this:
[GLOBAL]
# info: change version to update pants
pants_version = "2.15.0rc0"
colors = true
# increasing memory usage for for better in-memory caching and fewer restarts
pantsd_max_memory_usage = "4GiB"
# storing pants log and pants file in one place (persistent because of container volume mount)
pants_workdir = ".pants/.pants.d"
pants_subprocessdir = ".pants/.pids"
local_store_dir = ".pants/.pants_cache"
build_file_prelude_globs = ["pants_plugins/macros.py"]
# TODO: remove "!/services/*", "!/libs/*" later when these repos are merged
pants_ignore = [
".pants_cache",
".*/",
"/dist/",
"!/libs/*",
"!/django",
"!/services/**"
]
# uncomment to do not use gitignore by default for file visibility
# pants_ignore_use_gitignore = false
backend_packages = [
'pants.backend.python',
"pants.backend.awslambda.python",
'pants.backend.docker',
'pants.backend.docker.lint.hadolint',
'pants.backend.python.typecheck.mypy',
"pants.backend.python.lint.pylint",
"pants.backend.python.lint.yapf",
"pants.backend.python.lint.isort",
"pants.backend.experimental.python.lint.autoflake",
"pants.backend.python.lint.bandit"
]
[tailor]
ignore_adding_targets = ['django:manage']
[python]
interpreter_constraints = ["CPython==3.8.*"]
enable_resolves = true
default_resolve = "default"
[python-infer]
#inits = true
init_files = "always"
string_imports = true
string_imports_min_dots = 0
[python.resolves]
default = "lockfiles/python/default"
[source]
# source code locations not in use by now
root_patterns = [
"/infra/*",
"/services/*",
"/libs/*",
"/django",
"/pants_plugins",
"/cli"
]
[docker]
build_args = [
"VARIANT",
"PYTHON_VERSION",
"PYTHON_MAJOR_VERSION",
"PACKAGE_DOWNLOAD_PATH",
"IMAGE_TAG",
"SERVICE_A_REPO",
]
run_args.add = ["--rm"]
[docker.registries.default]
address = "host.docker.internal:4510"
default = true
[pytest]
lockfile = "lockfiles/python/tools/pytest"
version = "pytest>=7.1.2,<7.2"
extra_requirements.add = [
"pytest-icdiff==0.5",
"mixer==7.2.1",
"pytest-xdist==2.5"
]
config_discovery = true
# db id env var set by pants for using multiple databases for parallel tests
execution_slot_var = "PANTS_EXECUTION_SLOT"
[test]
# <https://www.pantsbuild.org/docs/python-test-goal#setting-environment-variables>
# We only add common envs here, specific envs should be added to the corresponding test
extra_env_vars=[]
[environments-preview.names]
linux_docker = "//services/qgis:local_qgis"
[pylint]
lockfile = "lockfiles/python/tools/pylint"
config = ".pylintrc"
version = "pylint==2.11.1"
extra_requirements.add = ["pylint-django==2.4.4"]
[yapf]
lockfile = "lockfiles/python/tools/yapf"
config = "pyproject.toml"
config_discovery = false
version = "yapf==0.32.0"
[mypy]
lockfile = "lockfiles/python/tools/mypy"
config = "pyproject.toml"
version = "mypy==0.910"
[bandit]
lockfile = "lockfiles/python/tools/bandit"
config = "pyproject.toml"
version = "bandit[toml]==1.7.4"
[isort]
lockfile = "lockfiles/python/tools/isort"
config = "pyproject.toml"
version = "isort==5.10.1"
[autoflake]
lockfile = "lockfiles/python/tools/autoflake"
version = "autoflake==1.4"
[anonymous-telemetry]
# do not send telemetry data
enabled = false
If I remove build_file_prelude_globs here, it seems to work. The content in my macros.py is:
def http_service_image(name, service, **kwargs):
python_awslambda(
name=f"{service}-lambda",
runtime="python3.8",
handler=f"{service}/lambda_handler.py:handler",
# Otherwise pants cannot safely infer as dir name is the same in all services
dependencies=[f"//services/{service}/api", f"//services/{service}/lambda_handler.py"]
)
docker_image(
name=name,
dependencies=[f":{service}-lambda", ":entrypoint"],
image_tags=["{build_args.IMAGE_TAG}"],
extra_build_args=[f"SERVICE={service}"],
repository=f"{{build_args.{service.upper()}_REPO}}",
**kwargs
)
pantsbuild/pantsuser
01/06/2023, 9:28 PM