Skip to content

Commit 9cdb668

Browse files
Abel Milashclaude
andcommitted
Add setup.py shim for tools that require it
Most build-time tools use pyproject.toml directly, but some legacy documentation generators look for setup.py. The shim reads version from VERSION.txt or PackageVersion env var for build pipelines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e1e5f78 commit 9cdb668

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

setup.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from os import environ, path
2+
from setuptools import setup
3+
4+
# Try to read from VERSION.txt file first, fall back to environment variable
5+
version_file = path.join(path.dirname(__file__), "VERSION.txt")
6+
if path.exists(version_file):
7+
with open(version_file, "r", encoding="utf-8") as f:
8+
package_version = f.read().strip()
9+
else:
10+
package_version = environ.get("PackageVersion", "0.0.0")
11+
12+
setup(
13+
version=package_version,
14+
)

0 commit comments

Comments
 (0)