Skip to content

Commit

Permalink
[deprecation] epylint removal for pylint 3.0.0 (#8400)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniël van Noord <[email protected]>
  • Loading branch information
Pierre-Sassoulas and DanielNoord authored Mar 8, 2023
1 parent 395042b commit 491c539
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 430 deletions.
22 changes: 0 additions & 22 deletions doc/development_guide/api/epylint.rst

This file was deleted.

3 changes: 1 addition & 2 deletions doc/development_guide/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
API
###

You can call ``Pylint``, ``epylint``, ``symilar`` and ``pyreverse`` from another
You can call ``Pylint``, ``symilar`` and ``pyreverse`` from another
Python program thanks to their APIs:

.. sourcecode:: python
Expand All @@ -19,4 +19,3 @@ Python program thanks to their APIs:
:hidden:

pylint
epylint
75 changes: 3 additions & 72 deletions doc/user_guide/installation/ide_integration/flymake-emacs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,6 @@ Using Pylint through Flymake in Emacs
=====================================

.. warning::
The Emacs package now has its own repository and is looking for a maintainer.
If you're reading this doc and are interested in maintaining this package or
are actually using flymake please open an issue at
https://github.com/emacsorphanage/pylint/issues/new/choose

To enable Flymake for Python, insert the following into your .emacs:

.. sourcecode:: common-lisp

;; Configure Flymake for Python
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "epylint" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))

;; Set as a minor mode for Python
(add-hook 'python-mode-hook '(lambda () (flymake-mode)))

Above stuff is in ``pylint/elisp/pylint-flymake.el``, which should be automatically
installed on Debian systems, in which cases you don't have to put it in your ``.emacs`` file.

Other things you may find useful to set:

.. sourcecode:: common-lisp

;; Configure to wait a bit longer after edits before starting
(setq-default flymake-no-changes-timeout '3)

;; Keymaps to navigate to the errors
(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-cn" 'flymake-goto-next-error)))
(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-cp" 'flymake-goto-prev-error)))


Finally, by default Flymake only displays the extra information about the error when you
hover the mouse over the highlighted line. The following will use the minibuffer to display
messages when you the cursor is on the line.

.. sourcecode:: common-lisp

;; To avoid having to mouse hover for the error message, these functions make Flymake error messages
;; appear in the minibuffer
(defun show-fly-err-at-point ()
"If the cursor is sitting on a Flymake error, display the message in the minibuffer"
(require 'cl)
(interactive)
(let ((line-no (line-number-at-pos)))
(dolist (elem flymake-err-info)
(if (eq (car elem) line-no)
(let ((err (car (second elem))))
(message "%s" (flymake-ler-text err)))))))

(add-hook 'post-command-hook 'show-fly-err-at-point)


Alternative, if you only wish to pollute the minibuffer after an explicit flymake-goto-* then use
the following instead of a post-command-hook

.. sourcecode:: common-lisp

(defadvice flymake-goto-next-error (after display-message activate compile)
"Display the error in the mini-buffer rather than having to mouse over it"
(show-fly-err-at-point))

(defadvice flymake-goto-prev-error (after display-message activate compile)
"Display the error in the mini-buffer rather than having to mouse over it"
(show-fly-err-at-point))
epylint was deprecated in 2.16.0 and targeted for deletion in 3.0.0.
All emacs and flymake related files were removed and their support will
now happen in an external repository: https://github.com/emacsorphanage/pylint.
3 changes: 3 additions & 0 deletions doc/whatsnew/fragments/7737.user_action
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
epylint was removed. It now lives at: https://github.com/emacsorphanage/pylint.

Refs #7737
18 changes: 0 additions & 18 deletions pylint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
"version",
"modify_sys_path",
"run_pylint",
"run_epylint",
"run_symilar",
"run_pyreverse",
]

import os
import sys
import warnings
from collections.abc import Sequence
from typing import NoReturn

Expand Down Expand Up @@ -48,22 +46,6 @@ def _run_pylint_config(argv: Sequence[str] | None = None) -> None:
_PylintConfigRun(argv or sys.argv[1:])


def run_epylint(argv: Sequence[str] | None = None) -> NoReturn:
"""Run epylint.
argv can be a list of strings normally supplied as arguments on the command line
"""
from pylint.epylint import Run as EpylintRun

warnings.warn(
"'run_epylint' will be removed in pylint 3.0, use "
"https://github.com/emacsorphanage/pylint instead.",
DeprecationWarning,
stacklevel=1,
)
EpylintRun(argv)


def run_pyreverse(argv: Sequence[str] | None = None) -> NoReturn:
"""Run pyreverse.
Expand Down
224 changes: 0 additions & 224 deletions pylint/epylint.py

This file was deleted.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ spelling = ["pyenchant~=3.2"]
[project.scripts]
pylint = "pylint:run_pylint"
pylint-config = "pylint:_run_pylint_config"
epylint = "pylint:run_epylint"
pyreverse = "pylint:run_pyreverse"
symilar = "pylint:run_symilar"

Expand Down
Loading

0 comments on commit 491c539

Please sign in to comment.