Compare commits

...

58 Commits

Author SHA1 Message Date
Ed Morley bce5bf4869 Release v171 (#991) 2020-07-07 19:20:13 +01:00
Denis Cornehl 0fdb62faa9 Add support for Python 3.6.11 and 3.7.8 (#988) 2020-07-07 18:39:44 +01:00
dependabot[bot] 42507a3f9a Bump rake from 12.3.1 to 12.3.3 (#981)
Bumps [rake](https://github.com/ruby/rake) from 12.3.1 to 12.3.3.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v12.3.1...v12.3.3)
2020-05-27 14:14:43 +01:00
dependabot[bot] f89ee6750e Bump activesupport from 6.0.2.2 to 6.0.3.1 (#980)
Bumps [activesupport](https://github.com/rails/rails) from 6.0.2.2 to 6.0.3.1.
- [Release notes](https://github.com/rails/rails/releases)
- [Changelog](https://github.com/rails/rails/blob/v6.0.3.1/activesupport/CHANGELOG.md)
- [Commits](https://github.com/rails/rails/compare/v6.0.2.2...v6.0.3.1)
2020-05-27 13:42:59 +01:00
Ed Morley 122722f89e v170 (#978) 2020-05-19 15:33:30 +01:00
Ed Morley 8cb379f83b Add support for latest CPython and PyPy versions (#977)
Adds support for:
* CPython 2.7.18, 3.5.9, 3.7.7 and 3.8.3
* PyPy 2.7 and 3.6, version 7.3.1

The binaries will need generating and uploading before CI will pass.

Note: Whilst the build script for CPython 3.8.3 did already exist in the
repository, it appears to have been accidentally created in #920, which
predated the existence of that version of Python - so the binaries do
not exist on S3.

The Heroku-18 Docker image tag has also been unpinned, since the new
libssl version is now available at runtime in all environments, so we
don't need to force building against the older version of the headers.

Fixes W-7582174.
2020-05-19 14:16:59 +01:00
Richard Schneeman d3a60b21fe [changelog skip] Fix PR edit check (#974)
Previously when a PR title was edited, the "check for changelog" script would not fire. This means if someone edited it to add a "[changelog skip]" that the check would still show to be failing. This PR adds additional triggers for the check so that when the PR is edited, the check will re-run.
2020-05-12 09:57:33 -05:00
Richard Schneeman 7e80ea8fbe Update heroku hatchet so master can be specified (#970)
- https://github.com/heroku/hatchet/pull/80
- https://github.com/heroku/heroku-buildpack-python/pull/969#issuecomment-620057594
2020-04-27 15:55:16 -05:00
Joe Kutner c78ffd5ac4 Prevent Hatchet on forked PRs [changelog skip] (#966)
* Update travis conditional for hatchet to check for HEROKU_API_ env vars
[changelog skip]

* remove check to skip hatchet in travis in favor of better travis config
2020-04-27 09:15:38 -05:00
Richard Schneeman a06b536109 Add Hatchet Regression Tests (#969)
I went through all the tests in the Ruby buildpack and cataloged what I think can be generalized between languages to prevent regressions. This PR add tests for these cases:

* Test CI deploys run tests and use the cache [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/f488bd53c7ff0b78e17c2405166cbd4a3af75ee2/spec/hatchet/ci_spec.rb#L36)]
* Test cache for regular deploys is used on repeated deploys (This was already tested on the Python buildpack, I moved it) [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/e34c583c139911d059f5627bb25125707288f053/spec/hatchet/stack_spec.rb#L21-L25)]
    * Test modifying a requirement clears the cache appropriately (This was already tested on the Python buildpack, I moved it)
* Test deploying the getting started guide works [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/424a7245e2da86845a20d58a9482bcf2a00c3a8f/spec/hatchet/getting_started_spec.rb#L5)]
* Test that all paths set by the buildpack are absolute instead of relative [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/249d3c1a4e97068f8fd016f10fa0839709d95658/spec/hatchet/rails5_spec.rb#L68])
* Test upgrading stack invalidates the cache [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/f488bd53c7ff0b78e17c2405166cbd4a3af75ee2/spec/hatchet/stack_spec.rb#L3)]
* Test that builds fail when a bad version is specified [[reference test](https://github.com/heroku/heroku-buildpack-ruby/blob/249d3c1a4e97068f8fd016f10fa0839709d95658/spec/hatchet/ruby_spec.rb#L5)]


In addition to that I've also got a CNB test with `pack-build` with the getting started app, but since python isn't `cnb` capable yet I didn't add one.
2020-04-27 08:26:42 -05:00
Ed Morley dd646998d3 Fix changelog after rebase (#967)
The merge of #910 added three lines to the changelog rather than just one:
https://github.com/heroku/heroku-buildpack-python/commit/932cd257c98e9f56e878134f84a09d7d972bc46e

The original commit before rebase, was:
https://github.com/heroku/heroku-buildpack-python/pull/910/commits/d57d26b2e0348199228312950e55b42bc9de8147

I've also clarified the wording of it and the other unreleased change,
to reduce the chance for confusion as to what's changed, when customers
debug issues.
2020-04-24 10:32:38 +01:00
Ed Morley 484bd44a1e Remove unused libffi build script (#965)
The compile-time cryptography step that used to use the libffi archives
on S3 was removed in 2018:
https://github.com/heroku/heroku-buildpack-python/commit/c373e80c1285260e5adcbc855f54bbeb6999005c

...since the `cryptography` Python package now ships wheels.

The script is also incorrect, since similar to #964 it only skips builds
for Heroku-16, whereas all stacks since Cedar-14 include libffi-dev in
the build image, so don't need it built/uploaded for later vendoring.

Refs W-7485877.
2020-04-24 09:26:03 +01:00
Thomas Mollard 932cd257c9 fix runtime.txt generation when using pipenv (#910)
Co-authored-by: Casey <caseylfaist@gmail.com>
Co-authored-by: Joe Kutner <jpkutner@gmail.com>
2020-04-23 21:30:04 -05:00
Ed Morley 989351467f Prevent building libmemcached on stacks that don't vendor it (#964)
The `libmemcached` package is available in the base stack image for all
stacks newer than `cedar-14`, so at buildpack compile time the vendor
step is skipped for those stacks:
https://github.com/heroku/heroku-buildpack-python/blob/106f2997fa124852a2a35ee8bfa604ad20c47988/bin/steps/pylibmc#L12-L15

As such, it is not necessary to run the libmemcached bob-builder formula
on newer stacks. The conditional has been updated so it correctly handles
heroku-18 and also the upcoming heroku-20.

An exit code of 1 has been used, otherwise `bob upload` will build and
then upload a zero byte archive to S3, which will go unused.

(This is in comparison to bob formulas that are nested, where an exit
code of 0 is actually desirable, since it allows skipping steps.)

Refs W-7485877.

Co-authored-by: Joe Kutner <jpkutner@gmail.com>
2020-04-23 21:23:38 -05:00
Ed Morley d68a7c594c Remove unused Pipfile and Pipfile.lock (#960)
These aren't referenced anywhere in the repository, and contain older
versions of the dependencies than are declared in `requirements.txt`
(which itself is used).

Co-authored-by: Joe Kutner <jpkutner@gmail.com>
2020-04-23 20:40:35 -05:00
Joe Kutner 97f783ce96 Update travis config [changelog skip] (#963)
* Update travis config to only setup hatchet when running hatchet [changelog skip]

Fix a bug in the hatchet tests, and allow previous builds to finish before running the next test

* Add logging when skipping hatchet tests

Only skip hatchet tests on a forked PR

* Build on Travis only for master branch

* Upgrade from trusty to bionic on Travis
2020-04-23 19:55:05 -05:00
Joe Kutner 106f2997fa Add support for Python 3.8 latest version (#955)
* Add support for Python 3.8 latest version

If the pip lock file only specifies `3.8` and no bug fix version, it should use Python LATEST_38.

* Update CHANGELOG.md

* Update changelog

Co-authored-by: Johannes Hoppe <info@johanneshoppe.com>
Co-authored-by: Casey <caseylfaist@gmail.com>
2020-04-23 08:11:53 -05:00
Joe Kutner 373a656272 Update changelog for version 169 (#957) 2020-04-22 16:32:08 -05:00
Joe Kutner 0abc749aff Add a Hatchet test for python 3.8.2 (#956)
* Add a Hatchet test for python 3.8.2

* update changelog

* Update test to match build output

* Fix formatting and a syntax error in tests

* Fix syntax error in hatchet spec
2020-04-22 10:38:16 -05:00
Joe Kutner 60614232da Set Codeowners to languages (#953)
* Set languages as codeowners

* Update changelog
2020-04-21 17:39:56 -05:00
Joe Kutner edb7004a28 Update hatchet tests to support latest version of Python (#952)
* Update hatchet tests to support latest version of Python

* Empty commit to trigger CI
2020-04-21 16:42:56 -05:00
Casey ea350a6694 Bugfix: Caching on subsequent redeploys (#948)
* Don't clear the cache on first app deploy

* Add output for debugging cache behavior

* Debug output of changes, clean up whitespace

* Update hatchet to use latest getting started guide

* Clean up caching output logs

This output was confusing and unhelptul to most users

* Changelog

* Test if we need these lines

* dang fi

* Remove unnecessary code

* Remove confusing output of change

* Update log output

* Update test to match new expected log output

* Update changelog
2020-04-21 15:41:57 -05:00
Casey 027d49eb58 Merge pull request #946 from heroku/releaseprep/168
Release prep: changelog update
2020-04-06 15:22:48 -04:00
Casey 49597f22ca Merge branch 'master' into releaseprep/168 2020-04-06 15:03:32 -04:00
Casey Faist 4bb8f59f2c Prep release changelog update 2020-04-06 13:58:51 -04:00
Casey d4b6b0190d Merge pull request #930 from heroku/kgrinberg/master
Fix old Django version detection
2020-04-06 13:47:51 -04:00
Casey 2c2cbc4653 Merge branch 'master' into kgrinberg/master 2020-04-06 13:23:29 -04:00
Casey d0629cd6ef Merge pull request #895 from heroku/geos-deprecation
Geos deprecation
2020-04-06 13:19:31 -04:00
Casey 398a0fb202 Merge branch 'master' into kgrinberg/master 2020-04-02 15:48:21 -04:00
Casey 5bf80a2270 Merge branch 'master' into geos-deprecation 2020-04-02 15:47:01 -04:00
Casey 61609930c1 Merge pull request #945 from heroku/changelog/bump
More recent changelog update
2020-04-02 15:45:56 -04:00
Casey Faist 0fa27b7b0d More recent changelog update 2020-04-02 13:22:55 -04:00
Casey cc247753e5 Merge branch 'master' into kgrinberg/master 2020-04-02 12:55:25 -04:00
Casey 4da1ca71b5 Merge pull request #940 from heroku/barbeque/patch-1
Barbeque/patch 1
2020-04-02 12:54:34 -04:00
Casey 3d70b2e9ff Merge branch 'master' into barbeque/patch-1 2020-04-02 12:10:22 -04:00
Casey 87e9fb2ccc Merge pull request #944 from heroku/buildlog/fix-cache-output
Remove confusing diff output for cache check
2020-04-02 12:08:49 -04:00
Casey Faist 0d61f83269 Update changelog 2020-04-02 12:08:11 -04:00
Casey Faist e12ad47397 Add missing dev/null for diff output 2020-04-02 11:01:44 -04:00
Casey 307cb13159 Merge branch 'master' into geos-deprecation 2020-03-30 10:08:56 -04:00
Casey 156da405e0 Merge branch 'master' into barbeque/patch-1 2020-03-27 14:55:50 -04:00
Casey ea90db6d13 Add Buildpack-Maintainers as code owners (#938) 2020-03-27 14:47:52 -04:00
Casey Faist 56f7ccc511 Changelog update 2020-03-27 12:50:45 -04:00
Casey a2c72f77f9 Merge branch 'master' into patch-1 2020-03-27 12:49:08 -04:00
Casey 93a5144033 Merge branch 'master' into kgrinberg/master 2020-03-26 19:10:52 -04:00
Casey ac76968c90 Merge branch 'master' into geos-deprecation 2020-03-26 18:44:45 -04:00
mike 2b3a90ec0c PR feedback 2020-03-25 20:20:27 -06:00
Casey Faist 48a368ac71 Add test for expected behavior 2020-03-24 14:48:17 -04:00
Casey 4d2e74b411 Merge branch 'master' into patch-1 2020-03-18 10:39:50 -04:00
Casey d8b37dcaf8 Merge branch 'master' into geos-deprecation 2020-03-18 10:29:39 -04:00
Kevin Grinberg 312b9ca6de Fix old Django version detection 2020-03-09 11:43:59 -04:00
Casey 4e8831a3a3 Merge branch 'master' into geos-deprecation 2019-12-06 10:11:47 -05:00
Mike c402d37451 Update README python versions to match docs 2019-12-02 10:06:54 -07:00
Casey 563a9c9187 Merge branch 'master' into geos-deprecation 2019-10-24 12:06:08 -07:00
Casey b1e3256128 Merge branch 'master' into geos-deprecation 2019-10-23 14:24:04 -07:00
Casey ac93a57492 Merge branch 'master' into geos-deprecation 2019-10-23 11:42:41 -07:00
Casey Faist 5828fbfe7d check for whole deprecation message 2019-10-23 11:42:01 -07:00
Casey Faist b7d8aa4d7d update changelog 2019-10-22 12:59:18 -07:00
Kevin Brolly a6510f0f77 Added a deprecation warning when using BUILD_WITH_GEO_LIBRARIES or installing pygdal 2019-10-22 12:38:43 -07:00
39 changed files with 278 additions and 167 deletions
+1 -1
View File
@@ -1 +1 @@
* @heroku/languages
* @heroku/languages
+3 -1
View File
@@ -1,6 +1,8 @@
name: Check Changelog
on: [pull_request]
on:
pull_request:
types: [opened, reopened, edited, synchronize]
jobs:
build:
+11 -6
View File
@@ -1,12 +1,14 @@
language: ruby
dist: trusty
dist: bionic
sudo: required
branches:
only:
- master
rvm:
- 2.4.4
- 2.6.6
before_script:
- gem install bundler -v 1.16.2
- bundle exec hatchet ci:setup
script:
- docker build --pull --tag travis-build-cedar-14 --file $(pwd)/builds/cedar-14.Dockerfile .
@@ -22,9 +24,12 @@ jobs:
sudo: false
script: make check
- stage: Hatchet Integration
if: branch = master
if: env(TRAVIS_PULL_REQUEST_SLUG) = env(TRAVIS_REPO_SLUG)
name: Run Hatchet
script: "bundle exec rspec"
script:
- bundle exec hatchet ci:setup
- PARALLEL_SPLIT_TEST_PROCESSES=11 bundle exec parallel_split_test spec/hatchet/
env:
matrix:
- TESTFOLDER=test/run-deps
@@ -33,7 +38,7 @@ env:
global:
- HATCHET_RETRIES=3
- IS_RUNNING_ON_CI=true
- HATCHET_APP_LIMIT=5
- HATCHET_APP_LIMIT=80
- HATCHET_DEPLOY_STRATEGY=git
- secure: yjtlPE5FbVxTKnjUy/tZUBgSEf4qADD3QOxtgziuid73S0U/1IEXlMGFULsQzIjtlHKmHeywZqpVVEpthIH4RuT7uoX1Pb7SSM/g0T8fT3VoEFbFK1uYl0oZQbUS4Klxv9tPiumj8if3m6ULEGIz1X0wZcMOC0tMLwVCnwmap0E=
- secure: ZeFTHWwnpIKE9nAqs88ocmiQh7bKce84lilGm5J23nf3N6V4wNyLwqlkvsM008WGBCaOg9AUx7ZunasT0ANsR5gLP3eV2UUg7ILdRgV2Gy13eNRFheC4PHdN92RqQ3aKoqlIv2K999xlhVjod0NzhkQQXB6PddfQINbuU7ks6As=
+33 -3
View File
@@ -1,14 +1,44 @@
# Python Buildpack Changelog
# Master
# 171 (2020-07-07)
- Python 3.6.11 and 3.7.8 are now available (CPython).
# 170 (2020-05-19)
- Python 2.7.18, 3.5.9, 3.7.7 and 3.8.3 are now available (CPython).
- PyPy 2.7 and 3.6, version 7.3.1 are now available (Note: PyPy support is in beta)
- Docs: Fix explanation of runtime.txt generation when using pipenv
- Bugfix: Correctly detect Python version when using a `python_version` of `3.8` in `Pipfile.lock`
--------------------------------------------------------------------------------
# 169 (2020-04-22)
- Add a Hatchet test for python 3.8.2
- Set Code Owners to @heroku/langauges
- Bugfix: Caching on subsequent redeploys
- Update tests to support latest version of Python
# 168 (2020-04-06)
- Doc: Update Readme with version numbers
- update Code Owners to include the Heroku Buildpack Maintainers team
- Deprecation warning: BUILD_WITH_GEO_LIBRARIES is now deprecated. See warning for details.
- Clean up build log output
- Update Python versions in README to match docs
- Django version detection fixed, link updated
# 167 (2020-03-26)
- Add failcase for cache busting
- Bugfix: Clearing pip dependencies
# 166 (2020-03-05)
- Correct ftp to https in vendored file
- Warn for Django 1.11 approaching EOL, provide link to roadmap
--------------------------------------------------------------------------------
# 165 (2020-02-27)
- Python 3.8.2 now available.
+2
View File
@@ -4,3 +4,5 @@ gem "rspec"
gem "heroku_hatchet"
gem "rspec-retry"
gem "rake"
gem "parallel_split_test"
+17 -10
View File
@@ -1,21 +1,22 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.1)
activesupport (6.0.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
concurrent-ruby (1.1.3)
zeitwerk (~> 2.2, >= 2.2.2)
concurrent-ruby (1.1.6)
diff-lcs (1.3)
erubis (2.7.0)
excon (0.62.0)
excon (0.73.0)
heroics (0.0.25)
erubis (~> 2.0)
excon
moneta
multi_json (>= 1.9.2)
heroku_hatchet (4.0.6)
heroku_hatchet (5.0.3)
excon (~> 0)
minitest-retry (~> 0.1.9)
platform-api (~> 2)
@@ -23,17 +24,21 @@ GEM
rrrretry (~> 1)
thor (~> 0)
threaded (~> 0)
i18n (1.1.1)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
minitest (5.11.3)
minitest (5.14.1)
minitest-retry (0.1.9)
minitest (>= 5.0)
moneta (1.0.0)
multi_json (1.13.1)
multi_json (1.14.1)
parallel (1.19.1)
parallel_split_test (0.7.0)
parallel (>= 0.5.13)
rspec (>= 3.1.0)
platform-api (2.2.0)
heroics (~> 0.0.25)
moneta (~> 1.0.0)
rake (12.3.1)
rake (12.3.3)
repl_runner (0.0.3)
activesupport
rrrretry (1.0.0)
@@ -55,17 +60,19 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
threaded (0.0.4)
tzinfo (1.2.5)
tzinfo (1.2.7)
thread_safe (~> 0.1)
zeitwerk (2.3.0)
PLATFORMS
ruby
DEPENDENCIES
heroku_hatchet
parallel_split_test
rake
rspec
rspec-retry
BUNDLED WITH
1.16.3
2.1.4
-9
View File
@@ -1,9 +0,0 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[dev-packages]
[packages]
"bob-builder" = "==0.0.13"
Generated
-52
View File
@@ -1,52 +0,0 @@
{
"_meta": {
"hash": {
"sha256": "36d17c46a8b1b844b3cae475f6f42d6c0a9e59b2a9685cbcdc0985656a7a129f"
},
"host-environment-markers": {
"implementation_name": "cpython",
"implementation_version": "3.6.3",
"os_name": "posix",
"platform_machine": "x86_64",
"platform_python_implementation": "CPython",
"platform_release": "16.7.0",
"platform_system": "Darwin",
"platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
"python_full_version": "3.6.3",
"python_version": "3.6",
"sys_platform": "darwin"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
"bob-builder": {
"hashes": [
"sha256:b4de49a8e436fcaf82236ea43f78413b4a4c92100726e382ab57b6bdfb38fe64",
"sha256:288e3e765c4890fe9a63ae52ac6b4a963c13fe508482c70ff701a5ae21b9a673"
],
"version": "==0.0.13"
},
"boto": {
"hashes": [
"sha256:13be844158d1bd80a94c972c806ec8381b9ea72035aa06123c5db6bc6a6f3ead",
"sha256:deb8925b734b109679e3de65856018996338758f4b916ff4fe7bb62b6d7000d1"
],
"version": "==2.48.0"
},
"docopt": {
"hashes": [
"sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"
],
"version": "==0.6.2"
}
},
"develop": {}
}
+6 -4
View File
@@ -46,7 +46,8 @@ To specify your python version, you also need a `runtime.txt` file - unless you
Current default Python Runtime: Python 3.6.9
Alternatively, you can provide a `setup.py` file, or a `Pipfile`. Using `Pipenv` will generate `runtime.txt` based on `python-version` at build time.
Alternatively, you can provide a `setup.py` file, or a `Pipfile`.
Using `pipenv` will generate `runtime.txt` at build time if one of the field `python_version` or `python_full_version` is specified in the `requires` section of your `Pipfile`.
Specify a Buildpack Version
---------------------------
@@ -61,9 +62,10 @@ Specify a Python Runtime
Supported runtime options include:
- `python-3.7.4`
- `python-3.6.9`
- `python-2.7.17`
- `python-3.8.3`
- `python-3.7.8`
- `python-3.6.11`
- `python-2.7.18`
## Tests
+1 -1
View File
@@ -175,7 +175,7 @@ cd "$BUILD_DIR"
# - Once the build is complete, `~/.heroku/{known-paths}` is copied back into the cache.
# Create the cache directory, if it doesn't exist.
mkdir -p "$CACHE_DIR"
mkdir -p "$CACHE_DIR/.heroku"
# Restore old artifacts from the cache.
mkdir -p .heroku
+8 -8
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
DEFAULT_PYTHON_VERSION="python-3.6.10"
LATEST_38="python-3.8.2"
LATEST_37="python-3.7.6"
LATEST_36="python-3.6.10"
LATEST_35="python-3.5.7"
DEFAULT_PYTHON_VERSION="python-3.6.11"
LATEST_38="python-3.8.3"
LATEST_37="python-3.7.8"
LATEST_36="python-3.6.11"
LATEST_35="python-3.5.9"
LATEST_34="python-3.4.10"
LATEST_27="python-2.7.17"
PYPY_36="pypy3.6-7.2.0"
PYPY_27="pypy2.7-7.2.0"
LATEST_27="python-2.7.18"
PYPY_36="pypy3.6-7.3.1"
PYPY_27="pypy2.7-7.3.1"
export DEFAULT_PYTHON_VERSION \
LATEST_38 \
+4
View File
@@ -22,6 +22,10 @@ source "$BIN_DIR/utils"
if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then
if [ ! -f ".heroku/vendor/bin/gdalserver" ]; then
puts-warn "The vendored GDAL package in the Heroku Python Buildpack now deprecated."
puts-warn "To enable GDAL use an alternative buildpack is available here - https://github.com/heroku/heroku-geo-buildpack"
echo "-----> Noticed GDAL. Bootstrapping gdal."
mkdir -p .heroku/vendor
# Download and extract cryptography into target vendor directory.
+3
View File
@@ -24,6 +24,9 @@ source "$BIN_DIR/utils"
if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then
mcount "buildvar.BUILD_WITH_GEO_LIBRARIES"
puts-warn "The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated."
puts-warn "An alternative buildpack to enable GDAL, GEOS and PROJ use is available here - https://github.com/heroku/heroku-geo-buildpack"
if [ ! -f ".heroku/vendor/bin/proj" ]; then
echo "-----> Bootstrapping gdal, geos, proj."
mkdir -p .heroku/vendor
+2 -2
View File
@@ -38,10 +38,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
mcount "failure.none-version"
fi
if grep -q 'django==1.*' requirements.txt; then
if grep -qi '^django==1.*' requirements.txt; then
puts-warn "Your Django version is nearing the end of its community support."
puts-warn "Upgrade to continue to receive security updates and for the best experience with Django."
puts-warn "For more information, check out https://www.djangoproject.com/weblog/2015/jun/25/roadmap/"
puts-warn "For more information, check out https://www.djangoproject.com/download/#supported-versions"
fi
if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then
+3
View File
@@ -27,6 +27,9 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then
if [ "$PYTHON" = 3.7 ]; then
echo "$LATEST_37" > "$BUILD_DIR/runtime.txt"
fi
if [ "$PYTHON" = 3.8 ]; then
echo "$LATEST_38" > "$BUILD_DIR/runtime.txt"
fi
fi
+5 -10
View File
@@ -100,22 +100,17 @@ if [[ ! -f "$CACHE_DIR/.heroku/requirements.txt" ]]; then
# IF there's no cached dependencies, update cached version of requirements.txt
# This should only run for new apps and first deploys after this update
cp -R "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"
# If we don't already have a python version, this is a new app
if [ -f .heroku/python-version ]; then
puts-step "Clearing cached dependencies"
# if there are any differences, clear the Python cache
# Installing Python over again does not take noticably more time
rm -rf .heroku/python
unset SKIP_INSTALL
fi
else
# IF there IS a cached directory, check for differences with the new one
if ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"; then
puts-step "Clearing cached dependencies"
if ! diff "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt" &> /dev/null; then
puts-step "Requirements file has been changed, clearing cached dependencies"
# if there are any differences, clear the Python cache
# Installing Python over again does not take noticably more time
cp -R "$BUILD_DIR/requirements.txt" "$CACHE_DIR/.heroku/requirements.txt"
rm -rf .heroku/python
unset SKIP_INSTALL
else
puts-step "No change in requirements detected, installing from cache"
fi
fi
-1
View File
@@ -67,7 +67,6 @@ buildpack_sqlite3_install() {
puts-step "Installing SQLite3"
if sqlite3_install "$BUILD_DIR/.heroku/python" ; then
echo "Sqlite3 successfully installed."
mcount "success.python.sqlite3"
else
echo "Sqlite3 failed to install."
+1 -1
View File
@@ -1,4 +1,4 @@
FROM heroku/heroku:18-build.v16
FROM heroku/heroku:18-build
WORKDIR /app
ENV WORKSPACE_DIR="/app/builds" \
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/vendor/
OUT_PREFIX=$1
# Skip the build for heroku-16.
if [[ $S3_PREFIX == "heroku-16" ]]; then
exit 0
fi
# Use new path, containing autoconf.
export PATH="/app/.heroku/python/bin/:$PATH"
hash -r
echo "Building libffi…"
SOURCE_TARBALL='https://github.com/libffi/libffi/archive/v3.1.tar.gz'
curl -L $SOURCE_TARBALL | tar x
cd v3.1
./configure --prefix=$OUT_PREFIX --disable-static &&
make
make install
# Cleanup
cd ..
+3 -3
View File
@@ -3,9 +3,9 @@
OUT_PREFIX=$1
# Skip the build for heroku-16.
if [[ $S3_PREFIX == "heroku-16" ]]; then
exit 0
if [[ $S3_PREFIX != "cedar-14" ]]; then
echo "libmemcached only needs to be built for cedar-14, since newer stacks include it in the base image"
exit 1
fi
# fail hard
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/pypy2.7
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/pypy3.6
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
OUT_PREFIX=$1
BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin"
export BIN_DIR
# shellcheck source=bin/utils
source "$BIN_DIR/steps/sqlite3"
sqlite3_version
echo "Setting up SQLite3 Headers for $SQLITE3_VERSION"
sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1
echo "Building Python…"
SOURCE_TARBALL='https://python.org/ftp/python/2.7.18/Python-2.7.18.tgz'
curl -L $SOURCE_TARBALL | tar xz
mv Python-2.7.18 src
cd src
./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no
make
make install
# Remove unneeded test directories, similar to the official Docker Python images:
# https://github.com/docker-library/python
find "${OUT_PREFIX}" \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf '{}' +
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/python3
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/python3
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/python3
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Build Path: /app/.heroku/python/
source $(dirname $0)/python3
Regular → Executable
View File
+2 -1
View File
@@ -1,5 +1,6 @@
{
"python": [
"heroku/python-getting-started"
"heroku/python-getting-started",
"sharpstone/python_default"
]
}
+3 -1
View File
@@ -1,3 +1,5 @@
---
- - "./repos/python/python-getting-started"
- f56b90499ec11e1c9576da2f8c7331300e189db3
- master
- - "./repos/python/python_default"
- ca947f69027b2a30be5d26f9a42f25e54f4d7a1a
+33
View File
@@ -0,0 +1,33 @@
require_relative '../spec_helper'
describe "Heroku CI" do
it "works" do
before_deploy = Proc.new do
File.open("app.json", "w+") do |f|
f.puts <<~EOM
{
"environments": {
"test": {
"scripts": {
"test": "nosetests"
}
}
}
}
EOM
end
run!("echo nose >> requirements.txt")
end
Hatchet::Runner.new("python_default", before_deploy: before_deploy).run_ci do |test_run|
expect(test_run.output).to match("Downloading nose")
expect(test_run.output).to match("OK")
test_run.run_again
expect(test_run.output).to match("installing from cache")
expect(test_run.output).to_not match("Downloading nose")
end
end
end
+60 -16
View File
@@ -1,28 +1,72 @@
require_relative '../spec_helper'
describe "Default Python Deploy" do
it "🐍" do
Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app|
expect(app.output).to match(/Installing pip/)
expect(app.run('python -V')).to match(/3.6.10/)
describe "Python" do
describe "cache" do
it "functions correctly" do
Hatchet::Runner.new("python_default").deploy do |app|
expect(app.output).to match(/Installing pip/)
expect(app.output).to_not match("Requirements file has been changed, clearing cached dependencies")
expect(app.output).to_not match("No change in requirements detected, installing from cache")
expect(app.output).to_not match("No such file or directory")
expect(app.output).to_not match("cp: cannot create regular file")
expect(app.output).to_not match("Clearing cached dependencies")
# Redeploy with changed requirements file
run!(%Q{echo "" >> requirements.txt})
run!(%Q{echo "pygments" >> requirements.txt})
run!(%Q{git add . ; git commit --allow-empty -m next})
app.push!
# Redeploy
run!(%Q{echo "flask" >> requirements.txt})
run!(%Q{git add . ; git commit --allow-empty -m next})
app.push!
# Check the cache to have cleared
expect(app.output).to match("Requirements file has been changed, clearing cached dependencies")
expect(app.output).to_not match("No dependencies found, preparing to install")
expect(app.output).to_not match("No change in requirements detected, installing from cache")
# Check for the cache tohave cleared
expect(app.output).to match("Clearing cached dependencies")
# With no changes on redeploy, the cache should be present
run!(%Q{git commit --allow-empty -m next})
app.push!
run!(%Q{git commit --allow-empty -m next})
app.push!
expect(app.output).to match("No change in requirements detected, installing from cache")
expect(app.output).to_not match("Requirements file has been changed, clearing cached dependencies")
expect(app.output).to_not match("No dependencies found, preparing to install")
end
end
end
# The cache should not clear with no changes
expect(app.output).to_not match("Clearing cached dependencies")
describe "python versions" do
let(:stack) { ENV["HEROKU_TEST_STACK"] || DEFAULT_STACK }
it "works with 3.7.6" do
version = "3.7.6"
before_deploy = -> { run!(%Q{echo "python-#{version}" >> runtime.txt}) }
Hatchet::Runner.new("python_default", before_deploy: before_deploy, stack: stack).deploy do |app|
expect(app.run('python -V')).to match(version)
end
end
it "works with 3.8.2" do
version = "3.8.2"
before_deploy = -> { run!(%Q{echo "python-#{version}" >> runtime.txt}) }
Hatchet::Runner.new("python_default", before_deploy: before_deploy, stack: stack).deploy do |app|
expect(app.run('python -V')).to match(version)
end
end
it "fails with a bad version" do
version = "3.8.2.lol"
before_deploy = -> { run!(%Q{echo "python-#{version}" >> runtime.txt}) }
Hatchet::Runner.new("python_default", before_deploy: before_deploy, stack: stack, allow_failure: true).deploy do |app|
expect(app.output).to match("not available for this stack")
end
end
end
it "getting started app has no relative paths" do
buildpacks = [
:default,
"https://github.com/sharpstone/force_absolute_paths_buildpack"
]
Hatchet::Runner.new("python-getting-started", buildpacks: buildpacks).deploy do |app|
# Deploy works
end
end
end
+1 -6
View File
@@ -1,4 +1,4 @@
ENV['HATCHET_BUILDPACK_BASE'] = 'https://github.com/' + ENV['TRAVIS_REPO_SLUG'] + '.git'
ENV['HATCHET_BUILDPACK_BASE'] = 'https://github.com/heroku/heroku-buildpack-python.git'
require 'rspec/core'
require 'rspec/retry'
@@ -15,11 +15,6 @@ RSpec.configure do |config|
end
end
if ENV['TRAVIS']
# Don't execute tests against "merge" commits
exit 0 if ENV['TRAVIS_PULL_REQUEST'] != 'false' && ENV['TRAVIS_BRANCH'] == 'master'
end
DEFAULT_STACK = 'heroku-18'
def run!(cmd)
+2
View File
@@ -0,0 +1,2 @@
pwned-passwords-django==1.4
Django==2.1
+1
View File
@@ -0,0 +1 @@
Django==1.11
+1 -1
View File
@@ -1 +1 @@
python-2.7.17
python-2.7.18
+1 -1
View File
@@ -1 +1 @@
python-3.5.7
python-3.5.9
+8 -1
View File
@@ -23,6 +23,14 @@ testGEOS() {
assertCapturedSuccess
}
testGEOSDeprecation() {
export BUILD_WITH_GEO_LIBRARIES=1
compile "geos"
assertCaptured " ! The GDAL, GEOS and PROJ binaries and BUILD_WITH_GEO_LIBRARIES functonality are now deprecated.
! An alternative buildpack to enable GDAL, GEOS and PROJ use is available here - https://github.com/heroku/heroku-geo-buildpack"
assertCapturedSuccess
}
testNLTK() {
# NOTE: This is a RuntimeWarning emitted by Python 3's runpy.py script
# which is what is used when you call `python -m <module>`. This is due to
@@ -48,7 +56,6 @@ testPysqlite() {
testSqliteInstall() {
compile "pythonDefault"
assertCaptured "Sqlite3 successfully installed."
assertNotCaptured "Sqlite3 failed to install."
assertCapturedSuccess
}
+12
View File
@@ -74,6 +74,18 @@ testNoRequirements() {
assertCapturedError
}
testWarnOldDjango() {
compile "old-django"
assertCaptured "Your Django version is nearing the end of its community support."
assertCapturedSuccess
}
testDontWarnOldDjango() {
compile "not-old-django"
assertNotCaptured "Your Django version is nearing the end of its community support."
assertCapturedSuccess
}
pushd $(dirname 0) >/dev/null
popd >/dev/null