Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add toml files support for version declaration (#245, #275) #307

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

Toilal
Copy link
Contributor

@Toilal Toilal commented Jan 6, 2021

This introduce a new version_toml configuration property that behaves like version_pattern and version_variable.

For poetry support, user should now set version_toml = pyproject.toml:tool.poetry.version.

This introduce an ABC class, VersionDeclaration, that can be implemented to add other version declarations with ease.

toml dependency has been replaced by tomlkit, as this is used the library used by poetry to generate the pyproject.toml file, and is able to keep the ordering of data defined in the file.

Existing VersionPattern class has been renamed to PatternVersionDeclaration and now implements VersionDeclaration.

load_version_patterns() function has been renamed to load_version_declarations() and now return a list of VersionDeclaration implementations.

Close #245
Close #275

@Toilal Toilal force-pushed the pyproject-toml-support branch 4 times, most recently from 8fd67d2 to a985680 Compare January 6, 2021 01:05
@Toilal Toilal marked this pull request as draft January 6, 2021 01:06
@Toilal Toilal marked this pull request as ready for review January 6, 2021 07:09
semantic_release/settings.py Outdated Show resolved Hide resolved
@Toilal Toilal force-pushed the pyproject-toml-support branch 2 times, most recently from 346ed4f to 073d748 Compare January 8, 2021 08:59
tests/test_settings.py Outdated Show resolved Hide resolved
docs/index.rst Outdated Show resolved Hide resolved
…-release#245, python-semantic-release#275)

This introduce a new `version_toml` configuration property that behaves
like `version_pattern` and `version_variable`.

For poetry support, user should now set `version_toml = pyproject.toml:tool.poetry.version`.

This introduce an ABC class, `VersionDeclaration`, that
can be implemented to add other version declarations with ease.

`toml` dependency has been replaced by `tomlkit`, as this is used
the library used by poetry to generate the `pyproject.toml` file, and
is able to keep the ordering of data defined in the file.

Existing `VersionPattern` class has been renamed to
`PatternVersionDeclaration` and now implements `VersionDeclaration`.

`load_version_patterns()` function has been renamed to
`load_version_declarations()` and now return a list of
`VersionDeclaration` implementations.

Close python-semantic-release#245
Close python-semantic-release#275
@danth danth merged commit 9b62a7e into python-semantic-release:master Jan 26, 2021
@Toilal Toilal deleted the pyproject-toml-support branch March 30, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants