-
Notifications
You must be signed in to change notification settings - Fork 1
Refactoring/#392 refactor pre commit hook package version.py into nox task #412
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
base: main
Are you sure you want to change the base?
Refactoring/#392 refactor pre commit hook package version.py into nox task #412
Conversation
b30e169
to
5fc4cc2
Compare
* [#378](https://github.com/exasol/python-toolbox/pull/378/files): Add Nox task to trigger a release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad 😞 should have caught last time. These should refer to the issue number.
* [#378](https://github.com/exasol/python-toolbox/pull/378/files): Add Nox task to trigger a release | |
* [#368](https://github.com/exasol/python-toolbox/issues/368): Add Nox task to trigger a release |
## ⚒️ Refactorings | ||
|
||
* [#412](https://github.com/exasol/python-toolbox/pull/412): Refactor pre commit hook package version.py into nox task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* [#412](https://github.com/exasol/python-toolbox/pull/412): Refactor pre commit hook package version.py into nox task | |
* [#392](https://github.com/exasol/python-toolbox/issues/392): Refactor pre-commit hook package version.py into nox task |
@@ -1,9 +1,9 @@ | |||
# ATTENTION: | |||
# This file is generated by exasol/toolbox/pre_commit_hooks/package_version.py when using: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# This file is generated by exasol/toolbox/pre_commit_hooks/package_version.py when using: | |
# This file is generated by exasol/toolbox/nox/_package_version.py when using: |
@@ -19,7 +19,7 @@ jobs: | |||
uses: ./.github/actions/python-environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a brief description to #392 answering:
- what we want to change
- why we want to make this change
@@ -0,0 +1,207 @@ | |||
import subprocess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move:
-
test/unit/version_test.py
intotest/unit/util/version_test.py
. -
mock_from_poetry
&TestTriggerReleaseWithMocking
back intotest/unit/release_test.py
. (These are used to test the_trigger_release
function inrelease.__init__.py
.)
def test_version_from_python_no_module_error(tmp_path): | ||
file_path = tmp_path / "file" | ||
file_path.write_text("") | ||
with pytest.raises(ToolboxError) as ex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently, you aren't testing the value of ex
, so it can be removed. you could check to see if (part of) a string matched the text, like assert "version within module" in str(ex.value)
.
There's a debate about checking error message strings. Some folks say it's useful especially when ToolboxError could be tossed at a multitude of spots to verify that it you got the error at the place you expected it & not somewhere else. Whereas, others think it can be problematic, as when you update the string text, you'll need to update the text in the test. In more complicated code, I'm a bit more in the first group, but I'll let you decide what you prefer to do here.
with pytest.raises(ToolboxError) as ex: | |
with pytest.raises(ToolboxError): |
@@ -1,33 +1,29 @@ | |||
import subprocess | |||
import argparse | |||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the following:
-
exasol/toolbox/pre_commit_hooks
directory, as no longer has code in it -
doc/developer_guide/modules/pre_commit_hooks.rst
as no longer relevant
Please update:
-
doc/developer_guide/modules/modules.rst
by removingpre_commit_hooks
entry
Closes #392