Python-ta

Latest version: v2.8.1

Safety actively analyzes 683530 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 6

2.8.0

✨ Enhancements

- Add new boolean configuration `allow-local-imports` to allow for local imports
- Extended the `snasphot` function to include the relevant variables defined at the top level (global variables).
- Include the pycodestyle error code to the error message for PEP8 style errors
- Added date and time display to `PlainReporter` and `ColorReporter`
- Allowed specifying allowed names in configurations `allowed-import-modules` and `extra-imports` instead of just modules
- Improved error display for pycodestyle (E9989) errors E123, E203, E222, E226, and E262
- Added the configuration option to ignore naming convention violations (C9103 and C9104) for names matching the provided regular expression.
- Update to pylint v3.1 and and astroid v3.1
- Stored actual AST condition node in edges leading out of If/While blocks in generated control flow graphs.
- Stored valid Python function preconditions in initial edge to function code in generated function control flow graphs.
- Report warning when control flow graph creation encounters a syntax error related to control flow
- Added autoformat option that runs black formatting tool to python_ta.check_all()
- Extended the `snapshot` function to optionally generate a svg of the snapshot using MemoryViz when save parameter is true.

💫 New checkers

2.7.0

✨ Enhancements

- Added new configuration option `use-pyta-error-messages` to let users choose whether PythonTA should overwrite pylint's error messages.
- Both PlainReporter and ColorReporter emphasize specific code chunks by using overline characters under any part that is highlighted as ERROR.
- Added snapshot function for deriving a list of dictionaries containing local variables from relevant functions and/or stack frames.
- Added new configuration option `allow-pylint-comments` to let users choose whether PythonTA should allow comments beginning with pylint: or not.
- `AccumulationTable` can now track variables initialized within the `for` loop. Prior, only variables initialized before the `for` loop could be tracked.
- `AccumulationTable` now stores deep copies of objects rather than shallow copies, thus fixing issues that come up in case of mutation during loop.
- `AccumulationTable` can now take in any accumulator expressions, for eg. `x * 2`, instead of just variables.
- `AccumulationTable` now has an optional initialization argument `output` which allows the users to choose whether they want to write the Accumulation Table to a file.
- Created a `RecursionTable` context manager for recursive tracing using a tabular output.
- Support Python 3.12 (requiring upgrade to pylint and astroid 3.0)

🐛 Bug fixes

- Fix bug in ending location setting for `Attribute` and `DelAttr` nodes when the same attribute
was accessed twice on the same line.
- Fix bug where the `naming-convention-violation` checker was checking variables defined in a module's main block. This was inconsistent with the `forbidden-global-variables` checker.
- Fixed bug with `invalid-range-index`: do not attempt any inference of variables in `range` expressions. All range arguments involving variables will be ignored by this checker.

💫 New checkers

2.6.4

🐛 Bug fixes

- Fixed bug with `invalid-range-index` when variables are used in `range` expressions.

2.6.3

🐛 Bug fixes

- Ensure pycodestyle W503, line break before binary operator, is disabled (regression from 2.6.2).
- Fix `check_contracts` typings so PyCharm static checking will work
- Fix `invalid-range-index` bug where valid range calls were flagged as invalid

2.6.2

🐛 Bug fixes

- Fix `naming-convention-violation` bug where `_` was considered an invalid variable name.
- Fix `naming-convention-violation` bug where top-level constants were being checked as regular variable names.

✨ Enhancements

- Created many custom renderers to make the code snippets for `pep8-errors` easier to understand.

2.6.1

🐛 Bug fixes

- Make `graphviz` an optional dependency, and clarify the installation requirements for visualizing
control flow graphs.
- Fix `check_contrats` handling of forward references in class type annotations when using `check_contracts` decorator.
- Fix handling of `|` in type annotations (by updating to `typeguard` v4.1.0).

Page 3 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.