IDEMSInternational / rapidpro-flow-toolkit

Toolkit for using spreadsheets to create and modify RapidPro flows
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Release 1.0.0 #88

Closed istride closed 11 months ago

istride commented 12 months ago

Motivation

The main aim is to make this project more easily accessible and usable by other Python projects, in particular, for inclusion in automated pipelines that will be used to build specific deployments of ParentText. We would like to pip install this project into those deployment projects and use the CLI or import this project's modules into Python pipeline scripts. Naturally, having this project available as a package in PyPI potentially makes it more likely to be used in situations that we haven't envisioned.

Overview

Merging this PR will allow:

I am recommending an initial release version of 1.0.0 since this project has never been released officially before.

Changing the project layout

The vast majority of the changes involve moving the existing code into a root module called rpft (an abbreviation of RapidPro Flow Toolkit) and into src layout, to make packaging easier.

Before:

rapidpro-flow-toolkit
├── logger
├── parsers
├── rapidpro
└── tests

After:

rapidpro-flow-toolkit
└── src
    └── rpft
        ├── logger
        ├── parsers
        ├── rapidpro
        └── tests

The layout change has required import statements and any other similar references to be updated accordingly. Scripts and workflows for running tests and code coverage have also been updated.

Declaring project metadata

The standard way of specifying project metadata is now via a file called pyproject.toml, and this PR adopts this standard. As well as containing data about the project, this file also assists with building and packaging the project in preparation for being uploaded to PyPI.

It also allows us to specify an entrypoint for console scripts such that, you can now type rpft --help instead of python main.py --help.

Updated documentation

The README has been overhauled so that it is relevant for users of the project rather than developers of the project. Information for developers and more in-depth documentation has been moved to a new docs directory in the project root.

Google Sheets reader authentication

The Google Sheets reader class will now accept service account credentials. This is useful for authentication in situations where human-interaction is not possible, such as in automated pipelines. The reader will look for service account credentials in an environment variable called CREDENTIALS. If none are found then the existing "installed app flow" (credentials / token JSON files) will be used.