Skip to main content

Introduction

The pyempt package is a python emacs package for type checking and other syntax analysis. It is basically a simple wrapper around other python syntax checkers to simplify the process of calling pylint, pep8, etc. from something like emacs flymake.

In principle, you could do all of this with a a few simple scripts. It’s nice being able to pip install something that works and collaborate on improvements, however, and that is what pyempt is for.

Installation

To install pyempt, first do something like pip install pyempt or sudo pip install pyempt. Then add something like the following to your ~/.emacs file to run pyempt.

(when (load "flymake" t)
  (defun flymake-pyempt-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 "pyempt"  (list local-file))))
   (add-to-list 'flymake-allowed-file-name-masks
             '("\\.py\\'" flymake-pyempt-init)))

(add-to-list 'flymake-allowed-file-name-masks
  '("\\.py\\'" flymake-pyempt-init))

;; Uncomment following line if you want flymake to start on file load
;;(add-hook 'find-file-hook 'flymake-find-file-hook)

After you restart emacs or reload your init file, flymake should automatically start and call pyempt.

Usage

If you have installed pyempt and setup emacs to use it in flymake, there isn’t anything you need to do to use pyempt. Instead, it will run automatically inside emacs.

If you want to run it from the command line, you can type

pyempt --help

to see options and usage instructions or type

pyempt <PATH_TO_CHECK>

to run checks on everything in a given path.

Since pyempt will return a non-zero exit code if any of its checkers returns a non-zero code, you can simply check the return value of pyempt in build scripts or continuous integration tools.

Troubleshooting

If you have problems, the first thing to do is to try and run pyempt manually via something like

pyempt <FILE_TO_CHECK>

You can turn on logging via

pyempt <FILE_TO_CHECK> --log_level 0

You can get further help on the command line program via

pyempt --help

Forking

If you want to fork pyempt, you may find the following useful:

  1. The README.md file is the main file. Generate the rst version via something like pandoc README.md -t rst > README.rst

  2. Upload to pypi via something like make pypi provided you have your ~/.pypirc setup correctly.

Metadata

Release files for pyempt 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyempt 1.1.0
File Size Uploaded
pyempt-1.1.0.tar.gz 5.1 kB Details

Release files / pyempt-1.1.0.tar.gz

Download URL pyempt-1.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7771cc97221bd1773382995a13d4088d822dce5c490b0985da57ed2d40da6506
BLAKE2b-256 checksum
How to use checksums
011301cb930b1f2da265d2847697ed4e8748f62cdd4a8a280a98f0b7f4236f78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

This release

1.1.0 This release

1 release file

1.0.26

1 release file

1.0.25

1 release file

1.0.24

1 release file

1.0.23

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page