安装toolbelt -> https://devcenter.heroku.com/x?url=https%3A%2F%2Ftoolbelt.heroku.com%2F
命令行 -> heroku login
参考 https://devcenter.heroku.com/articles/keys must do -> heroku keys:add
git clone git://github.com/RobSpectre/Twilio-Hackpack-for-Heroku-and-Flask.git
heroku create –stack cedar
git add .
git push heroku master
$ heroku restart
$ heroku logs –tail
- Release v201 (#1255)GUS-W-10053974., GitHub
- Update setuptools and wheel (#1254)Updates:- setuptools from 47.1.1 to: – 50.3.2 for Python 3.5 – 57.5.0 for Python 3.6+- wheel from 0.36.2 to 0.37.0.Of note, the newer setuptools is fully compatible with Python 3.10, thereby fixing#1248. Updating to newer setuptools was blocked on #1006, but that's now beenfixed by #1252.The setuptools version hasn't been updated all the way to the latest (58.2.0), since v58 dropped support for 2to3, which caused breakage in a few packages, so I wouldrather hold off as long as possible (and there are no fixes that we need since then).Release notes:https://setuptools.pypa.io/en/latest/history.html#v57-5-0https://wheel.readthedocs.io/en/stable/news.htmlFull changelogs:https://github.com/pypa/setuptools/compare/v47.1.1…v57.5.0https://github.com/pypa/wheel/compare/0.36.2…0.37.0Fixes #1248.GUS-W-10052807., GitHub
- Perform editable package .pth and .egg-link path rewriting at runtime (#1252)Currently the build system performs builds in a different directory(`/tmp/build_<hash>`) to which the app will be run at runtime (`/app`).This means that any hardcoded paths in the slug must be rewritten by thebuildpack, so the app still works after being moved.One such case of hardcoded paths, are the `.pth` and `.egg-link` filesthat are created in the `site-packages` directory by Pip/setuptools foreditable package installs (aka develop mode). The most common waysomeone might use editable mode is via `-e <package specifier>` entriesin their `requirements.txt` file.Until now, the Python buildpack rewrote paths inside these files duringthe compile itself, which meant the build-time paths were no longerpresent when subsequent buildpacks ran. This happened to work due toan interaction of legacy setuptools behaviour and a buildpack bug, butstops working in setuptools 47.2.0 or later – as described in #1006.Longer term we would like to stop building in one location and runningthe app from another, so that the path rewriting isn't required at all.However that change breaks some other buildpacks so requires a long-termtransition plan.In the meantime, this change moves path rewriting to a `.profile.d/`script, so that it occurs at runtime, and so after all other buildpackshave run.Additional test coverage of editable packages was added previously in #1251and #1253, and has confirmed that this new `profile.d/` script approach willprevent the issues in #1006 when setuptools is updated in a future PR.There is one subtle implication of moving this path rewriting, in thatsubsequent cached builds will no longer see the existing package asbeing already installed, so won't uninstall if before reinstalling it (asseen in the test log output change). However this is not believed tohave any significant impact.Fixes #1006. (And so unblocks updating to the newer setuptools required for #1248.)GUS-W-7828034., GitHub
- Tests: Add additional log output to the editable package tests (#1253)The editable package tests now output the contents of all of the `.pth` and`.egg-link` files in `site-packages` to aid debugging, as well as help demonstratethe changes that will be taking place in #1252.GUS-W-10047026.[skip changelog], GitHub
- Tests: Add additional coverage of editable package installation (#1251)Previously the editable installation mode test only checked whetherthe build completed successfully, not whether the installed editablepackages worked.Now the packages are tested via their entrypoints in the following scenarios:1. During the `bin/post_compile` hook2. By a later buildpack in the build3. At runtimeIn particular, (2) catches the issue described in #1006 when setuptools is upgraded,and (1) + (3) will be useful to verify the solution to #1006 hasn't broken the other cases.GUS-W-10047026.[skip-changelog], GitHub
The fastest way to start using Twilio with Python.
3 open issues.
- 1) Upgraded dependencies., Rob Spectre
- 1) Removed configure main function from coverage.2) Segregated parser into separate function for testability.3) Added tests for configure cli script.4) Finished out error handling tests for 100% coverage., Rob Spectre
- Bump version of Twilio module., Rob Spectre
- Fix comma in app.json., Rob Spectre
- 1) Remove post deploy configuration until I find a way to get the Heroku domainpost-deploy.2) Fixed string substitution in configure.py., Rob Spectre