Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

accept python versioning #110

Open
TomasTomecek opened this issue Nov 6, 2018 · 3 comments
Open

accept python versioning #110

TomasTomecek opened this issue Nov 6, 2018 · 3 comments
Labels
feature New feature or a request for enhancement. help wanted Extra attention is needed

Comments

@TomasTomecek
Copy link
Member

TomasTomecek commented Nov 6, 2018

I am using python versioning scheme in my python project (you don't say). Unfortunately release bot fails to parse it:

08:51:35.770 utils.py          INFO   Editing line with new version:
__version__ = "0.2.0.dev0"
08:51:35.770 utils.py          WARNING Failed to validate version, aborting
08:51:35.771 utils.py          ERROR  No version files found. Aborting version update.

Related #12 and all other versioning issues

@TomasTomecek TomasTomecek added the feature New feature or a request for enhancement. label Nov 6, 2018
@shresthagrawal
Copy link
Contributor

@TomasTomecek Should I implement add a version_regex field to the config file to define custom version regex for the projects?

@TomasTomecek
Copy link
Member Author

Honestly, I don't know how to tackle this one. We are using semver to compare versions and if semver fails to parse the version, the execution stops. One regex would not do, we would need a more sophisticated solution. Maybe there are already libraries which handle this situation.

@TomasTomecek TomasTomecek added the help wanted Extra attention is needed label Mar 15, 2019
@jpopelka
Copy link
Member

The warning comes from update_version(), which uses semantic_version.validate() to make sure the version string we found in {'setup.py', '__init__.py', 'version.py'} is a proper semantic version string.
I think we don't need to be so strict in this case and just replace

if semantic_version.validate(old_version):
  old_version -> new_version
else:
  configuration.logger.warning(f"Failed to validate version, aborting")

with

try:
  semantic_version.Version.coerce(old_version)
except ValueError:
  configuration.logger.warning(f"Failed to validate version, aborting")
else:
  old_version -> new_version

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or a request for enhancement. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants