-
Notifications
You must be signed in to change notification settings - Fork 8
Explore Logic Bank
To get started, you will need:
-
Python3.8 (Relies on
from __future__ import annotations
, so requires Python 3.8)- Run the windows installer; on mac/Unix, consider using homebrew, as described here
-
virtualenv - see here (e.g.,
pip install virtualenv
) -
An IDE - any will do (I've used PyCharm and VSCode, install notes here), though different install / generate / run instructions apply for running programs
Issues? Try here.
Using your IDE or command line:
git fork / clone
cd LogicBank
cd examples/nw/basic_web_app
python run.py
The project includes:
- the logic engine that executes the rules
- the sample database (sqlite, so no db install is required)
- business logic, both
by-code and
by-rules,
to facilitate comparison
- control whether logic is via rules or code by altering
by_rules
in__init__.py
- control whether logic is via rules or code by altering
- a test folder that runs various sample transactions
You can run the programs in the examples/nw/tests
folder
(note the generated log),
and/or review this readme and the wiki.
Using this reference...
Acquire the setup software (initial, 1-time setup):
cd LogicBank
deactivate
python setup.py install
python3 -m pip install --user --upgrade twine
python3 -m pip install --user --upgrade setuptools wheel
Creating the dist
, first time
Get a Saved API Key
cd python-rules
deactivate
python3 setup.py sdist bdist_wheel
# verify this produced the dist folder; next command uploads to test Pypi
python3 -m twine upload --repository testpypi dist/*
User is __token__
, pwd is Saved API Key (from above).
This should upload to the test Pypi site
To re-upload:
- Delete the
dist
folder (andbuild
, and.egg
) - Alter the version number in
setup.py
deactivate
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing --repository testpypi dist/*
To install locally (beware - may require 15 mins until new version is active.
source venv/bin/activate
pip uninstall python-rules
pip install -i https://test.pypi.org/simple/ python-rules
Per this helpful link, you can build the wheel and install locally:
cd receiving_project
# fails to build: virtualenv venv --no-wheel --no-pip --no-setuptools
virtualenv venv
source venv/bin/activate
pip install /Users/val/dev/LogicBank
User Project Operations
Logic Bank Internals