MCPcopy Create free account
hub / github.com/conda/constructor / get_bundle_app_name

Function get_bundle_app_name

constructor/briefcase.py:105–126  ·  view source on GitHub ↗
(info, name)

Source from the content-addressed store, hash-verified

103# installed, so it should be both unique between different products, and stable between
104# different versions of a product.
105def get_bundle_app_name(info, name):
106 # If reverse_domain_identifier is provided, use it as-is,
107 if (rdi := info.get("reverse_domain_identifier")) is not None:
108 if "." not in rdi:
109 raise ValueError(f"reverse_domain_identifier {rdi!r} contains no dots")
110 bundle, app_name = rdi.rsplit(".", 1)
111
112 # Ensure that the last component is a valid Python package name, as Briefcase
113 # requires.
114 if not re.fullmatch(
115 r"[A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9]", app_name, flags=re.IGNORECASE
116 ):
117 app_name = make_app_name(
118 app_name, f"Last component of reverse_domain_identifier {rdi!r}"
119 )
120
121 # If reverse_domain_identifier isn't provided, generate it from the name.
122 else:
123 bundle = DEFAULT_REVERSE_DOMAIN_ID
124 app_name = make_app_name(name, f"Name {name!r}")
125
126 return bundle, app_name
127
128
129def txt_to_rtf(txt: str) -> str:

Callers 5

test_bundle_app_nameFunction · 0.90
test_rdi_no_dotsFunction · 0.90
test_rdi_invalid_packageFunction · 0.90
write_pyproject_tomlMethod · 0.85

Calls 2

make_app_nameFunction · 0.85
getMethod · 0.80

Tested by 4

test_bundle_app_nameFunction · 0.72
test_rdi_no_dotsFunction · 0.72
test_rdi_invalid_packageFunction · 0.72