Skip to main content

Python Diff

Project description

pyff: Python Diff

The purpose of Python Diff (pyff) is to compare two versions of a Python module and detect syntactical and semantical differences between them. Currently pyff is a very early-stage, experimental toy project, so please do not expect miracles.

Build Status Maintainability Codacy Badge Coverage Status

Usage

You can install pyff, preferably to a virtual environment, using the setup.py file.

$ python -m venv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python setup.py install
(...)

This installs the pyff executable that accepts two Python files as positional arguments:

$ pyff tests/examples/01-run.old tests/examples/01-run.new
Added import of new names ArgumentParser, Action from new package argparse
New class ParsePlayerAction with 0 public methods
Function main changed implementation, newly uses external names ArgumentParser

Programmatical interface in the form of pyff.api or something similar is on the roadmap.

Development

Currently, pyff is quite trivial, but one of my goals while working on it was to try use various Python development support tools, sometimes quite excessively: pytest is used for testing (along with few plugins) and Pylint for static analysis. The code of pyff is annotated with Python type hints and mypy is used to check them. There are shell helpers in helpers/helpers.sh that make executing all checks easier:

$ pip install -r requirements-tests.txt
$ . helpers/helpers.sh
$ ft # Fast Test: run all tests without coverage, pylint and mypy check
$ st # Slow Test: run all tests with coverage, pylint and mypy

Future

Currently, the high-level roadmap looks somewhat like this:

  1. Finish the pyff command and provide basic set of smart comparisons.
  2. Provide programmatical API (allow import pyff.api) providing machine-readable difference artifact.
  3. Build a Git-aware comparison tools that will be able to compare Git revisions (instead of single files)
  4. Build a PR-commenting GitHub bot that should provide human readable, natural language "summaries" to submitted Python project PRs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythondiff-0.6.1.tar.gz (18.7 kB view hashes)

Uploaded Source

Built Distribution

pythondiff-0.6.1-py3-none-any.whl (22.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page