Development

Prerequisites

  • Python 3.8+ (the project is developed on Python 3.12).
  • pip.

Set up

git clone https://github.com/rkriad585/EMTranslator.git
cd EMTranslator
python -m pip install -e .

The editable install adds the emtranslator package and the emtrans command to the environment.

Run the tests

python -m pytest

The suite contains 32 tests across two files:

  • tests/test_core.py — unit tests for the Translator API (translation, casing, punctuation, reverse mode, persistence, TOML round-trip, migration).
  • tests/test_cli.py — end-to-end tests that run the CLI as a subprocess (python -m emtranslator ...) and assert on stdout, stderr, and exit codes.

Run a single file:

python -m pytest tests/test_core.py

Coding conventions

  • Python code follows PEP 8 with 4-space indentation (see .editorconfig).
  • The package must stay dependency-free: only the standard library is allowed.
  • Keep the emtrans CLI and the Translator API in sync when changing behavior.
  • Add tests for any new or changed behavior in tests/.

Versioning

The version is declared in three places and should be kept in sync:

  • pyproject.toml ([project] version)
  • src/emtranslator/__init__.py (__version__)
  • .version at the repository root

There is no dedicated lint configuration in the repository; pyproject.toml only configures pytest (testpaths = ["tests"]).

See also

Back to README