Code audit tool for python.

Overview

logo Pylama

Code audit tool for Python and JavaScript. Pylama wraps these tools:

  • pycodestyle (formerly pep8) © 2012-2013, Florent Xicluna;
  • pydocstyle (formerly pep257 by Vladimir Keleshev) © 2014, Amir Rachum;
  • PyFlakes © 2005-2013, Kevin Watters;
  • Mccabe © Ned Batchelder;
  • Pylint © 2013, Logilab (should be installed 'pylama_pylint' module);
  • Radon © Michele Lacchia
  • gjslint © The Closure Linter Authors (should be installed 'pylama_gjslint' module);
  • eradicate © Steven Myint;
  • Mypy © Jukka Lehtosalo and contributors;
Build Status Coverals Version Donate

Docs are available at https://pylama.readthedocs.org/. Pull requests with documentation enhancements and/or fixes are awesome and most welcome.

Requirements:

  • Python (2.7, 3.4, 3.5, 3.6, 3.7)
  • To use JavaScript checker (gjslint) you need to install python-gflags with pip install python-gflags.
  • If your tests are failing on Win platform you are missing: curses - http://www.lfd.uci.edu/~gohlke/pythonlibs/ (The curses library supplies a terminal-independent screen-painting and keyboard-handling facility for text-based terminals)

Installation:

Pylama could be installed using pip: ::

$ pip install pylama

Quickstart

Pylama is easy to use and really fun for checking code quality. Just run pylama and get common output from all pylama plugins (pycodestyle, PyFlakes and etc)

Recursive check the current directory.

$ pylama

Recursive check a path.

$ pylama <path_to_directory_or_file>

Ignore errors

$ pylama -i W,E501

Note

You could choose a group erros D,`E1` and etc or special errors C0312

Choose code checkers

$ pylama -l "pycodestyle,mccabe"

Choose code checkers for JavaScript:

$ pylama --linters=gjslint --ignore=E:0010 <path_to_directory_or_file>

Set Pylama (checkers) options

Command line options

$ pylama --help

usage: pylama [-h] [--verbose] [--version]
              [--format {pep8,pycodestyle,pylint,parsable}] [--select SELECT]
              [--sort SORT] [--linters LINTERS] [--ignore IGNORE]
              [--skip SKIP] [--report REPORT] [--hook] [--concurrent]
              [--options FILE] [--force] [--abspath]
              [paths [paths ...]]

Code audit tool for python.

positional arguments:
  paths                 Paths to files or directories for code check.

optional arguments:
  -h, --help            show this help message and exit
  --verbose, -v         Verbose mode.
  --version             show program's version number and exit
  --format {pep8,pycodestyle,pylint,parsable}, -f {pep8,pycodestyle,pylint,parsable}
                        Choose errors format (pycodestyle, pylint, parsable).
  --select SELECT, -s SELECT
                        Select errors and warnings. (comma-separated list)
  --sort SORT           Sort result by error types. Ex. E,W,D
  --linters LINTERS, -l LINTERS
                        Select linters. (comma-separated). Choices are mccabe,
                        pep257,pydocstyle,pep8,pycodestyle,pyflakes,pylint,iso
                        rt.
  --ignore IGNORE, -i IGNORE
                        Ignore errors and warnings. (comma-separated)
  --skip SKIP           Skip files by masks (comma-separated, Ex.
                        */messages.py)
  --report REPORT, -r REPORT
                        Send report to file [REPORT]
  --hook                Install Git (Mercurial) hook.
  --concurrent, --async
                        Enable async mode. Useful for checking a lot of files.
                        Unsupported with pylint.
  --options FILE, -o FILE
                        Specify configuration file. Looks for pylama.ini,
                        setup.cfg, tox.ini, or pytest.ini in the current
                        directory (default: None).
  --force, -F           Force code checking (if linter doesn't allow)
  --abspath, -a         Use absolute paths in output.

File modelines

You can set options for Pylama inside a source file. Use pylama modeline for this.

Format:

# pylama:{name1}={value1}:{name2}={value2}:...
.. Somethere in code
# pylama:ignore=W:select=W301

Disable code checking for current file:

.. Somethere in code
# pylama:skip=1

Those options have a higher priority.

Skip lines (noqa)

Just add # noqa in end of line to ignore.

def urgent_fuction():
    unused_var = 'No errors here' # noqa

Configuration file

Pylama looks for a configuration file in the current directory.

The program searches for the first matching ini-style configuration file in the directories of command line argument. Pylama looks for the configuration in this order:

pylama.ini
setup.cfg
tox.ini
pytest.ini

The "--option" / "-o" argument can be used to specify a configuration file.

Pylama searches for sections whose names start with pylama.

The "pylama" section configures global options like linters and skip.

[pylama]
format = pylint
skip = */.tox/*,*/.env/*
linters = pylint,mccabe
ignore = F0401,C0111,E731

Set Code-checkers' options

You could set options for special code checker with pylama configurations.

[pylama:pyflakes]
builtins = _

[pylama:pycodestyle]
max_line_length = 100

[pylama:pylint]
max_line_length = 100
disable = R

See code-checkers' documentation for more info. Let's notice that dashes are replaced by underscores (e.g. Pylint's "max-line-length" becomes "max_line_length").

Set options for file (group of files)

You could set options for special file (group of files) with sections:

The options have a higher priority than in the pylama section.

[pylama:*/pylama/main.py]
ignore = C901,R0914,W0212
select = R

[pylama:*/tests.py]
ignore = C0110

[pylama:*/setup.py]
skip = 1

Pytest integration

Pylama has Pytest support. The package automatically registers itself as a pytest plugin during installation. Pylama also supports pytest_cache plugin.

Check files with pylama

pytest --pylama ...

Recommended way to set pylama options when using pytest — configuration files (see below).

Writing a linter

You can write a custom extension for Pylama. Custom linter should be a python module. Name should be like 'pylama_<name>'.

In 'setup.py', 'pylama.linter' entry point should be defined.

setup(
    # ...
    entry_points={
        'pylama.linter': ['lintername = pylama_lintername.main:Linter'],
    }
    # ...
)

'Linter' should be instance of 'pylama.lint.Linter' class. Must implement two methods:

'allow' takes a path and returns true if linter can check this file for errors. 'run' takes a path and meta keywords params and returns a list of errors.

Example:

Just a virtual 'WOW' checker.

setup.py:

setup(
    name='pylama_wow',
    install_requires=[ 'setuptools' ],
    entry_points={
        'pylama.linter': ['wow = pylama_wow.main:Linter'],
    }
    # ...
)

pylama_wow.py:

from pylama.lint import Linter as BaseLinter

class Linter(BaseLinter):

    def allow(self, path):
        return 'wow' in path

    def run(self, path, **meta):
        with open(path) as f:
            if 'wow' in f.read():
                return [{
                    lnum: 0,
                    col: 0,
                    text: 'Wow has been finded.',
                    type: 'WOW'
                }]

Run pylama from python code

from pylama.main import check_path, parse_options

# Use and/or modify 0 or more of the options defined as keys in the variable my_redefined_options below.
# To use defaults for any option, remove that key completely.
my_redefined_options = {
    'linters': ['pep257', 'pydocstyle', 'pycodestyle', 'pyflakes' ...],
    'ignore': ['D203', 'D213', 'D406', 'D407', 'D413' ...],
    'select': ['R1705' ...],
    'sort': 'F,E,W,C,D,...',
    'skip': '*__init__.py,*/test/*.py,...',
    'async': True,
    'force': True
    ...
}
# relative path of the directory in which pylama should check
my_path = '...'

options = parse_options([my_path], **my_redefined_options)
errors = check_path(options, rootdir='.')

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/pylama/issues

Contributing

Development of pylama happens at GitHub: https://github.com/klen/pylama

Contributors

See AUTHORS.

License

Licensed under a BSD license.

Comments
  • New checker for JavaScript language.

    New checker for JavaScript language.

    Scope of this pull request:

    • added Closure-Linter JavaScript checker (code: https://code.google.com/p/closure-linter/source/browse/) to Pylama checkers,
    • added def gjslint callback in pylama\utils.py to handle gjslint linter request,
    • extended file extensions in main.py by .js suffix - default .py is always present due to main purpose of the tool,
    • introduced unittests in tests.py covering added functionalities (to test JavaScript code dummy.js was added to the root of Pylama)
    • fixed failing tests on Win platform, by adding platform check and platform depended errors to ignore,
    • extended README by gjslint entries,
    • extended requirements section in README by python-gflags and curses for Win platform users (after issues when running on clean Python 2.7 virtualenv).

    Attention:

    • no Python 3 support for gjslint due to issues like: usage of StringIO in closure_linter/tesutil.py etc.

    Requirements:

    • python-gflags
      • Linux: sudo apt-get install python-gflags and verify installation using: dpkg -s python-gflags
      • Windows: pip install python-gflags and verify installation using: pip freeze

    Tests:

    • Installing Pylama with integrated Closure-Linter checker by python setup.py install ended successfully.
    • New solution was successfully tested (unittests + end-user tests) on Win (v.7) and Unix/Linux (Ubuntu).

    Notes:

    • No modifications besides removal of printing utilities were done to Closure-Linter code. Printing utilities were removed due to common printing interface provided by Pylama.

    Usage:

    • pylama.exe --linters=gjslint --ignore=E:0010 --report=report.txt E:\path\to\dir_or_file
    • If Python and JavaScript linters are used at the same time, but in defined directory there is just JavaScript code or just Python code, then just this linter will be used for which the code was found. Example: If in E:\bootstrap\js there are just *.js files. Usage: pylama.exe --linters=pep8,gjslinter E:\bootstrap\js will use just gjslinter. It works exactly the same the other way round.
    opened by lukaszpiotr 29
  • Fix parsing of multi-options for pycodestyle

    Fix parsing of multi-options for pycodestyle

    This correctly parses options of the form "E302,W405", which before this was split into individual characters. This resulted in all errors and/or being considered when ignoring/selecting.

    Since specifying just "E" disables all errors, having a list of characters meant that it always encountered an individual "E" and thus disabled all errors.

    opened by maxnordlund 18
  • Rename async to async_mode for python 3.7 compatibility

    Rename async to async_mode for python 3.7 compatibility

    This PR should not break backwards compatibility for anyone using pylama as a command line tool. It is however breaking for anyone importing from pylama.async or relying on the existence of options.async.

    Fixes klen/pylama#89

    This PR is based on PR #112 by @maxnordlund and includes his commits.

    opened by michael-k 12
  • Absolute file path for output

    Absolute file path for output

    Feature Request: Can you provide an option to output the absolute file path of the files?

    Problem: We use PyCharm for the python development. There you can run external tools like pylama. In the settings you can add a filter for the filepath, linenumber and column. This create clickable links to the files in the output of the external tools. Unfortunately this works only if the filepath is absolute.

    Is it possible to add this option?

    opened by christophlsa 7
  • Exclude/Ignore is not working

    Exclude/Ignore is not working

    Maybe the style is being passed wrong to pycodestyle.

    How to reproduce

    1. In tox.ini create:
    [pycodestyle]
    exclude = .tox
    
    1. Run tox and pylama try to test everything inside .tox, example:
    pylama -v --options=tox.ini
    
    File is reading: .tox/py36-test/bin/rst2odt.py
    Run pycodestyle {'ignore': ['E501', 'C0301'], 'exclude': ['.tox', '.env', '.venv', '.git', 'build', 'dist', 'docs', 'tests', 'ui', '*.egg-info', '*cache*'], 'max-line-length': 100, 'statistics': ('T', 'r', 'u', 'e'), 'count': ('T', 'r', 'u', 'e')}
    
    1. Using the same configuration file, from tox.ini, but directly with pycodestyle:
    pycodestyle --config=tox.ini -v
    
    cli configuration: tox.ini
    directory .
    checking ./setup.py
    directory ./helpdev
    checking ./helpdev/__init__.py
    checking ./helpdev/__main__.py
    directory ./examples
    directory ./.vscode
    
    1. Executing passing a list insteady of a string seems to result the same as the problem with pylama:

    pycodestyle --exclude=['.tox'] -vv

    Maybe something related to #143, but for me, it does not match the description. Tks

    Info about the environment:

    * HARDWARE-----------------------------------------------------------------------
        - Machine....................... x86_64
        - Processor..................... Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
        - Total Memory.................. 16689 MB
        - Free Memory................... 2166 MB
        - Total Swap.................... 19999 MB
        - Free Swap..................... 19999 MB
    * OPERATING SYSTEM---------------------------------------------------------------
        - System........................ Linux
        - Release....................... 4.15.0-48-generic
        - Platform...................... Linux-4.15.0-48-generic-x86_64-with-debian-buster-sid
        - Version....................... #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019
    * THREADS------------------------------------------------------------------------
        - Version....................... NPTL 2.27
        - Name.......................... pthread
        - Lock.......................... semaphore
    * PYTHON DISTRIBUTION------------------------------------------------------------
        - Version....................... 3.6.8
        - C Compiler.................... GCC 7.3.0
        - C API Version................. 1013
        - Implementation................ cpython
        - Implementation Version........ 3.6.8
    * PYTHON PACKAGES----------------------------------------------------------------
        - pycodestyle................... 2.5.0
        - pylama........................ 7.7.1
        - tox........................... 3.9.0
    

    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    opened by dpizetta 6
  • settings overwriting eachother

    settings overwriting eachother

    I have the following lines in my pylama.ini file [pylama:*/init.py] ignore = W0611

    [pylama:bla/init.py] ignore = E402,W0611

    On one machine this works as expected (W0611 is ignored for all init.py files, while bla/init.py also ignores E402). But when the same code is checked on a different machine, with the same pylama version, it causes E402 errors to be found for bla/init.py.

    opened by mruwnik 6
  • Specify line length for all linters.

    Specify line length for all linters.

    I would like to set my line length to 120 as opposed to 79.

    It seems that pylama has no global option to specify line length config. When running pep8 it is ignoring the global pep8 config file.

    opened by hardkrash 6
  • mccabe cannot be configured

    mccabe cannot be configured

    There is no documentation on how to setup mccabe when using pylama. Anyone would expect something like the following inside setup.cfg:

    [pylama:mccabe]
    max-complexity = 15
    

    But on adding this I still get the error (obfuscated):

    scrapers/***/scraper.py:62:1: C901 '***' is too complex (12) [mccabe]
    

    I assume the default is 10 due to this, but the override is not being picked up.


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    opened by jameswilliams1 5
  • Clarify license for Debian packaging

    Clarify license for Debian packaging

    Currently I am working on creating Debian package for pylama (https://bugs.debian.org/779449). However, the content of pylama/__init__.py is confused. The comment string says it is BSD license, but the LICENSE file is LGPL-3+.

        """
    Code audit tool for python.
    :copyright: 2013 by Kirill Klenov.
    :license: BSD, see LICENSE for more details.
    """
    
    __version__ = "7.0.9"
    __project__ = "pylama"
    __author__ = "Kirill Klenov <[email protected]>"
    __license__ = "GNU LGPL"
    

    Please help to clarify the actual license of this package by removing other license name/text in pylama so that we can work on Debian packaging, thanks.

    --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34617584-clarify-license-for-debian-packaging?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github).
    opened by czchen 5
  • [WIP] setup.py: install_requires: remove versions

    [WIP] setup.py: install_requires: remove versions

    I am trying to install pylama system-wide on Arch Linux, which has pyflakes 1.1.0 already, and running pylama fails with:

    pkg_resources.ContextualVersionConflict: (pyflakes 1.1.0 (/usr/lib/python3.5/site-packages), Requirement.parse('pyflakes==1.0.0'), {'pylama'})

    pkg_resources.DistributionNotFound: The 'pyflakes==1.0.0' distribution was not found and is required by pylama

    This commit fixes it by only using the package name from requirements.txt, but not the version.

    Alternatively I could imagine replacing the '==' with '>=' to ensure the minimum requirements are met, which is probably better?!

    On the other hand this might not be useful altogether, and instead tools like pipsi or virtualenvs should be used for pylama only?!

    opened by blueyed 5
  • pylint linter is ignored when pylama is run under pytest

    pylint linter is ignored when pylama is run under pytest

    i have this in tox.ini

    [pytest]
    norecursedirs = build .* .env media static deployment
    addopts = -vvl --pylama
    DJANGO_SETTINGS_MODULE=pdt.settings_test
    
    [pylama]
    format = pep8
    skip = */.tox/*,*/.env/*,pdt/core/migrations/*
    linters = pylint,mccabe,pep8,pep257
    ignore = F0401,C0111,E731,D100
    
    [pylama:pep8]
    max_line_length = 120
    

    when i run tests:

    ─[0] <git:(master 3b9152f✱✈) > py.test tests
    =============================================================================================== test session starts ===============================================================================================
    platform linux -- Python 3.4.0 -- py-1.4.26 -- pytest-2.7.0 -- /home/vagrant/workspace/pdt/.env/bin/python3
    cachedir: /home/vagrant/workspace/pdt/.cache
    rootdir: /home/vagrant/workspace/pdt, inifile: tox.ini
    plugins: pep257, cache, pep8, django, pylama, cov
    collected 7 items 
    
    tests/__init__.py SKIPPED
    tests/conftest.py SKIPPED
    tests/api/__init__.py SKIPPED
    tests/api/test_api.py SKIPPED
    tests/api/test_api.py::test_migration_filter_exclude_status PASSED
    tests/api/test_api.py::test_migration_filter_status PASSED
    tests/api/test_api.py::test_migration_filter_ci_project PASSED
    
    ======================================================================================= 3 passed, 4 skipped in 0.85 seconds =======================================================================================
    
    

    but when i run pylama separately:

    └─[0] <git:(master 3b9152f✱) > pylama tests                
    tests/conftest.py:19:23: W0622 Redefining built-in 'type' [pylint]
    tests/conftest.py:51:19: W0621 Redefining name 'ci_project_name' from outer scope (line 39) [pylint]
    tests/conftest.py:51:36: W0621 Redefining name 'ci_project_description' from outer scope (line 45) [pylint]
    tests/conftest.py:69:50: W0621 Redefining name 'ci_project' from outer scope (line 51) [pylint]
    tests/conftest.py:69:13: W0621 Redefining name 'instance_name' from outer scope (line 57) [pylint]
    tests/conftest.py:69:28: W0621 Redefining name 'instance_description' from outer scope (line 63) [pylint]
    tests/conftest.py:71:0: C0301 Line too long (111/100) [pylint]
    tests/conftest.py:87:12: W0621 Redefining name 'release_name' from outer scope (line 75) [pylint]
    tests/conftest.py:87:26: W0621 Redefining name 'release_date' from outer scope (line 81) [pylint]
    tests/conftest.py:111:9: W0621 Redefining name 'case_id' from outer scope (line 93) [pylint]
    tests/conftest.py:111:48: W0621 Redefining name 'ci_project' from outer scope (line 51) [pylint]
    tests/conftest.py:111:30: W0621 Redefining name 'case_description' from outer scope (line 105) [pylint]
    tests/conftest.py:111:18: W0621 Redefining name 'case_title' from outer scope (line 99) [pylint]
    tests/conftest.py:111:60: W0621 Redefining name 'release' from outer scope (line 87) [pylint]
    tests/conftest.py:114:0: C0301 Line too long (107/100) [pylint]
    tests/conftest.py:121:28: W0108 Lambda may not be necessary [pylint]
    tests/conftest.py:144:27: W0108 Lambda may not be necessary [pylint]
    tests/conftest.py:156:28: W0108 Lambda may not be necessary [pylint]
    tests/conftest.py:166:28: W0108 Lambda may not be necessary [pylint]
    tests/api/test_api.py:31:0: C0330 Wrong hanging indentation.             'id': mr2.id,             ^   | [pylint]
    tests/api/test_api.py:32:0: C0330 Wrong hanging indentation.             'ci_project': migration.case.ci_project.name,             ^   | [pylint]
    tests/api/test_api.py:33:0: C0330 Wrong hanging indentation.             'instance': mr2.instance.name,             ^   | [pylint]
    tests/api/test_api.py:34:0: C0330 Wrong hanging indentation.             'status': mr2.status,             ^   | [pylint]
    tests/api/test_api.py:35:0: C0330 Wrong hanging indentation.             'datetime': equals_any,             ^   | [pylint]
    tests/api/test_api.py:36:0: C0330 Wrong hanging indentation.             'log': mr2.log},             ^   | [pylint]
    tests/api/test_api.py:37:0: C0330 Wrong continued indentation.         ]         ^                    | [pylint]
    
    

    opened by bubenkoff 5
  • Pydocstyle release 6.2.0 breaks pylama

    Pydocstyle release 6.2.0 breaks pylama

    With the release of pydocstyle 6.2.0, they changed the method signature of PyDocChecker().check_source to have an additional parameter https://github.com/PyCQA/pydocstyle/pull/546/files#diff-8036a1f043bf5856770399b0a1b5b13e7fc59cd1fc2e6bc2d8ca93f49a5d3406R134

    def check_source(
        self,
        source,
        filename,
        ignore_decorators=None,
        property_decorators=None,
        ignore_inline_noqa=False,
    )
    

    So now it is passing in the ignore_inline_noqa value to the property_decorators param in pylama_pycodestyle.py

    for err in PyDocChecker().check_source(
        ctx.source,
        ctx.filename,
        params.get("ignore_decorators"),
        params.get("ignore_inline_noqa", False),
    ):
    
    opened by cjkirk09 0
  • Use tomli/tomllib instead of the unmaintained toml package

    Use tomli/tomllib instead of the unmaintained toml package

    Replace the use of the unmaintained toml package with the modern alternatives: the built-in tomllib in Python 3.11+, and its equivalent tomli in older Python versions. tomli installs type stubs, so there is no need for an additional types-* package for it.

    opened by mgorny 0
  • Docs: Add section about configuring `pre-commit`

    Docs: Add section about configuring `pre-commit`

    Currently one cannot even find the information that pylama defines a pre-commit hook. I think a section about setting this up would be userfriendly, also regarding #229.

    opened by real-yfprojects 0
  • feat: extract todos

    feat: extract todos

    should a code audit tool have the ability to extract TODO comments from the code?

    i sure think so!

    let me know if y'all are open to a PR. I'm imagining single-line support only atm. If the config file specifies tool.pylama.todo-file then we will by default collect text after TODO: and dup those lines log-style plaintext into the destination file.

    could later be generalized to comment extraction of non-todo comments but meh for now nah

    opened by upstartjohnvandivier 0
  • 8.3.8: Support for pylint>=2.13.0

    8.3.8: Support for pylint>=2.13.0

    Context

    Python version == 3.8.2 Pylama version == 8.3.8 Pylint version >= 2.13.0

    Problem

    From the Pylint changelog:

    When run in parallel mode pylint now pickles the data passed to subprocesses with the dill package. The dill package has therefore been added as a dependency.

    Pylint fails to pickle pylint.lint.pylinter.PyLinter.reporter, which is a pylama Reporter object:

    Traceback (most recent call last):
      File "/Users/*/.local/share/virtualenvs/*/bin/pylama", line 8, in <module>
        sys.exit(shell())
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylama/main.py", line 115, in shell
        errors = check_paths(
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylama/main.py", line 68, in check_paths
        errors += run(path=path, code=code, rootdir=rootdir, options=options)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylama/core.py", line 36, in run
        linter.run_check(ctx)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylama/lint/pylama_pylint.py", line 69, in run_check
        Run([ctx.temp_filename] + args, reporter=reporter, exit=False)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylint/lint/run.py", line 358, in __init__
        linter.check(args)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1077, in check
        check_parallel(
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/pylint/lint/parallel.py", line 149, in check_parallel
        jobs, initializer=initializer, initargs=[dill.dumps(linter)]
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/dill/_dill.py", line 304, in dumps
        dump(obj, file, protocol, byref, fmode, recurse, **kwds)#, strictio)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/dill/_dill.py", line 276, in dump
        Pickler(file, protocol, **_kwds).dump(obj)
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/dill/_dill.py", line 498, in dump
        StockPickler.dump(self, obj)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 485, in dump
        self.save(obj)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 601, in save
        self.save_reduce(obj=obj, *rv)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 715, in save_reduce
        save(state)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 558, in save
        f(self, obj)  # Call unbound method with explicit self
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/dill/_dill.py", line 990, in save_module_dict
        StockPickler.save_dict(pickler, obj)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 969, in save_dict
        self._batch_setitems(obj.items())
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 995, in _batch_setitems
        save(v)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 601, in save
        self.save_reduce(obj=obj, *rv)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 685, in save_reduce
        save(cls)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 558, in save
        f(self, obj)  # Call unbound method with explicit self
      File "/Users/*/.local/share/virtualenvs/*/lib/python3.8/site-packages/dill/_dill.py", line 1440, in save_type
        StockPickler.save_global(pickler, obj, name=name)
      File "/Users/*/.pyenv/versions/3.8.2/lib/python3.8/pickle.py", line 1068, in save_global
        raise PicklingError(
    _pickle.PicklingError: Can't pickle <class 'pylama.lint.pylama_pylint.Linter.run_check.<locals>.Reporter'>: it's not found as pylama.lint.pylama_pylint.Linter.run_check.<locals>.Reporter
    

    Suggestions

    • Moving Reporter from Linter.run_check to Linter will resolve the problem.
    • Pinning pylint<=2.12.2 for the time being.
    opened by SeanBickle 0
  • is there just a place where I can just download the files I need?

    is there just a place where I can just download the files I need?

    i cant install pip or python (but I have atom so I can just use it there). is there any way I can just like install the files as a zip directly from here or some other website?

    opened by ashbit06 1
Releases(1.2.0)
Owner
Kirill Klenov
Kirill Klenov
Python classes with types validation at runtime.

typedclasses Python classes with types validation at runtime. (Experimental & Under Development) Installation You can install this library using Pytho

Izhar Ahmad 8 Feb 06, 2022
Collection of awesome Python types, stubs, plugins, and tools to work with them.

Awesome Python Typing Collection of awesome Python types, stubs, plugins, and tools to work with them. Contents Static type checkers Dynamic type chec

TypedDjango 1.2k Jan 04, 2023
Type stubs for the lxml package

lxml-stubs About This repository contains external type annotations (see PEP 484) for the lxml package. Installation To use these stubs with mypy, you

25 Dec 26, 2022
MonkeyType as a pytest plugin.

MonkeyType as a pytest plugin.

Marius van Niekerk 36 Nov 24, 2022
Custom Python linting through AST expressions

bellybutton bellybutton is a customizable, easy-to-configure linting engine for Python. What is this good for? Tools like pylint and flake8 provide, o

H. Chase Stevens 249 Dec 31, 2022
A Python Parser

parso - A Python Parser Parso is a Python parser that supports error recovery and round-trip parsing for different Python versions (in multiple Python

Dave Halter 520 Dec 26, 2022
Optional static typing for Python 3 and 2 (PEP 484)

Mypy: Optional Static Typing for Python Got a question? Join us on Gitter! We don't have a mailing list; but we are always happy to answer questions o

Python 14.4k Jan 08, 2023
A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.

flake8-bugbear A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycode

Python Code Quality Authority 869 Dec 30, 2022
Mypy stubs, i.e., type information, for numpy, pandas and matplotlib

Mypy type stubs for NumPy, pandas, and Matplotlib This is a PEP-561-compliant stub-only package which provides type information for matplotlib, numpy

Predictive Analytics Lab 194 Dec 19, 2022
👻 Phantom types for Python

phantom-types Phantom types for Python will help you make illegal states unrepresentable and avoid shotgun parsing by enabling you to practice "Parse,

Anton Agestam 118 Dec 22, 2022
🦆 Better duck-typing with mypy-compatible extensions to Protocol

🦆 Quacks If it walks like a duck and it quacks like a duck, then it must be a duck Thanks to PEP544, Python now has protocols: a way to define duck t

Arie Bovenberg 9 Nov 14, 2022
Easy saving and switching between multiple KDE configurations.

Konfsave Konfsave is a config manager. That is, it allows you to save, back up, and easily switch between different (per-user) system configurations.

42 Sep 25, 2022
Enforce the same configuration across multiple projects

Nitpick Flake8 plugin to enforce the same tool configuration (flake8, isort, mypy, Pylint...) across multiple Python projects. Useful if you maintain

Augusto W. Andreoli 315 Dec 25, 2022
Static Typing for Python

Python static typing home. Contains the source for typing_extensions and the documentation. Also hosts a user help forum.

Python 1.3k Jan 06, 2023
Simple Python style checker in one Python file

pycodestyle (formerly called pep8) - Python style guide checker pycodestyle is a tool to check your Python code against some of the style conventions

Python Code Quality Authority 4.7k Jan 01, 2023
Automated security testing using bandit and flake8.

flake8-bandit Automated security testing built right into your workflow! You already use flake8 to lint all your code for errors, ensure docstrings ar

Tyler Wince 96 Jan 01, 2023
Flake8 wrapper to make it nice, legacy-friendly, configurable.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks It's a Flake8 wrapper to make it cool. Lint md, rst, ipynb, and more. Shareable and r

Life4 232 Dec 16, 2022
Flake8 plugin for managing type-checking imports & forward references

flake8-type-checking Lets you know which imports to put in type-checking blocks. For the imports you've already defined inside type-checking blocks, i

snok 67 Dec 16, 2022
Unbearably fast O(1) runtime type-checking in pure Python.

Look for the bare necessities, the simple bare necessities. Forget about your worries and your strife. — The Jungle Book.

beartype 1.4k Jan 01, 2023
Utilities for refactoring imports in python-like syntax.

aspy.refactor_imports Utilities for refactoring imports in python-like syntax. Installation pip install aspy.refactor_imports Examples aspy.refactor_i

Anthony Sottile 20 Nov 01, 2022