Development

Managing with ttasks.py

tt ships with a script ttasks.py (tt + tasks = ttasks) in the project’s top-level directory, used to manage common project tasks. You will see it referenced below.

Dependencies

All development requirements for tt are stored in the dev-requirements.txt file in the project’s top-level directory. You can install all of these dependencies with:

pip install -r dev-requirements.txt

Testing

Testing is done with Python’s unittest and doctest modules. All tests can be run using the ttasks.py script:

python ttasks.py test

Note that while doc tests are used, this is mostly just to make sure the documentation examples are valid. The true behavior of the library and public contract is enforced through unit tests.

Cross-Python version testing is achieved through tox. To run changes against the reference and style tests, simply invoke tox from the top-level directory of the project; tox will run the unit tests against the compatible CPython runtimes. Additionally, the source is run through the Flake8 linter. Whenever new code is pushed to the repo, this same set of tox tests is run on AppVeyor (for Windows builds). A separate configuration is used for Travis CI, which tests on Linux and also adds the ability to test on the PyPy runtime.

Style

tt aims to be strictly PEP8 compliant, enforcing this compliance via Flake8. This project includes an editorconfig file to help with formatting issues, as well.

Releases

Work for each release is done in a branch off of develop following the naming convention v{major}.{minor}.{micro}. When work for a version is complete, its branch is merged back into develop, which is subsequently merged into master. The master branch is then tagged with the release version number, following the scheme {major}.{minor}.{micro}.

After these steps, make sure you update the release notes, publish on Read the Docs, and publish on PyPI.

Long Term Development Goals

Below are features I’d like to add eventually, roughly ordered in anticipated schedule of completion. A new release will be cut every so often down the list.

  • For the CLI

    • Functional testing, capturing stdout/stderr
    • Option for interfacing with the truth table’s fill method
    • Option for interfacing with the truth table’s ordering attribute
    • Option for specifying output delimiters for token-listing commands
  • For the project as a whole

    • A Getting Started section for the docs, with a tutorial-style guide to the library and CLI
    • Karnaugh map support
    • Interface for substituting/transforming expression symbols
    • Functionality for optimizing/simplifying expressions (pos, sop, espresso, etc.)