Skip to content

Commit 943ba6c

Browse files
Users/robrandao/cherry-pick 0.6.1 (#265)
* Getting package version from file when building packages (#261) * Writing version to file and reading it when building * Fixing issue * Removed unnecessary declaration * Specifying encoding * Adding MANIFEST.in file to include package version files in builds (#263) * Writing version to file and reading it when building * Fixing issue * Removed unnecessary declaration * Specifying encoding * Adding MANIFEST.in files to include VERSION.txt * Fixing _sign_in_state serialization/deserialization (#264) * Fixing _sign_in_state (de)serialization * Reformatting --------- Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com> --------- Co-authored-by: Chris Mullins <cleemullins@users.noreply.github.com>
1 parent c602a1c commit 943ba6c

22 files changed

Lines changed: 141 additions & 36 deletions

File tree

.azdo/ci-pr.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ steps:
5252

5353
- script: |
5454
mkdir -p dist
55+
for dir in libraries/*; do
56+
if [ -f "$dir/pyproject.toml" ]; then
57+
echo $(PackageVersion) > "$dir/VERSION.txt"
58+
fi
59+
done
5560
for dir in libraries/*; do
5661
if [ -f "$dir/pyproject.toml" ]; then
5762
(cd "$dir" && python -m build --outdir ../../dist)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION.txt

libraries/microsoft-agents-activity/setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
from os import environ
1+
from os import environ, path
22
from setuptools import setup
33

4-
package_version = environ.get("PackageVersion", "0.0.0")
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")
511

612
setup(
713
version=package_version,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION.txt

libraries/microsoft-agents-authentication-msal/setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
from os import environ
1+
from os import environ, path
22
from setuptools import setup
33

4-
package_version = environ.get("PackageVersion", "0.0.0")
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")
511

612
setup(
713
version=package_version,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION.txt

libraries/microsoft-agents-copilotstudio-client/setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
from os import environ
1+
from os import environ, path
22
from setuptools import setup
33

4-
package_version = environ.get("PackageVersion", "0.0.0")
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")
511

612
setup(
713
version=package_version,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION.txt

libraries/microsoft-agents-hosting-aiohttp/setup.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
from os import environ
1+
from os import environ, path
22
from setuptools import setup
33

4-
package_version = environ.get("PackageVersion", "0.0.0")
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")
511

612
setup(
713
version=package_version,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION.txt

0 commit comments

Comments
 (0)