Skip to content

Users/axsuarez/setuptools git versioning#72

Merged
axelsrz merged 21 commits intomainfrom
users/axsuarez/setuptools-git-versioning
Jul 24, 2025
Merged

Users/axsuarez/setuptools git versioning#72
axelsrz merged 21 commits intomainfrom
users/axsuarez/setuptools-git-versioning

Conversation

@axelsrz
Copy link
Member

@axelsrz axelsrz commented Jul 23, 2025

This pull request introduces dynamic versioning for multiple libraries and updates the build configuration to support it. Key changes include adding support for dynamically setting package versions using environment variables, modifying pyproject.toml files to declare dynamic versioning, and updating setup.py files to retrieve and apply the dynamically set version. Additionally, dependencies that were previously hardcoded in pyproject.toml files have been moved to setup.py files.

Dynamic versioning and build configuration updates:

  • .azdo/ci-pr.yaml and .github/workflows/python-package.yml: Added steps to dynamically set the package version using the replace-version.ps1 script and environment variables. ([[1]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-50b28cd1647a6801f28c6abec92ffc548ebdd47848c528f5b9baf0791c47fd7cR37-R41), [[2]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-ee49282f461b4c8ad179f79dd5bcdf93124561074c64a771366caf93e99b9320R43-R47))
  • replace-version.ps1: Introduced a PowerShell script to generate the package version using setuptools-git-versioning. ([replace-version.ps1R1-R3](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-b43fafec87dfaa3e667c15e5b5ad039a1907e3688db1f71f605669d850396ca3R1-R3))
  • VERSION and versioning/TARGET-VERSION: Added files to define the base version for versioning. ([[1]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-7b60b8e351cbb80c47459ffe2c79f1a26404871f49294780fe47ad0e58c09350R1), [[2]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-5fb00e93acb593ba0af3b14300cc46f59a3b009bc8994de90e74d12c45a871e5R1))

Library-specific updates:

  1. Dynamic versioning in pyproject.toml files:

    • Updated all libraries to use the dynamic = ["version"] field instead of hardcoding the version. ([[1]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-3e0e51c7aba7842311a7aaeb01cf77493d562b9d827f8355d1b22476dea9c6d0L2-R8), [[2]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-bc88c0d181ebfa187bd3931dd4fdac72266a5faac06a5032620b097deb87182eL2-R7), [[3]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-c224a7d83293379e5afe7c6dd530a088e17c01afedb6b758a046bde44f664aabL7-R7), [[4]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-98598a3ee0ba7cdf4bf04d9d6993879c941655a90a75378b3a0c29ca11a5b101L7-R7), [[5]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-f742ce29c2b1677fde2f3f9bb26db3b8c2aaa76cc912de831612a1c76deb6236L7-R7), [[6]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-b44c9e8dc66f909063c8c7d242b4d9bbad95dbe52f139cdf0928a54ed176e356L7-R7), [[7]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-d0f21a3f6a71ca6d4d180552d03060650a81e8b500d07e68c1d1d6a9d5a2e749L7-R7))
    • Removed hardcoded dependencies from pyproject.toml files, moving them to setup.py. ([[1]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-bc88c0d181ebfa187bd3931dd4fdac72266a5faac06a5032620b097deb87182eL16-L21), [[2]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-c224a7d83293379e5afe7c6dd530a088e17c01afedb6b758a046bde44f664aabL16-L18), [[3]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-98598a3ee0ba7cdf4bf04d9d6993879c941655a90a75378b3a0c29ca11a5b101L16-L19), [[4]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-f742ce29c2b1677fde2f3f9bb26db3b8c2aaa76cc912de831612a1c76deb6236L16-L22), [[5]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-b44c9e8dc66f909063c8c7d242b4d9bbad95dbe52f139cdf0928a54ed176e356L16-L19), [[6]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-d0f21a3f6a71ca6d4d180552d03060650a81e8b500d07e68c1d1d6a9d5a2e749L16-L20))
  2. setup.py updates for dynamic versioning:

    • Added setup.py files for all libraries to dynamically retrieve the version from the PackageVersion environment variable and define dependencies. ([[1]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-18999a1e4c55b90177b8d0bbf3505873351ed4ed125483c470cbd0df0d0b4282R1-R8), [[2]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-3d3a4461e938a05d0ff6e3c99b079dccef608f87c3d1c4160325dbb607bb0a2eR1-R14), [[3]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-9e25a1e1b2f666ceac33ac1bd7963386ef3ee2cae1c8818c00e31ab88b5ea8ffR1-R11), [[4]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-146f7de6afb74b470e3fddeb9cdd831b0cb0196127f77736d4b9d68fc7efb9bdR1-R12), [[5]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-0f4e9b3b0be902a1d965b0968d87a7a7fe3a775354c7c1add038ae67d9b32513R1-R15), [[6]](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-1fcc1182889e8d07d2fe2aed4e135b75e05bc927ba725977af9dafbb1b7350b2R1-R13))

Helper module for versioning:

  • versioning/helper/__init__.py: Added a helper module to expose versioning utilities. ([versioning/helper/__init__.pyR1-R3](https://github.com/microsoft/Agents-for-python/pull/72/files#diff-1cb2c42e5fafd9ed22d3d0116f47955ded8df82dff8a2ccafc40565bb674b48fR1-R3))

MattB-msft
MattB-msft previously approved these changes Jul 24, 2025
@axelsrz axelsrz merged commit 67c9a8a into main Jul 24, 2025
5 checks passed
@cleemullins cleemullins deleted the users/axsuarez/setuptools-git-versioning branch October 2, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments