Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
heroku-buildpack-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evili del Rio i Silvan
heroku-buildpack-python
Commits
bdd466f8
Commit
bdd466f8
authored
8 years ago
by
Kenneth Reitz
Browse files
Options
Downloads
Patches
Plain Diff
cleanup pip install steps, caching src
parent
324ebc92
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/compile
+9
-1
9 additions, 1 deletion
bin/compile
bin/steps/pip-install
+9
-0
9 additions, 0 deletions
bin/steps/pip-install
with
18 additions
and
1 deletion
bin/compile
+
9
−
1
View file @
bdd466f8
...
@@ -148,11 +148,14 @@ bpwatch start restore_cache
...
@@ -148,11 +148,14 @@ bpwatch start restore_cache
cp
-R
$CACHE_DIR
/.heroku/python-version .heroku/ &> /dev/null
||
true
cp
-R
$CACHE_DIR
/.heroku/python-version .heroku/ &> /dev/null
||
true
cp
-R
$CACHE_DIR
/.heroku/vendor .heroku/ &> /dev/null
||
true
cp
-R
$CACHE_DIR
/.heroku/vendor .heroku/ &> /dev/null
||
true
cp
-R
$CACHE_DIR
/.heroku/venv .heroku/ &> /dev/null
||
true
cp
-R
$CACHE_DIR
/.heroku/venv .heroku/ &> /dev/null
||
true
if
[[
-d
$CACHE_DIR
/.heroku/src
]]
;
then
cp
-R
$CACHE_DIR
/.heroku/src .heroku/ &> /dev/null
||
true
fi
bpwatch stop restore_cache
bpwatch stop restore_cache
mkdir
-p
$(
dirname
$PROFILE_PATH
)
mkdir
-p
$(
dirname
$PROFILE_PATH
)
mkdir
/app/.heroku/src
mkdir
-p
/app/.heroku/src
if
[[
$BUILD_DIR
!=
'/app'
]]
;
then
if
[[
$BUILD_DIR
!=
'/app'
]]
;
then
# python expects to reside in /app, so set up symlinks
# python expects to reside in /app, so set up symlinks
...
@@ -160,6 +163,7 @@ if [[ $BUILD_DIR != '/app' ]]; then
...
@@ -160,6 +163,7 @@ if [[ $BUILD_DIR != '/app' ]]; then
ln
-s
$BUILD_DIR
/.heroku/python /app/.heroku/python
ln
-s
$BUILD_DIR
/.heroku/python /app/.heroku/python
ln
-s
$BUILD_DIR
/.heroku/vendor /app/.heroku/vendor
ln
-s
$BUILD_DIR
/.heroku/vendor /app/.heroku/vendor
ln
-s
$BUILD_DIR
/.heroku/venv /app/.heroku/venv
ln
-s
$BUILD_DIR
/.heroku/venv /app/.heroku/venv
# Note: .heroku/src is copied in later.
fi
fi
# Install Python.
# Install Python.
...
@@ -228,6 +232,7 @@ bpwatch start dump_cache
...
@@ -228,6 +232,7 @@ bpwatch start dump_cache
rm
-rf
$CACHE_DIR
/.heroku/python-stack
rm
-rf
$CACHE_DIR
/.heroku/python-stack
rm
-rf
$CACHE_DIR
/.heroku/vendor
rm
-rf
$CACHE_DIR
/.heroku/vendor
rm
-rf
$CACHE_DIR
/.heroku/venv
rm
-rf
$CACHE_DIR
/.heroku/venv
rm
-rf
$CACHE_DIR
/.heroku/src
mkdir
-p
$CACHE_DIR
/.heroku
mkdir
-p
$CACHE_DIR
/.heroku
cp
-R
.heroku/python
$CACHE_DIR
/.heroku/
cp
-R
.heroku/python
$CACHE_DIR
/.heroku/
...
@@ -235,6 +240,9 @@ bpwatch start dump_cache
...
@@ -235,6 +240,9 @@ bpwatch start dump_cache
cp
-R
.heroku/python-stack
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
cp
-R
.heroku/python-stack
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
cp
-R
.heroku/vendor
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
cp
-R
.heroku/vendor
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
cp
-R
.heroku/venv
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
cp
-R
.heroku/venv
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
if
[[
-d
.heroku/src
]]
;
then
cp
-R
.heroku/src
$CACHE_DIR
/.heroku/ &> /dev/null
||
true
fi
bpwatch stop dump_cache
bpwatch stop dump_cache
...
...
This diff is collapsed.
Click to expand it.
bin/steps/pip-install
+
9
−
0
View file @
bdd466f8
# Install dependencies with Pip.
# Install dependencies with Pip.
puts-cmd "pip install -r requirements.txt"
puts-cmd "pip install -r requirements.txt"
# rewrite any existing egg links to point to the build dir so pip does not fail with a mismatch error
find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -print0 | xargs -r -0 -n 1 sed -i -e "s#/app/#$(pwd)/#"
find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 | xargs -r -0 -n 1 sed -i -e "s#/app/#/$(pwd)/#"
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
[ ! "$FRESH_PYTHON" ] && bpwatch start pip_install
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
[ "$FRESH_PYTHON" ] && bpwatch start pip_install_first
...
@@ -23,4 +27,9 @@ cp requirements.txt .heroku/python/requirements-declared.txt
...
@@ -23,4 +27,9 @@ cp requirements.txt .heroku/python/requirements-declared.txt
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
[ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
[ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first
# rewrite build dir in egg links to /app so things are found at runtime
find .heroku/python/lib/python*/site-packages/ -name "*.egg-link" -print0 | xargs -r -0 -n 1 sed -i -e "s#$(pwd)/#/app/#"
find .heroku/python/lib/python*/site-packages/ -name "*.pth" -print0 | xargs -r -0 -n 1 sed -i -e "s#$(pwd)/#/app/#"
echo
echo
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment