Skip to content

Commit 282bca1

Browse files
resolve conversation
1 parent a1527c1 commit 282bca1

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

exasol/toolbox/nox/_package_version.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@
66
Namespace,
77
)
88
from collections import namedtuple
9-
from collections.abc import Iterable
109
from inspect import cleandoc
1110
from pathlib import Path
1211
from shutil import which
13-
from typing import (
14-
Any,
15-
Dict,
16-
Union,
17-
)
12+
from typing import Any
1813

1914
import nox
2015
from nox import Session
@@ -29,9 +24,9 @@
2924
# ATTENTION:
3025
# This file is generated by exasol/toolbox/nox/_package_version.py when using:
3126
# * either "poetry run -- nox -s project:fix"
32-
# * or "poetry run -- nox version:check <path/version.py> --fix"
27+
# * or "poetry run -- nox version:check -- <path/version.py> --fix"
3328
# Do not edit this file manually!
34-
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
29+
# If you need to change the version, do so in the pyproject.toml, e.g. by using `poetry version X.Y.Z`.
3530
MAJOR = {major}
3631
MINOR = {minor}
3732
PATCH = {patch}
@@ -93,7 +88,7 @@ def write_version_module(version: Version, path: str, exists_ok: bool = True) ->
9388

9489
def _create_parser() -> ArgumentParser:
9590
parser = ArgumentParser(
96-
prog="nox -s version:check",
91+
prog="nox -s version:check --",
9792
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
9893
)
9994
parser.add_argument("version_module", help="Path to version module")
@@ -122,7 +117,7 @@ def _main_debug(args: Namespace) -> int:
122117
if args.fix:
123118
write_version_module(poetry_version, args.version_module)
124119

125-
if not module_version == poetry_version:
120+
if module_version != poetry_version:
126121
print(
127122
f"Version in pyproject.toml {poetry_version} and {args.version_module} {module_version} do not match!"
128123
)

exasol/toolbox/nox/_shared.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def _deny_filter(files: Iterable[Path], deny_list: Iterable[str]) -> Iterable[Pa
4747

4848

4949
def _version(session: Session, mode: Mode, version_file: Path) -> None:
50-
command = ["nox", "-s", "version:check"]
51-
command = command if mode == Mode.Check else command + ["--"] + ["--fix"]
50+
command = ["nox", "-s", "version:check", "--"]
51+
command = command if mode == Mode.Check else command + ["--fix"]
5252
session.run(*command, f"{version_file}")
5353

5454

exasol/toolbox/templates/github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
echo "Please enable the version check by replacing this output with shell command bellow:"
2424
echo ""
25-
echo "poetry run nox -s version:check -- <<VERSION_PY>>"
25+
echo "poetry run -- nox -s version:check -- <<VERSION_PY>>"
2626
echo ""
2727
echo "Note: <<VERSION_PY>> needs to point to the version file of the project (version.py)."
2828
exit 1

exasol/toolbox/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# ATTENTION:
22
# This file is generated by exasol/toolbox/nox/_package_version.py when using:
33
# * either "poetry run -- nox -s project:fix"
4-
# * or "poetry run -- nox version:check <path/version.py> --fix"
4+
# * or "poetry run -- nox version:check -- <path/version.py> --fix"
55
# Do not edit this file manually!
6-
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
6+
# If you need to change the version, do so in the pyproject.toml, e.g. by using `poetry version X.Y.Z`.
77
MAJOR = 1
88
MINOR = 0
99
PATCH = 1

project-template/{{cookiecutter.repo_name}}/exasol/{{cookiecutter.package_name}}/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# ATTENTION:
22
# This file is generated by exasol/toolbox/pre_commit_hooks/package_version.py when using:
33
# * either "poetry run -- nox -s project:fix"
4-
# * or "poetry run -- version-check <path/version.py> --fix"
4+
# * or "poetry run -- nox -s version:check -- <path/version.py> --fix"
55
# Do not edit this file manually!
6-
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
6+
# If you need to change the version, do so in the pyproject.toml, e.g. by using `poetry version X.Y.Z`.
77
MAJOR = 0
88
MINOR = 1
99
PATCH = 0

0 commit comments

Comments
 (0)