Skip to content

Commit 32ac3f0

Browse files
committed
Fixed pylint issues.
1 parent 39ac43e commit 32ac3f0

File tree

12 files changed

+80
-43
lines changed

12 files changed

+80
-43
lines changed

.github/workflows/Pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
with:
5858
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
5959
package_directory: ${{ needs.UnitTestingParams.outputs.package_directory }}
60+
pylint: 'false'
6061
artifact: CodeQuality
6162

6263
DocCoverage:

doc/Dependency.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ PyPI (see :ref:`INSTALL`).
5050
+---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
5151
| **Package** | **Version** | **License** | **Dependencies** |
5252
+===========================================================================+=============+==========================================================================================+========================================================================================================================================================+
53-
| `pyTooling[terminal] <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.5 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | * colorama |
53+
| `pyTooling[terminal] <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.7 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | * colorama |
5454
+---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
5555
| `ruamel.yaml <https://sourceforge.net/projects/ruamel-yaml/>`__ | ≥0.18 | `MIT <https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/LICENSE>`__ | *Not yet evaluated.* |
5656
+---------------------------------------------------------------------------+-------------+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -144,7 +144,7 @@ the mandatory dependencies too.
144144
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
145145
| **Package** | **Version** | **License** | **Dependencies** |
146146
+=================================================================================================+==============+==========================================================================================================+======================================================================================================================================================+
147-
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.5 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
147+
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.7 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
148148
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
149149
| `Sphinx <https://GitHub.com/sphinx-doc/sphinx>`__ | ≥8.2 | `BSD 3-Clause <https://GitHub.com/sphinx-doc/sphinx/blob/master/LICENSE>`__ | *Not yet evaluated.* |
150150
+-------------------------------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -203,7 +203,7 @@ install the mandatory dependencies too.
203203
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
204204
| **Package** | **Version** | **License** | **Dependencies** |
205205
+============================================================================+==============+==========================================================================================================+======================================================================================================================================================+
206-
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.5 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
206+
| `pyTooling <https://GitHub.com/pyTooling/pyTooling>`__ | ≥8.7 | `Apache License, 2.0 <https://GitHub.com/pyTooling/pyTooling/blob/main/LICENSE.md>`__ | *None* |
207207
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+
208208
| `wheel <https://GitHub.com/pypa/wheel>`__ | ≥0.45 | `MIT <https://github.com/pypa/wheel/blob/main/LICENSE.txt>`__ | *Not yet evaluated.* |
209209
+----------------------------------------------------------------------------+--------------+----------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+

pyVersioning/AppVeyor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def GetGitHash(self) -> str:
6262
try:
6363
return environ["APPVEYOR_REPO_COMMIT"]
6464
except KeyError as ex:
65-
raise ServiceException(f"Can't find AppVeyor environment variable 'APPVEYOR_REPO_COMMIT'.") from ex
65+
raise ServiceException("Can't find AppVeyor environment variable 'APPVEYOR_REPO_COMMIT'.") from ex
6666

6767
def GetGitBranch(self) -> Nullable[str]:
6868
"""
@@ -99,7 +99,7 @@ def GetGitRepository(self) -> str:
9999
try:
100100
repositoryURL = environ["APPVEYOR_PROJECT_SLUG"]
101101
except KeyError as ex:
102-
raise ServiceException(f"Can't find AppVeyor environment variable 'APPVEYOR_PROJECT_SLUG'.") from ex
102+
raise ServiceException("Can't find AppVeyor environment variable 'APPVEYOR_PROJECT_SLUG'.") from ex
103103

104104
try:
105105
url = URL.Parse(repositoryURL)

pyVersioning/CIService.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
from pyTooling.Decorators import export
3838
from pyTooling.MetaClasses import abstractmethod
3939

40-
from pyVersioning import VersioningException, GitHelperMixin, SelfDescriptive, GitShowCommand, BaseService, Platform
40+
from pyVersioning import VersioningException, GitHelperMixin, SelfDescriptive
41+
from pyVersioning import GitShowCommand, BaseService, Platform
4142

4243

4344
@export
@@ -65,7 +66,7 @@ def GetEnvironment(self) -> Dict[str, str]:
6566
6667
"""
6768

68-
filteredEnv = {key: value for (key, value) in environ.items() if key.startswith(self.ENV_INCLUDE_FILTER) and not key.endswith(self.ENV_EXCLUDE_FILTER)}
69+
filteredEnv = {key: value for (key, value) in environ.items() if key.startswith(self.ENV_INCLUDE_FILTER) and not key.endswith(self.ENV_EXCLUDE_FILTER)} # pylint: disable=line-too-long
6970

7071
# manually add some variables
7172
for key in self.ENV_INCLUDES:

pyVersioning/CLI.py

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@
3232
from collections import namedtuple
3333
from pathlib import Path
3434
from textwrap import dedent
35-
from typing import NoReturn, Optional as Nullable, ClassVar
35+
from typing import NoReturn, Optional as Nullable
3636

3737
from pyTooling.Attributes import Entity
3838
from pyTooling.Decorators import export
39-
from pyTooling.Attributes.ArgParse import ArgParseHelperMixin, DefaultHandler, CommandHandler, CommandGroupAttribute
39+
from pyTooling.Attributes.ArgParse import ArgParseHelperMixin, CommandGroupAttribute
40+
from pyTooling.Attributes.ArgParse import DefaultHandler, CommandHandler
4041
from pyTooling.Attributes.ArgParse.Argument import StringArgument, PathArgument
4142
from pyTooling.Attributes.ArgParse.Flag import FlagArgument
4243
from pyTooling.Attributes.ArgParse.ValuedFlag import LongValuedFlag
@@ -57,9 +58,9 @@ class ProjectAttributeGroup(CommandGroupAttribute):
5758
* ``--project-version``
5859
"""
5960
def __call__(self, func: Entity) -> Entity:
60-
self._AppendAttribute(func, LongValuedFlag("--project-name", dest="ProjectName", metaName="<Name>", optional=True, help="Name of the project."))
61-
self._AppendAttribute(func, LongValuedFlag("--project-variant", dest="ProjectVariant", metaName="<Variant>", optional=True, help="Variant of the project."))
62-
self._AppendAttribute(func, LongValuedFlag("--project-version", dest="ProjectVersion", metaName="<Version>", optional=True, help="Version of the project."))
61+
self._AppendAttribute(func, LongValuedFlag("--project-name", dest="ProjectName", metaName="<Name>", optional=True, help="Name of the project.")) # pylint: disable=line-too-long
62+
self._AppendAttribute(func, LongValuedFlag("--project-variant", dest="ProjectVariant", metaName="<Variant>", optional=True, help="Variant of the project.")) # pylint: disable=line-too-long
63+
self._AppendAttribute(func, LongValuedFlag("--project-version", dest="ProjectVersion", metaName="<Version>", optional=True, help="Version of the project.")) # pylint: disable=line-too-long
6364
return func
6465

6566

@@ -74,14 +75,25 @@ class CompilerAttributeGroup(CommandGroupAttribute):
7475
* ``--compiler-options``
7576
"""
7677
def __call__(self, func: Entity) -> Entity:
77-
self._AppendAttribute(func, LongValuedFlag("--compiler-name", dest="CompilerName", metaName="<Name>", optional=True, help="Used compiler."))
78-
self._AppendAttribute(func, LongValuedFlag("--compiler-version", dest="CompilerVersion", metaName="<Version>", optional=True, help="Used compiler version."))
79-
self._AppendAttribute(func, LongValuedFlag("--compiler-config", dest="CompilerConfig", metaName="<Config>", optional=True, help="Used compiler configuration."))
80-
self._AppendAttribute(func, LongValuedFlag("--compiler-options", dest="CompilerOptions", metaName="<Options>", optional=True, help="Used compiler options."))
78+
self._AppendAttribute(func, LongValuedFlag("--compiler-name", dest="CompilerName", metaName="<Name>", optional=True, help="Used compiler.")) # pylint: disable=line-too-long
79+
self._AppendAttribute(func, LongValuedFlag("--compiler-version", dest="CompilerVersion", metaName="<Version>", optional=True, help="Used compiler version.")) # pylint: disable=line-too-long
80+
self._AppendAttribute(func, LongValuedFlag("--compiler-config", dest="CompilerConfig", metaName="<Config>", optional=True, help="Used compiler configuration.")) # pylint: disable=line-too-long
81+
self._AppendAttribute(func, LongValuedFlag("--compiler-options", dest="CompilerOptions", metaName="<Options>", optional=True, help="Used compiler options.")) # pylint: disable=line-too-long
8182
return func
8283

8384

84-
ArgNames = namedtuple("ArgNames", ("Command", "Template", "Filename", "ProjectName", "ProjectVariant", "ProjectVersion", "CompilerName", "CompilerVersion", "CompilerConfig", "CompilerOptions"))
85+
ArgNames = namedtuple("ArgNames", (
86+
"Command",
87+
"Template",
88+
"Filename",
89+
"ProjectName",
90+
"ProjectVariant",
91+
"ProjectVersion",
92+
"CompilerName",
93+
"CompilerVersion",
94+
"CompilerConfig",
95+
"CompilerOptions"
96+
))
8597

8698

8799
@export
@@ -133,11 +145,11 @@ def Initialize(self, configFile: Nullable[Path] = None) -> None:
133145
self.WriteError(f"Configuration file '{configFile}' does not exist.")
134146
self._config = Configuration()
135147

136-
self.WriteVerbose(f"Creating internal data model ...")
148+
self.WriteVerbose( "Creating internal data model ...")
137149
self._versioning = Versioning(self)
138-
self.WriteDebug(f" Loading information from configuration file ...")
150+
self.WriteDebug( " Loading information from configuration file ...")
139151
self._versioning.LoadDataFromConfiguration(self._config)
140-
self.WriteDebug(f" Collecting information from environment ...")
152+
self.WriteDebug( " Collecting information from environment ...")
141153
self._versioning.CollectData()
142154

143155
def Run(self) -> NoReturn:
@@ -416,7 +428,7 @@ def UpdateCompiler(self, args: Namespace) -> None:
416428
self._versioning.Variables["build"]._compiler._options = args.CompilerOptions
417429

418430
def FillOutTemplate(self, template: str, **kwargs) -> str:
419-
self.WriteVerbose(f"Applying variables to template ...")
431+
self.WriteVerbose("Applying variables to template ...")
420432
return self._versioning.FillOutTemplate(template, **kwargs)
421433

422434
def WriteOutput(self, outputFile: Nullable[Path], content: str):

pyVersioning/GitHub.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141

4242
@export
4343
class GitHub(CIService):
44-
"""Collect Git and other platform and environment information from environment variables provided by GitHub Actions."""
44+
"""
45+
Collect Git and other platform and environment information from environment variables provided by GitHub Actions.
46+
"""
4547

4648
ENV_INCLUDE_FILTER = ("GITHUB_", ) #: List of environment variable name pattern for inclusion.
4749
ENV_EXCLUDE_FILTER = ("_TOKEN", ) #: List of environment variable name pattern for exclusion.
@@ -61,14 +63,15 @@ def GetGitHash(self) -> str:
6163
try:
6264
return environ["GITHUB_SHA"]
6365
except KeyError as ex:
64-
raise ServiceException(f"Can't find GitHub Action environment variable 'GITHUB_SHA'.") from ex
66+
raise ServiceException("Can't find GitHub Action environment variable 'GITHUB_SHA'.") from ex
6567

6668
def GetGitBranch(self) -> Nullable[str]:
6769
"""
6870
Returns Git branch name or ``None`` is not checked out on a branch.
6971
7072
:return: Git branch name or ``None``.
71-
:raises ServiceException: If environment variable ``GITHUB_REF`` was not found or reference doesn't start with ``refs/heads/``.
73+
:raises ServiceException: If environment variable ``GITHUB_REF`` was not found or reference doesn't start with
74+
``refs/heads/``.
7275
"""
7376
branchPrefix = "refs/heads/"
7477

@@ -86,7 +89,8 @@ def GetGitTag(self) -> Nullable[str]:
8689
Returns Git tag name or ``None`` is not checked out on a tag.
8790
8891
:return: Git tag name or ``None``.
89-
:raises ServiceException: If environment variable ``GITHUB_REF`` was not found or reference doesn't start with ``refs/tags/``.
92+
:raises ServiceException: If environment variable ``GITHUB_REF`` was not found or reference doesn't start with
93+
``refs/tags/``.
9094
"""
9195
tagPrefix = "refs/tags/"
9296

@@ -110,7 +114,7 @@ def GetGitRepository(self) -> str:
110114
try:
111115
repositoryURL = environ["GITHUB_REPOSITORY"]
112116
except KeyError as ex:
113-
raise ServiceException(f"Can't find GitHub Action environment variable 'GITHUB_REPOSITORY'.") from ex
117+
raise ServiceException("Can't find GitHub Action environment variable 'GITHUB_REPOSITORY'.") from ex
114118

115119
try:
116120
url = URL.Parse(repositoryURL)

pyVersioning/GitLab.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def GetGitHash(self) -> str:
6262
try:
6363
return environ["CI_COMMIT_SHA"]
6464
except KeyError as ex:
65-
raise ServiceException(f"Can't find GitLab-CI environment variable 'CI_COMMIT_SHA'.") from ex
65+
raise ServiceException("Can't find GitLab-CI environment variable 'CI_COMMIT_SHA'.") from ex
6666

6767
def GetCommitDate(self) -> datetime:
6868
"""
@@ -75,7 +75,7 @@ def GetCommitDate(self) -> datetime:
7575
iso8601 = environ["CI_COMMIT_TIMESTAMP"]
7676
return datetime.fromisoformat(iso8601)
7777
except KeyError as ex:
78-
raise ServiceException(f"Can't find GitLab-CI environment variable 'CI_COMMIT_TIMESTAMP'.") from ex
78+
raise ServiceException("Can't find GitLab-CI environment variable 'CI_COMMIT_TIMESTAMP'.") from ex
7979

8080
def GetGitBranch(self) -> Nullable[str]:
8181
"""
@@ -112,7 +112,7 @@ def GetGitRepository(self) -> str:
112112
try:
113113
repositoryURL = environ["CI_REPOSITORY_URL"]
114114
except KeyError as ex:
115-
raise ServiceException(f"Can't find GitLab-CI environment variable 'CI_REPOSITORY_URL'.") from ex
115+
raise ServiceException("Can't find GitLab-CI environment variable 'CI_REPOSITORY_URL'.") from ex
116116

117117
try:
118118
url = URL.Parse(repositoryURL)

pyVersioning/Travis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def GetGitHash(self) -> str:
6464
try:
6565
return environ["TRAVIS_COMMIT"]
6666
except KeyError as ex:
67-
raise ServiceException(f"Can't find Travis environment variable 'TRAVIS_COMMIT'.") from ex
67+
raise ServiceException("Can't find Travis environment variable 'TRAVIS_COMMIT'.") from ex
6868

6969
def GetGitBranch(self) -> Nullable[str]:
7070
"""
@@ -101,7 +101,7 @@ def GetGitRepository(self) -> str:
101101
try:
102102
repositoryURL = environ["TRAVIS_REPO_SLUG"]
103103
except KeyError as ex:
104-
raise ServiceException(f"Can't find Travis environment variable 'TRAVIS_REPO_SLUG'.") from ex
104+
raise ServiceException("Can't find Travis environment variable 'TRAVIS_REPO_SLUG'.") from ex
105105

106106
try:
107107
url = URL.Parse(repositoryURL)

0 commit comments

Comments
 (0)