FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add support for updating version values in yaml files · Issue #706 · python-semantic-release/python-semantic-release · GitHub

Repository navigation

Add support for updating version values in yaml files #706

Description

Description

it would be nice if not only python and yaml toml are supported, but also toml yaml.

i use jenkins that calls python semantic release to get the next version. this version should be updated in the metadata.toml metadata.yaml which is used by pyinstaller-versionfile that creates the metadata for the exe file that is produced by pyinstaller. unfortunately, pyinstaller-versionfile can only work with toml yaml.

Use cases

List some reasons this would be useful.
see above

Possible implementation

Describe any ideas you have for how this could work.
see above

Activity

  1. bernardcooke53 commented on Sep 17, 2023

    Contributor

    Hey @damnmso - I'm a little confused - can't you do:

    python-semantic-release -c metadata.toml ...

    If you want to use metadata.toml for config, and/or in your PSR configuration:

    [tool.semantic_release]
    version_toml = ["metadata.toml:Version"]
    # ...

    ?

    I just had a skim over the documentation and it looks like pyinstaller-versionfile supports YAML, whereas we don't - is that what you meant?

    If it's the latter - we don't currently depend on PyYAML and I'm reluctant to force its installation by default. But there is definitely a workaround to convert some other config format into YAML using yq - after you pip install yq:

    TOML:

    # tomlq is installed by yq
    tomlq . pyproject.toml --yaml-output

    JSON:

    yq . $YOURFILE.json --yaml-output
  2. damnms commented on Sep 18, 2023

    I just had a skim over the documentation and it looks like pyinstaller-versionfile supports YAML, whereas we don't - is that what you meant?

    correct ;)
    i will see if i can work with yq, thanks!

  3. changed the title [-]support also toml in updating the version [/-] [+]Add support for updating version values in yaml files[/+] on Jul 14, 2024
  4. codejedi365 commented on Jul 14, 2024

    Contributor

    This may not work for your use but do note that version_variables will work with yaml files if the yaml file has quotation marks " around the version value.

    Essentially version variables is generic enough to match any code that has a variable or setting specified as a version as long as that version is in quotes (ie. a string declaration). It is a dynamically crafted regex so not all languages work but it is a relatively good catch all.

    Note that the placeholder value must be a full semver version string with 3 components or it will not work (see #941). The other limitation is that the version cannot match a tag format either (see #846).

  5. codejedi365 commented on Sep 27, 2024

    Contributor

    🎉 This resolution has been included in version 9.8.9 🎉

    The release is available on:


    @damnms / @damnmso, I know we resolved this question earlier but I wanted to let you know of the latest release which has a more flexible regular expression now that you will no longer need quotes around your version inside your yaml file. and If you use version_variables instead of version_toml then in most cases your version will update in the yaml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new feature or a feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL