Commit 9dd1c2e
fix(python): derive __version__ from package metadata with dev sentinel
The Python SDK hardcoded __version__ = "0.1.0" in copilot/__init__.py and
version = "0.1.0" in pyproject.toml. The publish workflow only rewrites
pyproject.toml at release time, so the public runtime __version__ drifted
and always reported a stale version regardless of what was published.
Derive __version__ from installed package metadata via importlib.metadata,
falling back to a 0.0.0.dev0 sentinel (instead of a real-looking version)
when no metadata is present. Set the committed pyproject.toml version to the
same dev sentinel, matching the .NET and Rust SDKs; CI injects the real
version at publish time.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 4d2df4c commit 9dd1c2e
2 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
145 | 148 | | |
146 | 149 | | |
147 | 150 | | |
148 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
149 | 158 | | |
150 | 159 | | |
151 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
0 commit comments