pentagraph
Graph representation and tools for programming with pentagame. This is in active development an will be fully functional with the 0.0.1 release The development is on hiatus at the moment, becuase there's an active attempt at creating similiar rust implementation that will be faster an more complete.
Setup
Pip
You will need a working instance of pip.
python3 -m pip install pentagraph
Development
Clone from github (requires git): git clone https://github.com/Penta-Game/pentagraph
To install the dependencies you can use poetry
: poetry install
All files are required to have full typing support and need to pass mypy (This is checked in the Python package
workflow on push/ pull request).
License
The source code of pentagraph is distributed according to the MIT License by Cobalt
Libraries as listed in pyproject.toml
please consider their respective Licenses before e.g. making commercial use of pentagraph
.
The same applies for materialize and svg.js.
Development Notes
Contributing and CI
There are 2 github actions workflows. The Python Packge
workflow is called on each push & merged pull request. This workflow runs test against the new version (pytest tests/
) and checks if files in pentagraph/
could be formatted with black. If either files could be formatted, the tests fail or the requirements are broken, the run fails. For black errors format.py
can recursively execute black against all files in pentagraph/
(you need to install black before using this). As an alternative python -m black . --target-version py38
would be an appropriate direct call.
The other workflow releases a new pip package on each github release. This release oriented workflow takes advantage of twine and github repository specific secrets. When this workflow crashes with authentication related errors contact Cobalt.
Dependency managing is handled by poetry. Poetry is also used fo the packaging runs though you should update requirements.txt
at least before creating a release with poetry export -f requirements.txt > requirements.txt
.
pentagraph.lib.graphic
An easy-to-use way of displaying the Board
taking advantage of Flask in combination with materialize, svg.js. The final board svg is created with a variation of resources from boardgame.
pentagraph.lib.figures
Collection of Objects used for figure representation. These Objects also specifiy their respective drawing methods and types.
pentagraph.lib.graph
Graph representation as Board
Object.
pentagraph.lib.math
Math usable for graphic representation of pentagame board. Python version of math used in pentagraph.lib.graphic
.
Docs
The raw outline of the docs (WIP) is available on github pages and is managed in /gh-pages.