Skip to content

Commit 5f8008a

Browse files
committed
replace Paver with Invoke for CLI workflow
1 parent 3f6a580 commit 5f8008a

21 files changed

Lines changed: 374 additions & 402 deletions

GeoHealthCheck/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#
2828
# =================================================================
2929

30-
from util import read
30+
from .util import read
3131

3232

3333
def get_package_version(file_):

GeoHealthCheck/manage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# Usage:
88
#
9-
# $ python manage.py --help
9+
# $ python3 manage.py --help
1010
# usage: manage.py [-h] {shell,db,runserver} ...
1111
#
1212
# positional arguments:
@@ -19,7 +19,7 @@
1919
# -h, --help show this help message and exit
2020
#
2121
# For DB management:
22-
# $ python manage.py db --help
22+
# $ python3 manage.py db --help
2323
# usage: Perform database migrations
2424
#
2525
# positional arguments:

GeoHealthCheck/migrations/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and Flask-Script.
66
Users should be able to upgrade existing installs via:
77

88
# In top dir of installation
9-
paver upgrade
9+
invoke upgrade
1010

1111
The `versions` dir contains the various upgrades. These were
1212
initially created using the Alembic `autogenerate` facility
@@ -20,12 +20,12 @@ for various DB management tasks related to migrations and upgrading.
2020
Whenever a change in the database schema or table content
2121
conventions has changed a new migration should be created via the command.
2222

23-
python manage.py db migrate
23+
python3 manage.py db migrate
2424

2525
Where `migrate` is an alias for `revision --autogenerate`.
2626
Alternatively if the autogeneration does not work, create an empty migration:
2727

28-
python manage.py db revision
28+
python3 manage.py db revision
2929

3030
In both cases this will create a new revision and a `<revision_number>_.py` file
3131
under `versions/` to upgrade
@@ -37,9 +37,9 @@ to check various DB metadata.
3737

3838
Subsequently the upgrade can be performed using:
3939

40-
python manage.py db upgrade
40+
python3 manage.py db upgrade
4141
# or the equivalent (for users)
42-
paver upgrade
42+
invoke upgrade
4343

4444
## Revisions
4545

GeoHealthCheck/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ def db_commit():
986986

987987
elif sys.argv[1] == 'run':
988988
print('NOTICE: models.py no longer here.')
989-
print('Use: python healthcheck.py or upcoming cli.py')
989+
print('Use: python3 healthcheck.py or upcoming cli.py')
990990
elif sys.argv[1] == 'flush':
991991
flush_runs()
992992

GeoHealthCheck/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
from urllib.parse import urlparse
3939
from gettext import translation
4040
from passlib.hash import pbkdf2_sha256
41-
from factory import Factory
42-
from init import App
41+
42+
from .factory import Factory
43+
from .init import App
4344

4445
from jinja2 import Environment, FileSystemLoader
4546

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ virtualenv GeoHealthCheck && cd $_
1717
. bin/activate
1818
git clone https://github.com/geopython/GeoHealthCheck.git
1919
cd GeoHealthCheck
20-
pip install Paver
20+
pip3 install Invoke
2121
# setup installation
22-
paver setup
22+
invoke setup
2323
# generate secret key
24-
paver create_secret_key
24+
invoke create_secret_key
2525
# setup local configuration (overrides GeoHealthCheck/config_main.py)
2626
vi instance/config_site.py
2727
# edit at least secret key:
28-
# - SECRET_KEY # copy/paste result string from paver create_secret_key
28+
# - SECRET_KEY # copy/paste result string from `invoke create_secret_key`
2929

3030
# Optional: edit other settings or leave defaults
3131
# - SQLALCHEMY_DATABASE_URI
@@ -37,32 +37,32 @@ vi instance/config_site.py
3737
# - GHC_MAP (or use default settings)
3838

3939
# setup database and superuser account interactively
40-
paver create
40+
invoke create
4141

4242
# start webserver with healthcheck runner daemon inside
4343
# (default is 0.0.0.0:8000)
44-
python GeoHealthCheck/app.py
44+
python3 GeoHealthCheck/app.py
4545
# or start webserver on another port
46-
python GeoHealthCheck/app.py 0.0.0.0:8881
46+
python3 GeoHealthCheck/app.py 0.0.0.0:8881
4747
# or start webserver on another IP
48-
python GeoHealthCheck/app.py 192.168.0.105:8001
48+
python3 GeoHealthCheck/app.py 192.168.0.105:8001
4949

5050
# OR start webserver and separate runner daemon (scheduler) process
5151
vi instance/config_site.py
5252
# GHC_RUNNER_IN_WEBAPP = False
53-
python GeoHealthCheck/scheduler.py &
54-
python GeoHealthCheck/app.py
53+
python3 GeoHealthCheck/scheduler.py &
54+
python3 GeoHealthCheck/app.py
5555

5656
# next: use a real webserver or preferably Docker for production
5757

5858
# other commands
5959
#
6060
# drop database
61-
python GeoHealthCheck/models.py drop
61+
python3 GeoHealthCheck/models.py drop
6262

6363
# load data in database (WARN: deletes existing data!)
6464
# See example data .json files in tests/data
65-
python GeoHealthCheck/models.py load <.json data file> [y/n]
65+
python3 GeoHealthCheck/models.py load <.json data file> [y/n]
6666

6767
```
6868

docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,11 @@ docker exec -it docker_geohealthcheck_1 bash
234234
source /venv/bin/activate .
235235
cd /GeoHealthCheck/
236236
237-
# next can use Paver commands e.g. DB upgrade
238-
paver upgrade
237+
# next can use Invoke commands e.g. DB upgrade
238+
invoke upgrade
239239
240240
etc
241241
```
242242

243-
NB: database upgrades (`paver upgrade`)
243+
NB: database upgrades (`invoke upgrade`)
244244
are always performed automatically when running GHC via Docker.

docker/scripts/configure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function create_db() {
1515
pushd /GeoHealthCheck/ || exit 1
1616
source bin/activate
1717

18-
paver create -u ${ADMIN_NAME} -p ${ADMIN_PWD} -e ${ADMIN_EMAIL}
18+
invoke create -u ${ADMIN_NAME} -p ${ADMIN_PWD} -e ${ADMIN_EMAIL}
1919
popd || exit 1
2020
}
2121

docker/scripts/cron-jobs-hourly.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ then
77
cp -ar /plugins/* /GeoHealthCheck/GeoHealthCheck/plugins/
88
fi
99

10-
python /GeoHealthCheck/GeoHealthCheck/healthcheck.py
10+
python3 /GeoHealthCheck/GeoHealthCheck/healthcheck.py

docker/scripts/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ source bin/activate
1212

1313

1414
# Docker-specific deps
15-
pip install --no-cache-dir -r docker/scripts/requirements.txt
15+
pip3 install --no-cache-dir -r docker/scripts/requirements.txt
1616

1717
# Sets up GHC itself
18-
paver setup
18+
invoke setup
1919
mv /config_site.py /GeoHealthCheck/instance/config_site.py
2020

2121
# Copy possible Plugins into app tree

0 commit comments

Comments
 (0)