Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

[TAAS-84] omit hub and minor updates #55

Merged
merged 2 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM unocha/alpine-base-s6-python2:latest
FROM unocha/alpine-base-s6-python2:3.8

MAINTAINER Paul Fenwick "paul@humanitarianresponse.info"

Expand All @@ -16,11 +16,9 @@ LABEL org.label-schema.schema-version="1.0" \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.vcs-ref=$VCS_REF

# Git is everyone's favourite source control manager
# Hub actually lets us make PRs to github
# openssh is the transport needed to make PRs to github
RUN apk add --update --no-cache \
git hub openssh \
git openssh \
make \
py-virtualenv \
# These are needed so python can build its things.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tag:
docker tag $(IMAGE_HASH) $(ORGANISATION)/$(IMAGE):$(VERSION)

clean:
rm -rf venv *.pyc taas/*.pyc .cache tests/__pycache__ .coverage taas.egg-info htmlcov buidlog.txt
rm -rf venv *.pyc taas/*.pyc .cache tests/__pycache__ .coverage taas.egg-info htmlcov buildlog.txt

# Magical line that allows us to force execution of a target
FORCE:
2 changes: 2 additions & 0 deletions docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ sources:

The `url` field *must* contain a URL complete with the `gid=` parameter at the end. For spreadsheets that consist of multiple sheets, the gid parameter specifies the individual sheet to be read. The `/edit` part of the URL is optional. In almost all cases a simple copy-and-paste will work correctly.

Permissions on the spreadsheet must allow 'Anyone with the link' to view it.

A source *may* contain a `fragment_key`. If set, JSON fragments (individual files containing only a single record each) will be emitted in addition to the main file, using the contents of the mapping field specified. For example, if we're using numeric IDs, the example above would create files named `beta-v1/functional_roles/1`, `beta-v1/function_roles/2`, etc.

To match how existing APIs present their records, fragments do not have the `.json` or any other extension.
Expand Down
4 changes: 2 additions & 2 deletions taas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def read_config(path=None):

if os.path.isfile(path):
with open(path) as stream:
return yaml.load(stream)
return yaml.safe_load(stream)

# If we're here, we have a directory. (Or we're about
# to throw an exception, because we don't.)
Expand All @@ -132,7 +132,7 @@ def get_directory_config(path):
config = {}
for file in glob.glob(os.path.join(path, "*.yml")):
with open(file) as stream:
sub_config = yaml.load(stream)
sub_config = yaml.safe_load(stream)
config = _merge_config(sub_config, config)

return config
Expand Down
3 changes: 0 additions & 3 deletions taas/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ def push_to_github(label):

run(["git", "push", "--set-upstream", "origin", branch_name])

# NB: `hub` is available from github
run(["hub", "pull-request", "-m", "Automated update: "+label])


def gss2json():
"""Console script for processing google spreadsheet(s) to JSON."""
Expand Down