Skip to content

Commit 4ca05fd

Browse files
committed
Update plugin name and version retrieval method
1 parent f3cc094 commit 4ca05fd

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/community_of_python_flake8_plugin

src/community_of_python_flake8_plugin/plugin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22
import importlib
3+
import importlib.metadata
4+
import pathlib
35
import pkgutil
46
import typing
57

@@ -22,8 +24,8 @@ def visit(self, node: ast.AST) -> None: ... # noqa: COP007,COP006,COP012
2224

2325
@typing.final
2426
class CommunityOfPythonFlake8Plugin:
25-
name: typing.Final[str] = "community-of-python-flake8-plugin" # noqa: COP004
26-
version: typing.Final[str] = "0.1.27" # noqa: COP004
27+
name: typing.Final[str] = str(pathlib.Path(__file__).parent.name) # noqa: COP004
28+
version: typing.Final[str] = importlib.metadata.version(name) # noqa: COP004
2729

2830
def __init__(self, tree: ast.AST) -> None: # noqa: COP006
2931
self.ast_syntax_tree: typing.Final[ast.AST] = tree

0 commit comments

Comments
 (0)