Open keithrfung opened 2 years ago
To further add on to this, the isolated pyproject.toml or project files help to ensure different virtual environments. This means when the CLI is started up it has its own separate virtual environment from the core built by itself and its test suite. This should help better isolate tests
Is there an existing issue for this?
Suggestion
The existing structure of the repository has a focus on exporting the ElectionGuard Core which is present in the
src/electionguard
file path. Gradually, more has been added but there has been a lack of distinction between the sections. Here is a full description of each section:electionguard
: The core python electionguardelectionguard_tools
: An addendum to the core to add hypothesis strategies for tests, factories for building elections, and support tools to improve tests.electionguard_cli
: CLI for performing developer methodselectionguard_verifier
: A simplified example of a verifier. Doesn't not include all verification checks.electionguard_gui
: under construction A GUI implementation of administrative and guardian device.Currently, we have one pyproject.toml defining the entire project. This results in one virtual environment.
Possible Implementation
An ideal scenario is to isolate the core as a library from the applications. This would help clarify what needs to be tested as well. This is a prime example including versions of how the code works. https://github.com/dermidgen/python-monorepo
My proposal is to mimic the previous setup with some minor changes.
Anything else?
Ensure you understand the
develop
option in poetry. https://python-poetry.org/docs/dependency-specification/#path-dependenciesThese will likely make the
make
commands more pivotal. For examplemake lint
will have to lint all the different project folders. Some existing commands should be shifted into the pyproject.toml similar to package.json with scripts. This may be a good option for this. https://pypi.org/project/poethepoet/There will be changes to packaging and imports. However, the only difference will be the
electionguard
package will have a different route.