File tree Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Expand file tree Collapse file tree 3 files changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -265,14 +265,8 @@ mtime "pip.uninstall.time" "${start}"
265
265
# If no requirements.txt file given, assume `setup.py develop` is intended.
266
266
# This allows for people to ship a setup.py application to Heroku
267
267
# (which is rare, but I vouch that it should work!)
268
-
269
- if [ ! -f requirements.txt ] && [ ! -f Pipfile ] ; then
270
- if [ -f pyproject.toml ] ; then
271
- # Editable installs are not supported for pyproject.toml-style projects.
272
- echo " ." > requirements.txt
273
- else
274
- echo " -e ." > requirements.txt
275
- fi
268
+ if [ ! -f requirements.txt ] && [ ! -f Pipfile ] && [ ! -f pyproject.toml ]; then
269
+ echo " -e ." > requirements.txt
276
270
fi
277
271
278
272
# Fix egg-links.
Original file line number Diff line number Diff line change @@ -34,15 +34,26 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
34
34
mcount " tool.pip"
35
35
36
36
# Count expected build failures.
37
- if grep -q ' ==0.0.0' requirements.txt; then
37
+ if [ -f requirements.txt ] && grep -q ' ==0.0.0' requirements.txt; then
38
38
mcount " failure.none-version"
39
39
fi
40
40
41
41
if [ ! -f " $BUILD_DIR /.heroku/python/bin/pip" ]; then
42
42
exit 1
43
43
fi
44
- /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
45
- PIP_STATUS=" ${PIPESTATUS[0]} "
44
+
45
+ if [ -f requirements.txt ]; then
46
+ /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
47
+ PIP_STATUS=" ${PIPESTATUS[0]} "
48
+ else
49
+ PIP_STATUS=0
50
+ fi
51
+
52
+ if [ " $PIP_STATUS " -eq 0 ] && [ -f pyproject.toml ]; then
53
+ /app/.heroku/python/bin/pip install . --exists-action=w --disable-pip-version-check --no-cache-dir 2>&1 | tee -a " $WARNINGS_LOG " | cleanup | indent
54
+ PIP_STATUS=" ${PIPESTATUS[0]} "
55
+ fi
56
+
46
57
set -e
47
58
48
59
show-warnings
@@ -53,8 +64,10 @@ if [ ! "$SKIP_PIP_INSTALL" ]; then
53
64
fi
54
65
55
66
# Smart Requirements handling
56
- cp requirements.txt .heroku/python/requirements-declared.txt
57
- /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
67
+ if [ -f requirements.txt ]; then
68
+ cp requirements.txt .heroku/python/requirements-declared.txt
69
+ /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt
70
+ fi
58
71
59
72
echo
60
73
Original file line number Diff line number Diff line change 5
5
# shellcheck source=bin/utils
6
6
source " $BIN_DIR /utils"
7
7
8
- if [ ! " $SKIP_PIP_INSTALL " ]; then
8
+ if [ ! " $SKIP_PIP_INSTALL " ] && [ -f requirements.txt ] ; then
9
9
10
10
if [[ -f .heroku/python/requirements-declared.txt ]]; then
11
11
You can’t perform that action at this time.
0 commit comments