Skip to content

Commit

Permalink
Fix "publish heroku" + upgrade to use Python 3.8.0
Browse files Browse the repository at this point in the history
Closes #633. Closes #632.
  • Loading branch information
simonw committed Nov 15, 2019
1 parent 98fa047 commit 39c9a31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions datasette/publish/heroku.py
Expand Up @@ -72,7 +72,10 @@ def heroku(
"about_url": about_url,
}

environment_variables = {}
environment_variables = {
# Avoid uvicorn error: https://github.com/simonw/datasette/issues/633
"WEB_CONCURRENCY": "1"
}
if plugin_secret:
extra_metadata["plugins"] = {}
for plugin_name, plugin_setting, setting_value in plugin_secret:
Expand Down Expand Up @@ -164,7 +167,7 @@ def temporary_heroku_directory(
if metadata_content:
open("metadata.json", "w").write(json.dumps(metadata_content, indent=2))

open("runtime.txt", "w").write("python-3.6.8")
open("runtime.txt", "w").write("python-3.8.0")

if branch:
install = [
Expand Down
9 changes: 7 additions & 2 deletions tests/test_publish_heroku.py
Expand Up @@ -57,8 +57,13 @@ def test_publish_heroku(mock_call, mock_check_output, mock_which):
open("test.db", "w").write("data")
result = runner.invoke(cli.cli, ["publish", "heroku", "test.db"])
assert 0 == result.exit_code, result.output
mock_call.assert_called_once_with(
["heroku", "builds:create", "-a", "f", "--include-vcs-ignore"]
mock_call.assert_has_calls(
[
mock.call(["heroku", "config:set", "-a", "f", "WEB_CONCURRENCY=1",]),
mock.call(
["heroku", "builds:create", "-a", "f", "--include-vcs-ignore"]
),
]
)


Expand Down

0 comments on commit 39c9a31

Please sign in to comment.