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

Refactoring: exceptions #84

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

Privat33r-dev
Copy link
Collaborator

Made a minor refactoring

@Privat33r-dev
Copy link
Collaborator Author

Privat33r-dev commented Apr 10, 2024

Should I bump to 2.5.4? Since the latest tag is 2.5.3, but version is toml is mismatching. Normally I suggest to automate workflow to avoid these kind of situations.

Wrote a short script that could be used in .git/hooks/pre-push with the assumption that the single source of truth for version would be ./pyproject.toml file:

root_dir=$(git rev-parse --show-toplevel)
current_branch=$(git symbolic-ref --short HEAD)
current_tag=$(git describe --abbrev=0 --tags $current_branch 2>/dev/null)
version=v$(grep -oP -m 1 'version = "\K[^"]+' $root_dir/pyproject.toml)

if [[ "$current_tag" != "$version" ]]; then
  echo "Tag version ($current_tag) differs from version in pyproject.toml ($version)"
  git tag "$version" -m "Version $version" $current_branch && echo "Tag updated to $version" || echo "Couldn't update tag version"
fi

Copy link
Owner

@nikitastupin nikitastupin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

And, yes, let's add the script to automate the version bump workflow. I think it also makes sense to add instructions on how to hook it to git. Currently, the dev docs are in the wiki but I guess it's better to move them to the repo.

Could you do it as a separate PR as I'm merging this one?

@nikitastupin nikitastupin merged commit bd76155 into nikitastupin:main Apr 12, 2024
3 checks passed
@Privat33r-dev Privat33r-dev deleted the refactor/exceptions branch April 12, 2024 15:12
Privat33r-dev added a commit to Privat33r-dev/clairvoyance that referenced this pull request Apr 16, 2024
* Raise correct exception type

* Add new error type and simplify error raising

* Remove unused import

* Version bump to v.2.5.3
Privat33r-dev added a commit to Privat33r-dev/clairvoyance that referenced this pull request Apr 29, 2024
* Raise correct exception type

* Add new error type and simplify error raising

* Remove unused import

* Version bump to v.2.5.3
Privat33r-dev added a commit to Privat33r-dev/clairvoyance that referenced this pull request Apr 29, 2024
* Raise correct exception type

* Add new error type and simplify error raising

* Remove unused import

* Version bump to v.2.5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants