FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(#868k5bbdr): Read version from PKG-INFO when packageVersion env var is absent by vavsab · Pull Request #7 · mapped/botbuilder-python · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • about.py
      • about.py
      • about.py
      • about.py
17 changes: 14 additions & 3 deletions libraries/botbuilder-core/botbuilder/core/about.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,21 @@

import os

def _get_version():
if "packageVersion" in os.environ:
return os.environ["packageVersion"]
# When a build tool (e.g. uv) re-runs setup.py without packageVersion set,
# read the version from PKG-INFO so the reported version matches the sdist.
pkg_info = os.path.join(os.path.dirname(__file__), "..", "..", "PKG-INFO")
try:
import email.parser
with open(pkg_info, encoding="utf-8") as f:
return email.parser.Parser().parse(f)["Version"]
except Exception:
return "4.15.0"

__title__ = "botbuilder-core"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.15.0"
)
__version__ = _get_version()
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
__description__ = "Microsoft Bot Framework Bot Builder"
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@

import os

def _get_version():
if "packageVersion" in os.environ:
return os.environ["packageVersion"]
# botbuilder/integration/aiohttp/about.py → 3 levels up to sdist root
pkg_info = os.path.join(os.path.dirname(__file__), "..", "..", "..", "PKG-INFO")
try:
import email.parser
with open(pkg_info, encoding="utf-8") as f:
return email.parser.Parser().parse(f)["Version"]
except Exception:
return "4.15.0"

__title__ = "botbuilder-integration-aiohttp"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.15.0"
)
__version__ = _get_version()
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
__description__ = "Microsoft Bot Framework Bot Builder"
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@

import os

def _get_version():
if "packageVersion" in os.environ:
return os.environ["packageVersion"]
pkg_info = os.path.join(os.path.dirname(__file__), "..", "..", "PKG-INFO")
try:
import email.parser
with open(pkg_info, encoding="utf-8") as f:
return email.parser.Parser().parse(f)["Version"]
except Exception:
return "4.15.0"

__title__ = "botframework-connector"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.15.0"
)
__version__ = _get_version()
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
__description__ = "Microsoft Bot Framework Bot Builder"
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,19 @@

import os

def _get_version():
if "packageVersion" in os.environ:
return os.environ["packageVersion"]
pkg_info = os.path.join(os.path.dirname(__file__), "..", "..", "PKG-INFO")
try:
import email.parser
with open(pkg_info, encoding="utf-8") as f:
return email.parser.Parser().parse(f)["Version"]
except Exception:
return "4.15.0"

__title__ = "botframework-streaming"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.15.0"
)
__version__ = _get_version()
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
__description__ = "Microsoft Bot Framework Bot Builder"
Expand Down

Back | FazBrowse Home | New Git URL