This project uses setuptools_scm to automatically determine version numbers from Git tags.
- The version is automatically determined from your git tags
- In development environments, the version is dynamically determined
- For Docker builds and CI, the version is passed as a build argument
- Release: When on a tag (e.g.,
1.2.3
), the version is exactly that tag - Development: When between tags, the version is
<last-tag>.post<n>+g<commit-hash>
- Example:
1.2.3.post10+gb697684
- Example:
The version is automatically determined whenever you:
# Install the package
pip install -e .
# Run the version-file generator
make version-file
# Check the current version
python -m setuptools_scm
# Preferred method - via Python metadata
from importlib.metadata import version
__version__ = version("aws-mcp-server")
# Alternative - if using version file
from aws_mcp_server._version import version, __version__
For Docker builds, the version is:
- Determined by setuptools_scm
- Passed to Docker as a build argument
- Used in the image's labels and metadata
To create a new release:
-
Create and push a tag that follows semantic versioning:
git tag -a 1.2.3 -m "Release 1.2.3" git push origin 1.2.3
-
The CI pipeline will:
- Use setuptools_scm to get the version
- Build the Docker image with proper tags
- Push the release to registries
- The
_version.py
file is automatically generated and ignored by git - Always include the patch version in tags (e.g., use
1.2.3
instead of1.2
) - For the Docker image, the
+
in versions is replaced with-
for compatibility