Skip to content

Commit

Permalink
Drop setuptools dependency
Browse files Browse the repository at this point in the history
More linting rules
  • Loading branch information
plinss committed Jun 29, 2022
1 parent f5a2677 commit cba2b54
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
9 changes: 6 additions & 3 deletions flake8_noqa/noqa_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@


try:
import pkg_resources
package_version = pkg_resources.get_distribution(__package__).version
except pkg_resources.DistributionNotFound:
try:
from importlib.metadata import version
except ModuleNotFoundError: # python < 3.8 use polyfill
from importlib_metadata import version # type: ignore
package_version = version(__package__)
except Exception:
package_version = 'unknown'


Expand Down
9 changes: 6 additions & 3 deletions flake8_noqa/noqa_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@


try:
import pkg_resources
package_version = pkg_resources.get_distribution(__package__).version
except pkg_resources.DistributionNotFound:
try:
from importlib.metadata import version
except ModuleNotFoundError: # python < 3.8 use polyfill
from importlib_metadata import version # type: ignore
package_version = version(__package__)
except Exception:
package_version = 'unknown'


Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
ignore = D107, ANN002, ANN003, ANN101, ANN102, ANN401, FS003
max-line-length = 160

noqa-require-code = True

use-flake8-tabs = True
blank-lines-indent = never

Expand All @@ -13,3 +15,6 @@ ignore_missing_imports=True

[mypy-flake8.*]
ignore_missing_imports=True

[mypy-importlib.metadata.*]
ignore_missing_imports=True
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,32 @@

install_requires=[
'flake8>=3.8.0,<5.0',
'typing_extensions>=3.7.4.2,<5.0',
'setuptools',
'importlib_metadata>=4.12.0,<5.0.0;python_version<"3.8.0"',
'typing_extensions>=3.7.4.2,<4.0',
],
extras_require={
'dev': [
'mypy',
'flake8',
'flake8-annotations',
'flake8-bandit',
'flake8-bugbear',
'flake8-commas',
'flake8-comprehensions',
'flake8-continuation',
'flake8-datetimez',
'flake8-docstrings',
'flake8-import-order',
'flake8-literal',
'flake8-noqa',
'flake8-polyfill',
'flake8-postponed-annotations',
'flake8-tabs',
'flake8-requirements',
# 'flake8-smart-tabs',
'flake8-tabs',
'flake8-typechecking-import',
'flake8-use-fstring',
'pep8-naming',
'types-setuptools',
],
'test': [
'flake8-docstrings',
Expand Down

0 comments on commit cba2b54

Please sign in to comment.