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:
the project to be installed using pip - pip install rpft
the main console script to be called via the rpft command - rpft --help
the project to be imported into other Python projects - import rpft
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.
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.
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 orimport
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:
pip install rpft
rpft
command -rpft --help
import rpft
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:
After:
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 ofpython 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.