Skip to content
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

Fixes to work with Python 3.12+ #254

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pylama/lint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pkgutil import walk_packages
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type

from pkg_resources import iter_entry_points
from importlib_metadata import entry_points

LINTERS: Dict[str, Type[LinterV2]] = {}

Expand Down Expand Up @@ -58,7 +58,7 @@ def run_check(self, ctx: RunContext):
pass

# Import installed linters
for entry in iter_entry_points("pylama.linter"):
for entry in entry_points(group="pylama.linter"):
if entry.name not in LINTERS:
try:
LINTERS[entry.name] = entry.load()
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mccabe >= 0.7.0
pycodestyle >= 2.9.1
pydocstyle >= 6.1.1
pyflakes >= 2.5.0
setuptools
28 changes: 19 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@

import pathlib

import pkg_resources
from setuptools import setup


def parse_requirements(path: str) -> "list[str]":
with pathlib.Path(path).open(encoding='utf-8') as requirements:
return [str(req) for req in pkg_resources.parse_requirements(requirements)]


OPTIONAL_LINTERS = ['pylint', 'eradicate', 'radon', 'mypy', 'vulture']


setup(
install_requires=parse_requirements("requirements/requirements.txt"),
install_requires=[
'mccabe>=0.7.0',
'pycodestyle>=2.9.1',
'pydocstyle>=6.1.1',
'pyflakes>=2.5.0'
],
extras_require=dict(
tests=parse_requirements("requirements/requirements-tests.txt"),
tests=[
'pytest>=7.1.2',
'pytest-mypy',
'eradicate>=2.0.0',
'radon>=5.1.0',
'mypy',
'pylint>=2.11.1',
'pylama-quotes',
'toml',
'vulture',
'types-setuptools',
'types-toml'
],
all=OPTIONAL_LINTERS, **{linter: [linter] for linter in OPTIONAL_LINTERS},
toml="toml>=0.10.2",
),
Expand Down