[clang] [llvm] [libclang/python] Enable packaging libclang bindings (PR #125806)

Ryan Mast via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 18:19:24 PST 2025


================
@@ -0,0 +1,34 @@
+[build-system]
+requires = ["setuptools>=42", "setuptools_scm"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "clang"
+description = "libclang python bindings"
+readme = {file = "README.txt", content-type = "text/plain"}
+
+license = { text = "Apache-2.0 with LLVM exception" }
+authors = [
+    { name = "LLVM" }
+]
+keywords = ["llvm", "clang", "libclang"]
+classifiers = [
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: Apache Software License",
+    "Development Status :: 5 - Production/Stable",
+    "Topic :: Software Development :: Compilers",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python :: 3",
+]
+dynamic = ["version"]
+
+[project.urls]
+Homepage = "http://clang.llvm.org/"
+Download = "http://llvm.org/releases/download.html"
+
+[tool.setuptools_scm]
+root = "../../.."
+version_file = "clang/_version.py"
+fallback_version = "0.0.0.dev0"
+# Regex version capture group gets x.y.z with optional -rcN, -aN, -bN suffixes; -init is just consumed
+tag_regex = "^llvmorg-(?P<version>[vV]?\\d+(?:\\.\\d+)*(?:-(?:rc|a|b)\\d+)?)(?:.*)$"
----------------
nightlark wrote:

You're right, it looks like there have never been releases using a [vV] prefix for the version number.

The main place I expect the fallback version would be useful is for downloaded copies of the source code archive that don't have git version info to pull tags from, and don't have values substituted in for the .git_archival.txt file. I'll take it out for now, we'll just need to be careful to make sure all the source tarballs that including the clang bindings subfolder have .git_archival.txt correctly filled in.

https://github.com/llvm/llvm-project/pull/125806


More information about the llvm-commits mailing list