From 3ebeb57686232ba22af16e8aad7fe321d5a347c0 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Wed, 21 Aug 2019 19:11:57 +0200 Subject: [PATCH 01/10] Support pyproject.toml when detecting Python apps --- bin/detect | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/detect b/bin/detect index eeb965b0..682585fc 100755 --- a/bin/detect +++ b/bin/detect @@ -15,7 +15,7 @@ BUILD_DIR=$1 # Exit early if app is clearly not Python. -if [ ! -f "$BUILD_DIR/requirements.txt" ] && [ ! -f "$BUILD_DIR/setup.py" ] && [ ! -f "$BUILD_DIR/Pipfile" ]; then +if [ ! -f "$BUILD_DIR/requirements.txt" ] && [ ! -f "$BUILD_DIR/setup.py" ] && [ ! -f "$BUILD_DIR/Pipfile" ] && [ ! -f "$BUILD_DIR/pyproject.toml" ]; then exit 1 fi From d20ddf87f36f9e4f4a4c4e44a18bb8125b32bf56 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Thu, 22 Aug 2019 13:16:08 +0200 Subject: [PATCH 02/10] Avoid editable installs for pyproject.toml-style projects --- bin/compile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index db2d838b..6e30856b 100755 --- a/bin/compile +++ b/bin/compile @@ -269,8 +269,13 @@ mtime "pip.uninstall.time" "${start}" # This allows for people to ship a setup.py application to Heroku # (which is rare, but I vouch that it should work!) -if [ ! -f requirements.txt ] && [ ! -f Pipfile ]; then - echo "-e ." > requirements.txt +if [ ! -f requirements.txt ] && [ ! -f Pipfile ] ; then + if [ -f pyproject.toml ] ; then + # Editable installs are not supported for pyproject.toml-style projects. + echo "." > requirements.txt + else + echo "-e ." > requirements.txt + fi fi # Fix egg-links. From 0422f568e407837f7da6b59bece7c17b262ac41d Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Wed, 21 Aug 2019 21:41:20 +0200 Subject: [PATCH 03/10] Add tests for pyproject.toml-style projects using poetry Add two test cases for projects using poetry as the build backend: - testPoetry: project without dependencies - testPoetryLock: project with dependencies, using a poetry.lock file --- test/fixtures/poetry-lock/foobar.py | 0 test/fixtures/poetry-lock/poetry.lock | 19 +++++++++++++++++++ test/fixtures/poetry-lock/pyproject.toml | 15 +++++++++++++++ test/fixtures/poetry/foobar.py | 0 test/fixtures/poetry/pyproject.toml | 14 ++++++++++++++ test/run-features | 10 ++++++++++ 6 files changed, 58 insertions(+) create mode 100644 test/fixtures/poetry-lock/foobar.py create mode 100644 test/fixtures/poetry-lock/poetry.lock create mode 100644 test/fixtures/poetry-lock/pyproject.toml create mode 100644 test/fixtures/poetry/foobar.py create mode 100644 test/fixtures/poetry/pyproject.toml diff --git a/test/fixtures/poetry-lock/foobar.py b/test/fixtures/poetry-lock/foobar.py new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/poetry-lock/poetry.lock b/test/fixtures/poetry-lock/poetry.lock new file mode 100644 index 00000000..3eb16032 --- /dev/null +++ b/test/fixtures/poetry-lock/poetry.lock @@ -0,0 +1,19 @@ +[[package]] +category = "main" +description = "Classes Without Boilerplate" +name = "attrs" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "19.1.0" + +[package.extras] +dev = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface", "sphinx", "pre-commit"] +docs = ["sphinx", "zope.interface"] +tests = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface"] + +[metadata] +content-hash = "9c92739040d45f898575877e69198d92bb9477423fe80c60a14376bf1f3d010e" +python-versions = "^3.7" + +[metadata.hashes] +attrs = ["69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", "f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399"] diff --git a/test/fixtures/poetry-lock/pyproject.toml b/test/fixtures/poetry-lock/pyproject.toml new file mode 100644 index 00000000..0a3fd420 --- /dev/null +++ b/test/fixtures/poetry-lock/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "foobar" +version = "0.1.0" +description = "" +authors = ["Your Name "] + +[tool.poetry.dependencies] +python = "^3.6" +attrs = "^19.1.0" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/test/fixtures/poetry/foobar.py b/test/fixtures/poetry/foobar.py new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/poetry/pyproject.toml b/test/fixtures/poetry/pyproject.toml new file mode 100644 index 00000000..4074cf7f --- /dev/null +++ b/test/fixtures/poetry/pyproject.toml @@ -0,0 +1,14 @@ +[tool.poetry] +name = "foobar" +version = "0.1.0" +description = "" +authors = ["Your Name "] + +[tool.poetry.dependencies] +python = "^3.6" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" diff --git a/test/run-features b/test/run-features index 66fac4ea..54b195a8 100755 --- a/test/run-features +++ b/test/run-features @@ -70,6 +70,16 @@ testPipenvFullVersion() { assertCapturedSuccess } +testPoetry() { + compile "poetry" + assertCapturedSuccess +} + +testPoetryLock() { + compile "poetry-lock" + assertCapturedSuccess +} + testNoRequirements() { compile "no-requirements" assertCapturedError From 7a65ab1b7d00cc2b390defd7b250ca93f433330f Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Thu, 22 Aug 2019 18:14:10 +0200 Subject: [PATCH 04/10] Add tests for pyproject.toml-style projects using flit Add two test cases for projects using flit as the build backend: - testFlit: project without dependencies - testFlitRequires: project with dependencies --- test/fixtures/flit-requires/foobar.py | 3 +++ test/fixtures/flit-requires/pyproject.toml | 10 ++++++++++ test/fixtures/flit/foobar.py | 3 +++ test/fixtures/flit/pyproject.toml | 9 +++++++++ test/run-features | 10 ++++++++++ 5 files changed, 35 insertions(+) create mode 100644 test/fixtures/flit-requires/foobar.py create mode 100644 test/fixtures/flit-requires/pyproject.toml create mode 100644 test/fixtures/flit/foobar.py create mode 100644 test/fixtures/flit/pyproject.toml diff --git a/test/fixtures/flit-requires/foobar.py b/test/fixtures/flit-requires/foobar.py new file mode 100644 index 00000000..4b4c6781 --- /dev/null +++ b/test/fixtures/flit-requires/foobar.py @@ -0,0 +1,3 @@ +"""An amazing sample package!""" + +__version__ = '0.1' diff --git a/test/fixtures/flit-requires/pyproject.toml b/test/fixtures/flit-requires/pyproject.toml new file mode 100644 index 00000000..61cc974f --- /dev/null +++ b/test/fixtures/flit-requires/pyproject.toml @@ -0,0 +1,10 @@ +[build-system] +requires = ["flit"] +build-backend = "flit.buildapi" + +[tool.flit.metadata] +module = "foobar" +author = "Sir Robin" +author-email = "robin@camelot.uk" +home-page = "https://github.com/sirrobin/foobar" +requires = ["attrs >=19.1.0"] diff --git a/test/fixtures/flit/foobar.py b/test/fixtures/flit/foobar.py new file mode 100644 index 00000000..4b4c6781 --- /dev/null +++ b/test/fixtures/flit/foobar.py @@ -0,0 +1,3 @@ +"""An amazing sample package!""" + +__version__ = '0.1' diff --git a/test/fixtures/flit/pyproject.toml b/test/fixtures/flit/pyproject.toml new file mode 100644 index 00000000..3dca8c95 --- /dev/null +++ b/test/fixtures/flit/pyproject.toml @@ -0,0 +1,9 @@ +[build-system] +requires = ["flit"] +build-backend = "flit.buildapi" + +[tool.flit.metadata] +module = "foobar" +author = "Sir Robin" +author-email = "robin@camelot.uk" +home-page = "https://github.com/sirrobin/foobar" diff --git a/test/run-features b/test/run-features index 54b195a8..5c4b1b16 100755 --- a/test/run-features +++ b/test/run-features @@ -80,6 +80,16 @@ testPoetryLock() { assertCapturedSuccess } +testFlit() { + compile "flit" + assertCapturedSuccess +} + +testFlitRequires() { + compile "flit-requires" + assertCapturedSuccess +} + testNoRequirements() { compile "no-requirements" assertCapturedError From 42c45ee50c20ef4f75fc296d1e2bb4e82e2bdcce Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Wed, 28 Aug 2019 09:48:06 +0200 Subject: [PATCH 05/10] Add test for pyproject.toml-style project using setuptools --- test/fixtures/pyproject-toml/pyproject.toml | 3 +++ test/fixtures/pyproject-toml/setup.py | 4 ++++ test/run-features | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 test/fixtures/pyproject-toml/pyproject.toml create mode 100644 test/fixtures/pyproject-toml/setup.py diff --git a/test/fixtures/pyproject-toml/pyproject.toml b/test/fixtures/pyproject-toml/pyproject.toml new file mode 100644 index 00000000..864b334a --- /dev/null +++ b/test/fixtures/pyproject-toml/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta:__legacy__" diff --git a/test/fixtures/pyproject-toml/setup.py b/test/fixtures/pyproject-toml/setup.py new file mode 100644 index 00000000..4d986d25 --- /dev/null +++ b/test/fixtures/pyproject-toml/setup.py @@ -0,0 +1,4 @@ +from setuptools import setup + + +setup(name="foobar", version="1.0.0") diff --git a/test/run-features b/test/run-features index 5c4b1b16..3c7b168f 100755 --- a/test/run-features +++ b/test/run-features @@ -70,6 +70,11 @@ testPipenvFullVersion() { assertCapturedSuccess } +testPyProjectToml() { + compile "pyproject-toml" + assertCapturedSuccess +} + testPoetry() { compile "poetry" assertCapturedSuccess From 13633dbb668d6aff2b30a436eb5ae2c2a71d20e0 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Fri, 23 Aug 2019 10:10:08 +0200 Subject: [PATCH 06/10] Add failing test for poetry.lock Check that pinned requirements are honored when poetry.lock is present. Request an outdated version of marshmallow in poetry.lock (3.0.0). Check that the outdated version is installed, rather than a newer version also satisfying the version constraint in pyproject.toml (^3.0.0). --- test/fixtures/poetry-lock/poetry.lock | 21 +++++++++++---------- test/fixtures/poetry-lock/pyproject.toml | 2 +- test/run-features | 1 + 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/fixtures/poetry-lock/poetry.lock b/test/fixtures/poetry-lock/poetry.lock index 3eb16032..99cd77b4 100644 --- a/test/fixtures/poetry-lock/poetry.lock +++ b/test/fixtures/poetry-lock/poetry.lock @@ -1,19 +1,20 @@ [[package]] category = "main" -description = "Classes Without Boilerplate" -name = "attrs" +description = "A lightweight library for converting complex datatypes to and from native Python datatypes." +name = "marshmallow" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "19.1.0" +python-versions = ">=3.5" +version = "3.0.0" [package.extras] -dev = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface", "sphinx", "pre-commit"] -docs = ["sphinx", "zope.interface"] -tests = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface"] +dev = ["pytest", "pytz", "simplejson", "flake8 (3.7.8)", "flake8-bugbear (19.8.0)", "pre-commit (>=1.17,<2.0)", "tox"] +docs = ["sphinx (2.2.0)", "sphinx-issues (1.2.0)", "alabaster (0.7.12)", "sphinx-version-warning (1.1.2)"] +lint = ["flake8 (3.7.8)", "flake8-bugbear (19.8.0)", "pre-commit (>=1.17,<2.0)"] +tests = ["pytest", "pytz", "simplejson"] [metadata] -content-hash = "9c92739040d45f898575877e69198d92bb9477423fe80c60a14376bf1f3d010e" -python-versions = "^3.7" +content-hash = "11b18d7787605b57a1019436950c60105518d3f3a8a60030493402031355e2f2" +python-versions = "^3.6" [metadata.hashes] -attrs = ["69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", "f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399"] +marshmallow = ["e5e9fd0c2e919b4ece915eb30808206349a49a45df72e99ed20e27a9053d574b", "fa2d8a4b61d09b0e161a14acc5ad8ab7aaaf1477f3dd52819ddd6c6c8275733a"] \ No newline at end of file diff --git a/test/fixtures/poetry-lock/pyproject.toml b/test/fixtures/poetry-lock/pyproject.toml index 0a3fd420..85695c71 100644 --- a/test/fixtures/poetry-lock/pyproject.toml +++ b/test/fixtures/poetry-lock/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Your Name "] [tool.poetry.dependencies] python = "^3.6" -attrs = "^19.1.0" +marshmallow = "^3.0.0" [tool.poetry.dev-dependencies] diff --git a/test/run-features b/test/run-features index 3c7b168f..e452a6cb 100755 --- a/test/run-features +++ b/test/run-features @@ -82,6 +82,7 @@ testPoetry() { testPoetryLock() { compile "poetry-lock" + assertCaptured "marshmallow==3.0.0" assertCapturedSuccess } From 4c9b95c51ada04a4f0532321145f0e29bfe72678 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Wed, 28 Aug 2019 18:09:24 +0200 Subject: [PATCH 07/10] Do not write requirements.txt for pyproject.toml-based projects Install pyproject.toml-based projects using `pip install .`. Do not use a requirements.txt for this. The requirements.txt file is needed to handle pinned versions extracted from the poetry.lock file. Note that we cannot simply append `.` to the exported requirements.txt file. Currently pip requires that either all requirements have a hash or none. Including `.` would thus force us to omit hashes for all requirements. --- bin/compile | 10 ++-------- bin/steps/pip-install | 23 ++++++++++++++++++----- bin/steps/pip-uninstall | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/bin/compile b/bin/compile index 6e30856b..8c9c9b22 100755 --- a/bin/compile +++ b/bin/compile @@ -268,14 +268,8 @@ mtime "pip.uninstall.time" "${start}" # If no requirements.txt file given, assume `setup.py develop` is intended. # This allows for people to ship a setup.py application to Heroku # (which is rare, but I vouch that it should work!) - -if [ ! -f requirements.txt ] && [ ! -f Pipfile ] ; then - if [ -f pyproject.toml ] ; then - # Editable installs are not supported for pyproject.toml-style projects. - echo "." > requirements.txt - else - echo "-e ." > requirements.txt - fi +if [ ! -f requirements.txt ] && [ ! -f Pipfile ] && [ ! -f pyproject.toml ]; then + echo "-e ." > requirements.txt fi # Fix egg-links. diff --git a/bin/steps/pip-install b/bin/steps/pip-install index b950feff..7be26ebb 100755 --- a/bin/steps/pip-install +++ b/bin/steps/pip-install @@ -34,15 +34,26 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then mcount "tool.pip" # Count expected build failures. - if grep -q '==0.0.0' requirements.txt; then + if [ -f requirements.txt ] && grep -q '==0.0.0' requirements.txt; then mcount "failure.none-version" fi if [ ! -f "$BUILD_DIR/.heroku/python/bin/pip" ]; then exit 1 fi - /app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent - PIP_STATUS="${PIPESTATUS[0]}" + + if [ -f requirements.txt ]; then + /app/.heroku/python/bin/pip install -r "$BUILD_DIR/requirements.txt" --exists-action=w --src=/app/.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee "$WARNINGS_LOG" | cleanup | indent + PIP_STATUS="${PIPESTATUS[0]}" + else + PIP_STATUS=0 + fi + + if [ "$PIP_STATUS" -eq 0 ] && [ -f pyproject.toml ]; then + /app/.heroku/python/bin/pip install . --exists-action=w --disable-pip-version-check --no-cache-dir 2>&1 | tee -a "$WARNINGS_LOG" | cleanup | indent + PIP_STATUS="${PIPESTATUS[0]}" + fi + set -e show-warnings @@ -53,8 +64,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then fi # Smart Requirements handling - cp requirements.txt .heroku/python/requirements-declared.txt - /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt + if [ -f requirements.txt ]; then + cp requirements.txt .heroku/python/requirements-declared.txt + /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt + fi echo diff --git a/bin/steps/pip-uninstall b/bin/steps/pip-uninstall index 2e1ad8db..ed5fae0c 100755 --- a/bin/steps/pip-uninstall +++ b/bin/steps/pip-uninstall @@ -5,7 +5,7 @@ set +e # shellcheck source=bin/utils source "$BIN_DIR/utils" -if [ ! "$SKIP_PIP_INSTALL" ]; then +if [ ! "$SKIP_PIP_INSTALL" ] && [ -f requirements.txt ]; then if [[ -f .heroku/python/requirements-declared.txt ]]; then From 2614fabf4e1028375da92f08bd624c054e4467f4 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Fri, 23 Aug 2019 16:58:32 +0200 Subject: [PATCH 08/10] Install pinned dependencies from poetry.lock If a poetry.lock file is present, use the Poetry CLI to export the pinned requirements to a requirements.txt file. If the project already contains a requirements.txt, use that and ignore poetry.lock. Poetry is not used to install the project because it does not clean up stale requirements. This means that requirements need to be exported anyway, for the `pip-uninstall` step. Since we only use Poetry to export a requirements.txt file, ignore the Poetry version specified in pyproject.toml. Install a pre-release of 1.0.0 because the export command is not available before 1.0.0a0. Note that supporting pyproject.toml-based installations is not enough to handle pinned requirements: When pip installs a pyproject.toml-style project using the process described in PEP 517, it only uses Poetry to build a wheel. The wheel contains the version constraints from pyproject.toml, not the pinned versions from poetry.lock. --- bin/compile | 4 +++ bin/steps/poetry | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 bin/steps/poetry diff --git a/bin/compile b/bin/compile index 8c9c9b22..df9e79f5 100755 --- a/bin/compile +++ b/bin/compile @@ -257,6 +257,10 @@ mtime "python.install.time" "${start}" # shellcheck source=bin/steps/pipenv source "$BIN_DIR/steps/pipenv" +# Export requirements.txt from poetry.lock, if present. +# shellcheck source=bin/steps/poetry +source "$BIN_DIR/steps/poetry" + # Uninstall removed dependencies with Pip. # The buildpack will automatically remove any declared dependencies (in requirements.txt) # that were explicitly removed. This machinery is a bit complex, but it is not complicated. diff --git a/bin/steps/poetry b/bin/steps/poetry new file mode 100644 index 00000000..aed1fdc8 --- /dev/null +++ b/bin/steps/poetry @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +set -e + +# shellcheck source=bin/utils +source "$BIN_DIR/utils" + +if [ ! -f requirements.txt ] && [ -f pyproject.toml ] && [ -f poetry.lock ]; then + # Measure that we're using Poetry. + mcount "tool.poetry" + + # Hash poetry.lock to detect changes. + POETRY_LOCK_SHA=$(openssl dgst -sha256 poetry.lock) + + # Use cached requirements.txt if poetry.lock is unchanged. + CACHED_REQUIREMENTS=$CACHE_DIR/requirements.txt + CACHED_POETRY_LOCK_SHA=$CACHE_DIR/poetry.lock.sha256 + + if [ -f "$CACHED_REQUIREMENTS" ] && [ -f "$CACHED_POETRY_LOCK_SHA" ] && + [ "$POETRY_LOCK_SHA" == "$(cat "$CACHED_POETRY_LOCK_SHA")" ]; then + echo "Skipping requirements export, as poetry.lock hasn't changed since last deploy." | indent + cp "$CACHED_REQUIREMENTS" requirements.txt + else + # Set environment variables for pip + # This reads certain environment variables set on the Heroku app config + # and makes them accessible to the pip install process. + # + # PIP_EXTRA_INDEX_URL allows for an alternate pypi URL to be used. + if [[ -r "$ENV_DIR/PIP_EXTRA_INDEX_URL" ]]; then + PIP_EXTRA_INDEX_URL="$(cat "$ENV_DIR/PIP_EXTRA_INDEX_URL")" + export PIP_EXTRA_INDEX_URL + mcount "buildvar.PIP_EXTRA_INDEX_URL" + fi + + # Set SLUGIFY_USES_TEXT_UNIDECODE, required for Airflow versions >=1.10 + if [[ -r "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE" ]]; then + SLUGIFY_USES_TEXT_UNIDECODE="$(cat "$ENV_DIR/SLUGIFY_USES_TEXT_UNIDECODE")" + export SLUGIFY_USES_TEXT_UNIDECODE + mcount "buildvar.SLUGIFY_USES_TEXT_UNIDECODE" + fi + + # Install Poetry. + # + # Poetry is not used to install the project because it does not clean up + # stale requirements (see sdispater/poetry#648), so we need to export + # requirements.txt anyway for the pip-uninstall step. + # + # Since we only use Poetry to export a requirements.txt file, ignore the + # Poetry version specified in pyproject.toml. Install a pre-release of + # 1.0.0 because the export command is not available before 1.0.0a0. + export POETRY_VERSION="1.0.0b1" + puts-step "Exporting requirements with Poetry $POETRY_VERSION…" + /app/.heroku/python/bin/pip install "poetry==$POETRY_VERSION" \ + --disable-pip-version-check &> /dev/null + + # Export requirements. + /app/.heroku/python/bin/poetry export -f requirements.txt > requirements.txt + + # Write SHA and requirements.txt to cache dir. + echo "$POETRY_LOCK_SHA" > "$CACHED_POETRY_LOCK_SHA" + cp requirements.txt "$CACHED_REQUIREMENTS" + fi +fi From 1d609a11ee8ad832f1ffbbff1733c08ef5d2eb06 Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Sun, 24 Nov 2019 15:24:00 +0100 Subject: [PATCH 09/10] Upgrade to poetry 1.0.0b7 --- bin/steps/poetry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/poetry b/bin/steps/poetry index aed1fdc8..2b51ac39 100644 --- a/bin/steps/poetry +++ b/bin/steps/poetry @@ -48,7 +48,7 @@ if [ ! -f requirements.txt ] && [ -f pyproject.toml ] && [ -f poetry.lock ]; the # Since we only use Poetry to export a requirements.txt file, ignore the # Poetry version specified in pyproject.toml. Install a pre-release of # 1.0.0 because the export command is not available before 1.0.0a0. - export POETRY_VERSION="1.0.0b1" + export POETRY_VERSION="1.0.0b7" puts-step "Exporting requirements with Poetry $POETRY_VERSION…" /app/.heroku/python/bin/pip install "poetry==$POETRY_VERSION" \ --disable-pip-version-check &> /dev/null From cd23a90c53281d86873954999d081bf2d75f397b Mon Sep 17 00:00:00 2001 From: Claudio Jolowicz Date: Sun, 24 Nov 2019 15:24:11 +0100 Subject: [PATCH 10/10] Use --output option instead of stream redirection --- bin/steps/poetry | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/steps/poetry b/bin/steps/poetry index 2b51ac39..32ee98ab 100644 --- a/bin/steps/poetry +++ b/bin/steps/poetry @@ -54,7 +54,7 @@ if [ ! -f requirements.txt ] && [ -f pyproject.toml ] && [ -f poetry.lock ]; the --disable-pip-version-check &> /dev/null # Export requirements. - /app/.heroku/python/bin/poetry export -f requirements.txt > requirements.txt + /app/.heroku/python/bin/poetry export -f requirements.txt -o requirements.txt # Write SHA and requirements.txt to cache dir. echo "$POETRY_LOCK_SHA" > "$CACHED_POETRY_LOCK_SHA"