Getting package version from file when building packages#261
Getting package version from file when building packages#261rodrigobr-msft merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a version management system that reads package version from VERSION.txt files with a fallback to environment variables. The changes enable more flexible versioning during build processes by allowing version information to be persisted in files rather than relying solely on environment variables.
Key Changes:
- Updated setup.py files across all library packages to read version from VERSION.txt file first, then fall back to the
PackageVersionenvironment variable - Added setuptools-scm dependency to the microsoft-agents-activity package's build requirements
- Modified CI/CD pipeline to write version information to VERSION.txt files before building packages
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| libraries/microsoft-agents-storage-cosmos/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-storage-blob/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-hosting-fastapi/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-hosting-core/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-hosting-aiohttp/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-copilotstudio-client/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-authentication-msal/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-activity/setup.py | Added version file reading logic with environment variable fallback |
| libraries/microsoft-agents-activity/pyproject.toml | Added setuptools-scm dependency to build system requirements |
| .azdo/ci-pr.yaml | Added script to write PackageVersion to VERSION.txt files before package building |
Comments suppressed due to low confidence (8)
libraries/microsoft-agents-hosting-core/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-activity/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-storage-blob/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-storage-cosmos/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-copilotstudio-client/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-hosting-fastapi/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-authentication-msal/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
libraries/microsoft-agents-hosting-aiohttp/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
libraries/microsoft-agents-activity/setup.py:5
- This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
This assignment to 'package_version' is unnecessary as it is redefined before this value is used.
package_version = "0.0.0"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Writing version to file and reading it when building * Fixing issue * Removed unnecessary declaration * Specifying encoding
* 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>
This pull request updates the versioning mechanism for all Python libraries in the
libraries/directory. Instead of relying solely on an environment variable for the package version, the build process now writes the version to aVERSION.txtfile in each library, and thesetup.pyscripts are updated to read the version from this file if it exists. This ensures consistent and explicit versioning across all packages during the build process.Build process changes:
.azdo/ci-pr.yaml) now writes the current package version to aVERSION.txtfile in each library directory before building the packages.Library setup changes (applied to all libraries):
setup.pyscript is updated to first attempt to read the package version from aVERSION.txtfile; if the file does not exist, it falls back to thePackageVersionenvironment variable. This change is applied to the following libraries:microsoft-agents-activitymicrosoft-agents-authentication-msalmicrosoft-agents-copilotstudio-clientmicrosoft-agents-hosting-aiohttpmicrosoft-agents-hosting-coremicrosoft-agents-hosting-fastapimicrosoft-agents-hosting-teamsmicrosoft-agents-storage-blobmicrosoft-agents-storage-cosmos