polite-garden-50641
03/22/2022, 4:26 PMpolite-garden-50641
03/22/2022, 4:26 PMFile "/Users/asher/.cache/pants/setup/bootstrap-Darwin-x86_64/2.11.0rc0_py38/lib/python3.8/site-packages/pants/init/extension_loader.py", line 130, in load_backend
module = importlib.import_module(backend_module)
File "/Users/asher/.pyenv/versions/3.8.12/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/asher/projects/toolchain/src/python/toolchain/pants/register.py", line 10, in <module>
from toolchain.pants.auth.rules import get_auth_rules
File "/Users/asher/projects/toolchain/src/python/toolchain/pants/auth/rules.py", line 36, in <module>
from toolchain.pants.common.toolchain_setup import ToolchainSetup
File "/Users/asher/projects/toolchain/src/python/toolchain/pants/common/toolchain_setup.py", line 26, in <module>
class ToolchainSetup(Subsystem):
File "/Users/asher/projects/toolchain/src/python/toolchain/pants/common/toolchain_setup.py", line 37, in ToolchainSetup
org = StrOption(
TypeError: __new__() missing 1 required positional argument: 'flag_name'
Use -ldebug for more logs.
See <https://www.pantsbuild.org/v2.11/docs/troubleshooting> for common issues.
Consider reaching out for help: <https://www.pantsbuild.org/v2.11/docs/getting-help>
polite-garden-50641
03/22/2022, 4:26 PMflag_name
and didn't find any...polite-garden-50641
03/22/2022, 4:26 PMbitter-ability-32190
03/22/2022, 4:27 PMbitter-ability-32190
03/22/2022, 4:27 PM"--repo"
or "--org"
fast-nail-55400
03/22/2022, 4:28 PMfast-nail-55400
03/22/2022, 4:28 PMStrOption
constructor as if you were calling register
bitter-ability-32190
03/22/2022, 4:28 PMfast-nail-55400
03/22/2022, 4:29 PMStrOption("--some-opt", ...)
bitter-ability-32190
03/22/2022, 4:30 PMpolite-garden-50641
03/22/2022, 4:31 PMbitter-ability-32190
03/22/2022, 4:31 PMpolite-garden-50641
03/22/2022, 4:31 PMbitter-ability-32190
03/22/2022, 4:35 PMpolite-garden-50641
03/22/2022, 4:41 PMfast-nail-55400
03/22/2022, 4:43 PM@property
function is used to do some derived calculation for use in rest of Pants.fast-nail-55400
03/22/2022, 4:44 PMbitter-ability-32190
03/22/2022, 4:45 PM# Conflicts with builtin keyword
frm = StrOption("--from", ...)
# Don't make the property public, use different property instead
_myopt = StrOption("--foo", ...)
FWIW I really do want to do this. It's just not trivial and given the amount of changes that went into this new system, I've tried to minimize friction as much as possible.bitter-ability-32190
03/22/2022, 4:52 PMdb_column
parameter: https://docs.djangoproject.com/en/4.0/ref/models/fields/#db-column
We 100% could do something similar (the attribute name seeds the flag name if not explicitly provided)