Package: semversioner
SemversionerThe easiest way to managesemantic versioningin your project and generate CHANGELOG.md file automatically.Semversioner will provide the tooling to automate semver release process for libraries, docker images, etc.This project was inspired by the way AWS manages their versioning forAWS-cli.Semantic VersioningThesemantic versioningspec involves several possible variations, but to simplify, inSemversionerwe are using the three-part version number:<major>.<minor>.<patch>Constructed with the following guidelines:Breaking backward compatibility or major features bumps the major (and resets the minor and patch).New additions without breaking backward compatibility bumps the minor (and resets the patch).Bug fixes and misc changes bumps the patch.An example would be 1.0.0How it worksAt any given time, the.semversioner/directory looks like:.semversioner
└── next-release
    ├── minor-20181227010225.json
    └── major-20181228010225.json
├── 1.1.0.json
├── 1.1.1.json
├── 1.1.2.jsonThe release process takes everything innext-releaseand aggregates them all together in a single JSON file for that release (e.g1.12.0.json).  This
JSON file is a list of all the individual JSON files fromnext-release.InstallpipinstallsemversionerUsageBumping the versionIn your local environment your will use the CLI to create the different changeset files that will be committed with your code. For example:semversioneradd-change--typepatch--description"Fix security vulnerability with authentication."Then, in your CI/CD tool you will need to release (generating automatically version number) and creating the the changelog file.semversionerreleaseGenerating ChangelogAs a part of your CI/CD workflow, you will be able to generate the changelog file with all changes.semversionerchangelog>CHANGELOG.mdYou can customize the changelog by creating a template and passing it as parameter to the command. For example:semversionerchangelog--template.semversioner/config/template.j2The template is usingJinja2, a templating language for Python. For example:# Changelog
{% for release in releases %}

## {{ release.version }}

{% for change in release.changes %}
- {{ change.type }}: {{ change.description }}
{% endfor %}
{% endfor %}Since semversioner2.0you can also add custom attributes to the changeset file that will be available in the release template:semversioneradd-change--typepatch--description"My custom changelog message with attributes."--attributespr_id=322--attributesissue_id=123Then, you can show the attributes in the changelog template. For example:# Changelog
Note: version releases in the 0.x.y range may introduce breaking changes.
{% for release in releases %}

## {{ release.version }} (<DATE>)

{% for change in release.changes %}
- {{ change.type }}: {{ change.description }}{{ ' (#' + change.attributes.pr_id + ')' if change.attributes }}{{ ' (J' + change.attributes.issue_id + ')' if change.attributes }}
{% endfor %}
{% endfor %}You can filter the changelog by only showing changes for a specific version:semversionerchangelog--version"1.0.0"Alternatively, you can use the following command to filter changes by the last released version:semversionerchangelog--version$(semversionercurrent-version)Getting next versionAs part of the CI/CD workflow, sometimes you want to release dev, rc, or other pre-release packages. For this purpose,
the next-version command can be issued, to compute the next version based on the current change set. This will
not change any files on disk, and they are as such preserved for any future release.semversionernext-versionLicenseCopyright (c) 2023 Raul Gomis.
MIT licensed, seeLICENSEfile.Made with ♥ byRaul Gomis <https://twitter.com/rgomis>.ChangelogNote: version releases in the 0.x.y range may introduce breaking changes.2.0.1patch: Add documentation for custom attributes in the changelog template.2.0.0major: Drop support for Python 3.6 and 3.7 as they are not maintained. Minimum supported version is Python 3.8.major: Upgrade project third-party dependencies to latest version.minor: Add support for custom properties in changeset files.minor: Change deletion logic innext-releasefolder: only delete json files, and delete the folder only if empty. This will allow to keep thenext-releasefolder if it contains other files such as.gitkeepfor example.minor: Change json mapper to use granurality of seconds instead of milliseconds forcreated_atfield in releases.patch: Clean up README Markdown syntax.1.7.0minor: Validated JSON extension in the  folder.patch: Upgraded development libraries to latest version.1.6.0minor: Decreased packaging minimum version requirements to version 21.01.5.2patch: Internal: improve CI/CD workflow1.5.1patch: Fix install packaging module to fix module issues.1.5.0minor: Fix remove StrictVersion deprecation notice by switching to package.version parse method.patch: Internal: Support python 3.11 in Github actions.1.4.1patch: Fixed CVE-2022-40898 in pypa/wheel (development library).patch: Update development dependencies to the latest version.1.4.0minor: Add support for storing release datetime in order to display it in the changelog.patch: All tests are now able to be run on Windowspatch: Fix: bug showing incorrect error using release command with no changesets created.1.3.0minor: Add CLI command to detect missing changeset files before merging to the destination branch.minor: Add exception handling support to use Semversioner as a library.patch: Fix next-version error command color.1.2.0minor: Added command next-version, to compute the version of the next release, without actually performing the release1.1.0minor: Expose models to use semversioner as a library.minor: Use models for better encapsulation and code refactoring.1.0.0major: Drop support for Python 3.6.minor: Add type hinting.minor: Bump click dependency to 8.0.3.minor: Bump jinja2 dependency to 3.0.3.patch: Add Python 3.10 testing in the CI/CD process.patch: Bump importlib_resources dependency to 5.4.0.patch: Bump pytest dependency to 6.2.5.patch: Bump twine dependency to 3.7.1.patch: Bump wheel dependency to 0.37.0.patch: Remove unnecessary dependency: colorama.patch: Rename semversioner directory to .semversioner.0.13.0minor: Add support for custom changelog templatepatch: Fix security vulnerability with jinja2 CVE-2020-284930.12.0minor: Improved performance by supporting multiple changeset files per secondminor: Status command now sorts unreleased changes by type and description in order to display consistent resultspatch: Internal code refactor to improve code readability and maintanability0.11.0minor: Add '--version' filter to the 'changelog' command to display the changelog only for a specific version0.10.0minor: Add new 'status' command to display the state of the working directory and unreleased changespatch: Fix build and deployment configurationpatch: Refactor method names and code for better code readability and testability0.9.0minor: Deprecated .changes directory in favour of .semversioner directorypatch: Internal refactor to improve code quality and test coverage0.8.1patch: Fix installer error when referencing to LICENSE file0.8.0minor: Enabled autocompletion by default0.7.1patch: Improve docs for open source0.7.0minor: Fail with error code when no changes are provided in the release command0.6.16patch: Fix bug: add require module in setup.py0.6.15patch: Fix packaging for LICENSEpatch: Improve README.md documentationpatch: Use jinja2 template engine internally to generate the changelog0.6.14patch: Update docs0.6.13patch: Fix README.md0.6.12patch: Fix long description content type0.6.11patch: Add README.md file0.6.10patch: Fix code consistency0.6.9patch: Fix packaging0.6.8patch: Tag the repository when releasing0.6.7patch: Fix tests and improve coverage0.6.6minor: Initial version