This PR makes the package configuration conform with latest Python packaging standards and conventional workflows.
Currently, the README prescribes the use of pipenv for installing the SCH package, with the package configuration and
metadata defined in a setup.py and Pipfile files.
If pipenv is a useful tool for managing the installation of Python packages, it acts at a level above the standard Python package manager pip. There are other alternatives, such as poetry, conda, pyenv, rye, pdm or hatch. I think the installation instruction should not make any prescription(s) for a particular tool, but instead mention that the installation is nothing more that the conventional pip install command that most users would exepct. The README file could, however, make recommendations regarding the use of tools to manage package installations.
Invoking setup.py directly (e.g. python setup.py install) or not providing a minimal pyproject.toml configuration file is deprecated. In the case of the SCH package, all the defined configuration and metadata can be migrated from the setup.py file to the pyproject.toml file.
The driver script sch_run.py can be made a regular command by specifying an entry point. It's content is migrated into a new module main.py. Installing the package installs a command run_sch which executes main.main().
$ run_sch --help
usage: run_sch [-h] [-p {high-adult-burden,low-adult-burden}] [-d {WHOGeneric,UgandaRural,KenyaKDHS,Flat}]
NTDMC SCH model command line interface
options:
-h, --help show this help message and exit
-p {high-adult-burden,low-adult-burden}, --parameter-set {high-adult-burden,low-adult-burden}
The set of simulation parameters
-d {WHOGeneric,UgandaRural,KenyaKDHS,Flat}, --demog-name {WHOGeneric,UgandaRural,KenyaKDHS,Flat}
Name of demography to simulate for
This PR makes the package configuration conform with latest Python packaging standards and conventional workflows.
Currently, the README prescribes the use of pipenv for installing the SCH package, with the package configuration and metadata defined in a
setup.py
andPipfile
files.pipenv
is a useful tool for managing the installation of Python packages, it acts at a level above the standard Python package managerpip
. There are other alternatives, such as poetry, conda, pyenv, rye, pdm or hatch. I think the installation instruction should not make any prescription(s) for a particular tool, but instead mention that the installation is nothing more that the conventionalpip install
command that most users would exepct. The README file could, however, make recommendations regarding the use of tools to manage package installations.setup.py
directly (e.g.python setup.py install
) or not providing a minimalpyproject.toml
configuration file is deprecated. In the case of the SCH package, all the defined configuration and metadata can be migrated from thesetup.py
file to thepyproject.toml
file.The driver script sch_run.py can be made a regular command by specifying an entry point. It's content is migrated into a new module
main.py
. Installing the package installs a commandrun_sch
which executesmain.main()
.for example: