This framework provides a pure-Python implementation of Finite-State Machines - simple and useful graph-like computational models.
Main code file can be found here: fsm.py
A toy problem can be found here: ToyProblem.md
And a solution for it can be found here: toy_problem.py
To set up the development environment, you'll need to clone the repository and install necessary dependencies using Poetry.
- Python >= 3.10
- Poetry >= 1.7
-
Clone the repository:
git clone git@github.com:MayMeta/finite_state_machines.git cd finite_state_machines
-
Install Poetry (if not already installed):
curl -sSL https://install.python-poetry.org | python3 -
-
Install the dependencies:
poetry install --only main
-
Activate the virtual environment:
poetry shell
Your development environment is now set up and ready to use.
To build the package, follow these steps:
-
Ensure you are in the root directory of the repository:
cd finite_state_machines
-
Build the package:
poetry build
The built package files will be located in the dist/
directory.
To install the built package in a different virtual environment, follow these steps:
-
Navigate to the directory where the built package files are located:
cd finite_state_machines/dist
-
Create a new virtual environment:
python3 -m venv new_env source new_env/bin/activate # On Windows use `new_env\Scripts\activate`
-
Install the package:
pip install finite_state_machines-0.1.0-py3-none-any.whl
To set up the development environment with all necessary dependencies, including development dependencies, use:
poetry install --with dev
- Ensure that your code is properly formatted before committing. Use the provided script to format your code:
poetry run bash format-code.sh finite_state_machines/
To install the test dependencies, use:
poetry install --with test
poetry run pytest