prospector 1.11.0__py3-none-any.whl → 1.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
prospector/blender.py CHANGED
@@ -4,9 +4,9 @@
4
4
  # the same line. For example, both pyflakes and pylint will generate an
5
5
  # "Unused Import" warning on the same line. This is obviously redundant, so we
6
6
  # remove duplicates.
7
+ import pkgutil
7
8
  from collections import defaultdict
8
9
 
9
- import pkg_resources
10
10
  import yaml
11
11
 
12
12
  __all__ = (
@@ -98,7 +98,7 @@ def blend(messages, blend_combos=None):
98
98
 
99
99
 
100
100
  def get_default_blend_combinations():
101
- combos = yaml.safe_load(pkg_resources.resource_string(__name__, "blender_combinations.yaml"))
101
+ combos = yaml.safe_load(pkgutil.get_data(__name__, "blender_combinations.yaml"))
102
102
  combos = combos.get("combinations", [])
103
103
 
104
104
  defaults = []
@@ -1,5 +1,6 @@
1
1
  # flake8: noqa
2
- import pkg_resources
2
+ import importlib.metadata
3
+
3
4
  import setoptconf as soc
4
5
 
5
6
  from prospector.config.datatype import OutputChoice
@@ -8,7 +9,7 @@ from prospector.tools import DEFAULT_TOOLS, TOOLS
8
9
 
9
10
  __all__ = ("build_manager",)
10
11
 
11
- _VERSION = pkg_resources.get_distribution("prospector").version
12
+ _VERSION = importlib.metadata.version("prospector")
12
13
 
13
14
 
14
15
  def build_manager():
@@ -121,7 +121,7 @@ def _load_content_package(name):
121
121
  file_names = (
122
122
  ["prospector.yaml", "prospector.yml"]
123
123
  if len(name_split) == 1
124
- else [f"{name_split[1]}.yaml", f"{name_split[1]}.yaml"]
124
+ else [f"{name_split[1]}.yaml", f"{name_split[1]}.yml"]
125
125
  )
126
126
 
127
127
  data = None
@@ -21,6 +21,7 @@ VALID_OPTIONS = LIST_OPTIONS + [
21
21
  "python-2-mode",
22
22
  "python-version",
23
23
  "namespace-packages",
24
+ "check-untyped-defs",
24
25
  ]
25
26
 
26
27
 
@@ -90,6 +91,7 @@ class MypyTool(ToolBase):
90
91
  python_version = options.get("python-version", None)
91
92
  strict_optional = options.get("strict-optional", False)
92
93
  namespace_packages = options.get("namespace-packages", False)
94
+ check_untyped_defs = options.get("check-untyped-defs", False)
93
95
 
94
96
  self.options.append(f"--follow-imports={follow_imports}")
95
97
 
@@ -117,6 +119,9 @@ class MypyTool(ToolBase):
117
119
  if namespace_packages:
118
120
  self.options.append("--namespace-packages")
119
121
 
122
+ if check_untyped_defs:
123
+ self.options.append("--check-untyped-defs")
124
+
120
125
  for list_option in LIST_OPTIONS:
121
126
  for entry in options.get(list_option, []):
122
127
  self.options.append(f"--{list_option}-{entry}")
@@ -64,7 +64,7 @@ class PylintTool(ToolBase):
64
64
  continue
65
65
  for option in checker.options:
66
66
  if option[0] in options:
67
- checker.set_option(option[0], options[option[0]])
67
+ checker._arguments_manager.set_option(option[0], options[option[0]])
68
68
 
69
69
  # The warnings about disabling warnings are useful for figuring out
70
70
  # with other tools to suppress messages from. For example, an unused
@@ -167,7 +167,7 @@ class PylintTool(ToolBase):
167
167
  def _get_pylint_configuration(
168
168
  self, check_paths: List[Path], linter: ProspectorLinter, prospector_config, pylint_options
169
169
  ):
170
- self._args = linter.load_command_line_configuration(str(path) for path in check_paths)
170
+ self._args = check_paths
171
171
  linter.load_default_plugins()
172
172
 
173
173
  config_messages = self._prospector_configure(prospector_config, linter)
@@ -2,8 +2,14 @@ from pathlib import Path
2
2
 
3
3
  from packaging import version as packaging_version
4
4
  from pylint import version as pylint_version
5
+ from pylint.config.config_initialization import _config_initialization
5
6
  from pylint.lint import PyLinter
6
- from pylint.utils import _splitstrip
7
+
8
+
9
+ class UnrecognizedOptions(Exception):
10
+ """Raised when an unrecognized option is found in the Pylint configuration."""
11
+
12
+ pass
7
13
 
8
14
 
9
15
  class ProspectorLinter(PyLinter):
@@ -12,13 +18,10 @@ class ProspectorLinter(PyLinter):
12
18
  # set up the standard PyLint linter
13
19
  PyLinter.__init__(self, *args, **kwargs)
14
20
 
21
+ # Largely inspired by https://github.com/pylint-dev/pylint/blob/main/pylint/config/config_initialization.py#L26
15
22
  def config_from_file(self, config_file=None):
16
- """Will return `True` if plugins have been loaded. For pylint>=1.5. Else `False`."""
17
- self.read_config_file(config_file)
18
- if self.cfgfile_parser.has_option("MASTER", "load-plugins"):
19
- plugins = _splitstrip(self.cfgfile_parser.get("MASTER", "load-plugins"))
20
- self.load_plugin_modules(plugins)
21
- self.load_config_file()
23
+ """Initialize the configuration from a file."""
24
+ _config_initialization(self, [], config_file=config_file)
22
25
  return True
23
26
 
24
27
  def _expand_files(self, modules):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prospector
3
- Version: 1.11.0
3
+ Version: 1.12.1
4
4
  Summary: Prospector is a tool to analyse Python code by aggregating the result of other tools.
5
5
  Home-page: http://prospector.readthedocs.io
6
6
  License: GPLv2+
@@ -9,7 +9,7 @@ Author: Carl Crowder
9
9
  Author-email: git@carlcrowder.com
10
10
  Maintainer: Carl Crowder
11
11
  Maintainer-email: git@carlcrowder.com
12
- Requires-Python: >=3.8.1,<4.0
12
+ Requires-Python: >=3.9,<4.0
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: Intended Audience :: Developers
@@ -23,7 +23,6 @@ Classifier: Programming Language :: Python :: 3.10
23
23
  Classifier: Programming Language :: Python :: 3.11
24
24
  Classifier: Programming Language :: Python :: 3.12
25
25
  Classifier: Programming Language :: Python :: 3.13
26
- Classifier: Programming Language :: Python :: 3.8
27
26
  Classifier: Programming Language :: Python :: 3.9
28
27
  Classifier: Topic :: Software Development :: Quality Assurance
29
28
  Provides-Extra: with_bandit
@@ -36,22 +35,21 @@ Requires-Dist: GitPython (>=3.1.27,<4.0.0)
36
35
  Requires-Dist: PyYAML
37
36
  Requires-Dist: bandit (>=1.5.1); extra == "with_bandit" or extra == "with_everything"
38
37
  Requires-Dist: dodgy (>=0.2.1,<0.3.0)
39
- Requires-Dist: flake8 (<7.0.0)
38
+ Requires-Dist: flake8
40
39
  Requires-Dist: mccabe (>=0.7.0,<0.8.0)
41
40
  Requires-Dist: mypy (>=0.600); extra == "with_mypy" or extra == "with_everything"
42
41
  Requires-Dist: packaging
43
42
  Requires-Dist: pep8-naming (>=0.3.3,<=0.10.0)
44
43
  Requires-Dist: pycodestyle (>=2.9.0)
45
44
  Requires-Dist: pydocstyle (>=2.0.0)
46
- Requires-Dist: pyflakes (>=2.2.0,<4)
47
- Requires-Dist: pylint (>=2.8.3,<3.0)
45
+ Requires-Dist: pyflakes (>=2.2.0)
46
+ Requires-Dist: pylint (>=3.0)
48
47
  Requires-Dist: pylint-celery (==0.3)
49
- Requires-Dist: pylint-django (>=2.5,<2.6)
48
+ Requires-Dist: pylint-django (>=2.6.1)
50
49
  Requires-Dist: pylint-flask (==0.6)
51
- Requires-Dist: pylint-plugin-utils (>=0.7,<0.8)
52
50
  Requires-Dist: pyright (>=1.1.3); extra == "with_pyright" or extra == "with_everything"
53
51
  Requires-Dist: pyroma (>=2.4); extra == "with_pyroma" or extra == "with_everything"
54
- Requires-Dist: requirements-detector (>=1.2.0)
52
+ Requires-Dist: requirements-detector (>=1.3.1)
55
53
  Requires-Dist: setoptconf-tmp (>=0.3.1,<0.4.0)
56
54
  Requires-Dist: toml (>=0.10.2,<0.11.0)
57
55
  Requires-Dist: vulture (>=1.5); extra == "with_vulture" or extra == "with_everything"
@@ -1,11 +1,11 @@
1
1
  prospector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  prospector/__main__.py,sha256=-gdHYZxwq_P8er7HuZEBImY0pwaFq8uIa78dQdJsTTQ,71
3
3
  prospector/autodetect.py,sha256=ANuy7FBrxLxKP9pKELbCvBWHIHhm9g5B4kYbe5yyM5Q,2955
4
- prospector/blender.py,sha256=TXRme_bHKAi1eDREKGklSwUtcadQr-2E0EoX4AHxRL4,4444
4
+ prospector/blender.py,sha256=2-DktYCi5WRF-9vCXjN8ksb8NBGb15Mmf_MmnIhpujE,4425
5
5
  prospector/blender_combinations.yaml,sha256=yN7BOUCDomDZVRZzYxsRdxQPLpzxm9TDhv18B_GdLPU,6551
6
6
  prospector/compat.py,sha256=p_2BOebzUcKbUAd7mW8rn6tIc10R96gJuZS71QI0XY4,360
7
7
  prospector/config/__init__.py,sha256=yUO3j4DwpCTP6p3In8NzIUDf8dMMyYw8eX28yAvOl0c,13537
8
- prospector/config/configuration.py,sha256=0upMM9OvW93rW8TIrtP7yo_n6MWCh1gfCDjVwx_CW2M,13905
8
+ prospector/config/configuration.py,sha256=P1fIMqJrs1vAYyJ86JacbGdjJpsoAPOre7KTt0-fmx4,13899
9
9
  prospector/config/datatype.py,sha256=YuiwM-t89DGAmiBvkGA3y3roTTIKMCveIZnXVsZaWSQ,628
10
10
  prospector/encoding.py,sha256=3t4FjHgNlInyth7IYgBiJcD3a3iUYLdZQEBhNADx_44,1542
11
11
  prospector/exceptions.py,sha256=Vlu5FB0cDUO1BOgDTqk49-zq-GrcaC2RtXFuuS1347Y,1290
@@ -25,7 +25,7 @@ prospector/pathutils.py,sha256=81z36CjcbTb0JtvOdH0_FmT99PjAW4NbTF0TxJF884A,1306
25
25
  prospector/postfilter.py,sha256=yzQHhj_qnRZlQ1MGj5FXtBs7zWh4l68kaDa58ZIjGE0,2235
26
26
  prospector/profiles/__init__.py,sha256=q9zPLVEwo7qoouYFrmENsmByFrKKkr27Dd_Wo9btTJI,683
27
27
  prospector/profiles/exceptions.py,sha256=CpFTGZN55DW_CoUQdJH6DduM1fm8zfhNx5CHRCjv0kA,871
28
- prospector/profiles/profile.py,sha256=aJElTo_nTdI-3HGb0N0PAlWC_AcwmRYUXmE-6nl6LTo,16442
28
+ prospector/profiles/profile.py,sha256=Yz5UyKl0A8dXpbMoGQRp5tvW3fUX6K_na22-y-N_DIQ,16441
29
29
  prospector/profiles/profiles/default.yaml,sha256=tMy-G49ZdV7gkfBoN2ngtIWha3n7JVr_rEeNkLzpKsk,100
30
30
  prospector/profiles/profiles/doc_warnings.yaml,sha256=K_cBhUeKnSvOCwgwXE2tMZ-Fr5cJovC1XSholWglzN4,48
31
31
  prospector/profiles/profiles/flake8.yaml,sha256=wC-TJYuVobo9zPm4Yc_Ocd4Wwfemx0IufmAnfiuKkHk,156
@@ -50,20 +50,20 @@ prospector/tools/base.py,sha256=-Mj36ClqymzKl0WtigJd_3_8TZo2ZT4F3YIkj6tmv9Y,1575
50
50
  prospector/tools/dodgy/__init__.py,sha256=URSC-puhNw90Qj9CSHXZrLvVoj41hHBIgSKsGYgHTGM,1481
51
51
  prospector/tools/exceptions.py,sha256=Q-u4n6YzZuoMu17XkeKac1o1gBY36JK4MnvWaYrVYL0,170
52
52
  prospector/tools/mccabe/__init__.py,sha256=jFWsXzXMl1T_0IOQOYZ1CN0PGg1E4_dzOkrfnkKYISs,2919
53
- prospector/tools/mypy/__init__.py,sha256=6S3hL2OHmxQJznriPIAeXqp6Bu8AGgTi_K_FOfsPMU4,4367
53
+ prospector/tools/mypy/__init__.py,sha256=9iEDJCvII-3tSseWRZ2tKHVL18ZzwRkaM15RT74Jy5I,4551
54
54
  prospector/tools/profile_validator/__init__.py,sha256=oIGcqLqgOQXZ3DRyGIzEEWBlyH7PWmAPQ2i5WQ8Mx_U,7930
55
55
  prospector/tools/pycodestyle/__init__.py,sha256=3e8bQWiuUuHPX8jVlZOPj78nSHlyRI7tc-YB3lV9TK8,5452
56
56
  prospector/tools/pydocstyle/__init__.py,sha256=kwyvkT372J3rQrTK8MdhQMB8jHShoMu_Bcp0DXiA5Ts,2537
57
57
  prospector/tools/pyflakes/__init__.py,sha256=VgIBmp2orCq2qe374ea9XP0-rudHs09y-SniSuLYvMk,4997
58
- prospector/tools/pylint/__init__.py,sha256=BP0o0RtwihpbyfPcsWtXXJX38ie-88F411ESMYDbu3U,10032
58
+ prospector/tools/pylint/__init__.py,sha256=gMByTzq970QwHnom0aOq1hPJhA7c-g8T11YCn9H-fxY,9989
59
59
  prospector/tools/pylint/collector.py,sha256=TBvQpXWTcjIaIkZSEv7TWLz4VY9mgBM3xZaOmVz0N40,1334
60
- prospector/tools/pylint/linter.py,sha256=hNxHO8wkcNjjQf-rPmXCpX-Enkt0lmapcrxIWwJiFkE,1820
60
+ prospector/tools/pylint/linter.py,sha256=skH_stRsxkAHemyNqO_2wwHUw5Ew4o1trm7xC_WG5qs,1857
61
61
  prospector/tools/pyright/__init__.py,sha256=rpVe7XmEHCViQsyg6DN9sI5_b9tCO2fFeSuZfEqcaL8,2931
62
62
  prospector/tools/pyroma/__init__.py,sha256=yf5TiA0fB2bxjtqwfod3ahx5hnFyk9iy6u6C3H6VF-4,2947
63
63
  prospector/tools/utils.py,sha256=rOGn_FAiLHG9CS6KzE8FAJzXkEJMzdFYS29U19Ad7bA,1161
64
64
  prospector/tools/vulture/__init__.py,sha256=blzCrLQkGsvUuD6pp5ST3vgwvHvQ7jv-kqgY_Lukh1Q,3058
65
- prospector-1.11.0.dist-info/entry_points.txt,sha256=SxvCGt8MJTEZefHAvwnUc6jDetgCaaYY1Zpifuk8tqU,50
66
- prospector-1.11.0.dist-info/LICENSE,sha256=WoTRadDy8VbcIKoVzl5Q1QipuD_cexAf3ul4MaVLttc,18044
67
- prospector-1.11.0.dist-info/WHEEL,sha256=gSF7fibx4crkLz_A-IKR6kcuq0jJ64KNCkG8_bcaEao,88
68
- prospector-1.11.0.dist-info/METADATA,sha256=UthQhxdRGU81ajTG8DBnac9lYdGLb9L5DNNQh8cIPQo,10008
69
- prospector-1.11.0.dist-info/RECORD,,
65
+ prospector-1.12.1.dist-info/entry_points.txt,sha256=SxvCGt8MJTEZefHAvwnUc6jDetgCaaYY1Zpifuk8tqU,50
66
+ prospector-1.12.1.dist-info/LICENSE,sha256=WoTRadDy8VbcIKoVzl5Q1QipuD_cexAf3ul4MaVLttc,18044
67
+ prospector-1.12.1.dist-info/WHEEL,sha256=gSF7fibx4crkLz_A-IKR6kcuq0jJ64KNCkG8_bcaEao,88
68
+ prospector-1.12.1.dist-info/METADATA,sha256=fMfdiC8hs0IXX2U9I8Hush5bm0ak4ssc1KWHM3Ioz38,9886
69
+ prospector-1.12.1.dist-info/RECORD,,