Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Release preflight: Discord-only requesters (tools/release/discord_only.txt: foirgairwolf, fenix, Cytrick, Oslen, _tfx / Hameron) written as @name in changes/, the highlights, the guide or the site fail check_credits.py ("write 'name on Discord'"), offline and before asking GitHub (where @Cytrick is someone else's account); self-test cases
islandmede0594327e514
diff --git a/tools/release/check_credits.py b/tools/release/check_credits.pyindex 1d1d2e42..de3ad079 100644--- a/tools/release/check_credits.py+++ b/tools/release/check_credits.py@@ -4,7 +4,10 @@Credits read "thanks @handle" and point at GitHub; a Discord-only requester is credited without the @ ("thanks name onDiscord"), so a handle that isn't a GitHub account is a typo or a Discord name written as a GitHub one (0.11.13:@foirgairwolf). Reads changes/*.md and the HIGHLIGHTS file; asks `gh api users/<handle>` once per handle.- python3 tools/release/check_credits.py [FILE...] exit 1: a handle isn't on GitHub, 2: GitHub can't be asked+The names in tools/release/discord_only.txt are never written "@name" in those, the guide (docs/guide) or the site+(website, CHANGELOG.md), even when GitHub has an account by that name (someone else's): checked offline, first.+ python3 tools/release/check_credits.py [FILE...] exit 1: a handle isn't on GitHub or a Discord name has an @,+ 2: GitHub can't be askedpython3 tools/release/check_credits.py --self-test (offline: what counts as a handle)"""import glob@@ -13,6 +16,10 @@ import reimport subprocessimport sys+ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))+DISCORD_ONLY = os.path.join(ROOT, "tools", "release", "discord_only.txt")+SITE_TEXT = (".md", ".html", ".json", ".txt", ".xml")+# @handle as GitHub spells them (1-39 letters, digits, single hyphens), not inside an email address or a word.HANDLE = re.compile(r'(?<![\w.@/`])@([A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38})(?![\w@-])')@@ -21,6 +28,26 @@ def handles(text):return {m.group(1) for m in HANDLE.finditer(text)}+def discord_names(path=DISCORD_ONLY):+ with open(path, encoding="utf-8") as fh:+ return [n for n in (line.split("#")[0].strip() for line in fh) if n]+++def discord_ats(text, names):+ """The Discord-only names written as @name (any case; @fenixpoints is not @fenix)."""+ return sorted({n for n in names+ if re.search(r'(?<![\w.@/`])@' + re.escape(n) + r'(?![\w@-])', text, re.IGNORECASE)})+++def published_files():+ """The guide and the site: where a credit is read by people."""+ out = [os.path.join(ROOT, "CHANGELOG.md")]+ for top in ("docs/guide", "website"):+ for d, _, fs in os.walk(os.path.join(ROOT, top)):+ out += [os.path.join(d, f) for f in fs if f.endswith(SITE_TEXT)]+ return [f for f in out if os.path.isfile(f)]++def exists(handle):"""True / False, or None when GitHub can't be asked (network, auth)."""r = subprocess.run(["gh", "api", f"users/{handle}", "--silent"], capture_output=True, text=True)@@ -43,6 +70,26 @@ def self_test():if got != want:print(f"check_credits self-test: {text!r} -> {sorted(got)}, expected {sorted(want)}")return 1+ names = ["foirgairwolf", "fenix", "Cytrick", "Oslen", "_tfx", "Hameron"]+ ats = {+ "requested by @foirgairwolf": ["foirgairwolf"],+ "Thanks @FoirgairWolf!": ["foirgairwolf"],+ "thanks @cytrick and @fenix (#120)": ["Cytrick", "fenix"],+ "thanks foirgairwolf on Discord": [],+ "thanks @fenixpoints, #115": [],+ "[email protected], `@fenix`": [],+ "thanks @_tfx and @Hameron": ["Hameron", "_tfx"],+ "thanks _tfx on Discord, @oslen": ["Oslen"],+ }+ for text, want in ats.items():+ got = discord_ats(text, names)+ if got != want:+ print(f"check_credits self-test: Discord-only in {text!r} -> {got}, expected {want}")+ return 1+ listed = discord_names()+ if not {"foirgairwolf", "fenix", "Cytrick", "Oslen", "_tfx", "Hameron"} <= set(listed):+ print(f"check_credits self-test: {DISCORD_ONLY} lists {listed}")+ return 1print("check_credits self-test: ok")return 0@@ -51,13 +98,23 @@ def main(argv):if argv == ["--self-test"]:return self_test()files = argv or sorted(glob.glob("changes/*.md")) + [f for f in [os.environ.get("HIGHLIGHTS", "")] if f]+ names, bad = discord_names(), []+ for f in files + ([] if argv else published_files()):+ with open(f, encoding="utf-8", errors="replace") as fh:+ for n in discord_ats(fh.read(), names):+ bad.append(f"@{n} in {os.path.relpath(f)}: write '{n} on Discord'")+ if bad:+ print("Discord-only names written as GitHub handles (tools/release/discord_only.txt): " + "; ".join(bad))+ return 1+ discord = {n.lower() for n in names}found = {}for f in files:if os.path.basename(f) == "README.md":continuewith open(f, encoding="utf-8") as fh:for h in handles(fh.read()):- found.setdefault(h, []).append(f)+ if h.lower() not in discord:+ found.setdefault(h, []).append(f)missing, unknown = [], []for h in sorted(found, key=str.lower):ok = exists(h)diff --git a/tools/release/discord_only.txt b/tools/release/discord_only.txtnew file mode 100644index 00000000..fbfd9853--- /dev/null+++ b/tools/release/discord_only.txt@@ -0,0 +1,9 @@+# Requesters we know only on Discord: credit them "thanks name on Discord", never "@name" (an @ points at GitHub,+# where the name is free or someone else's). One name per line, as they spell it; tools/release/check_credits.py+# fails the release on "@name" in changes/*.md, the highlights, the guide or the site. Case doesn't matter.+foirgairwolf+fenix+Cytrick+Oslen+_tfx+Hameron # _tfx: never @_tfx or @Hameron