Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Hsin-Yu Chien
edx-platform-release
Commits
9834f27e
Commit
9834f27e
authored
11 years ago
by
Ned Batchelder
Browse files
Options
Downloads
Patches
Plain Diff
Fingerprint the filenames in site-packages to decide when to install requirements.
parent
372084e0
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rakefiles/prereqs.rake
+17
-11
17 additions, 11 deletions
rakefiles/prereqs.rake
with
17 additions
and
11 deletions
rakefiles/prereqs.rake
+
17
−
11
View file @
9834f27e
require
'./rakefiles/helpers.rb'
require
'tempfile'
PREREQS_MD5_DIR
=
ENV
[
"PREREQ_CACHE_DIR"
]
||
File
.
join
(
REPO_ROOT
,
'.prereqs_cache'
)
...
...
@@ -28,15 +28,21 @@ end
desc
"Install all python prerequisites for the lms and cms"
task
:install_python_prereqs
=>
"ws:migrate"
do
unchanged
=
'Python requirements unchanged, nothing to install'
when_changed
(
unchanged
,
'requirements/**/*'
)
do
ENV
[
'PIP_DOWNLOAD_CACHE'
]
||=
'.pip_download_cache'
sh
(
'pip install --exists-action w -r requirements/edx/base.txt'
)
sh
(
'pip install --exists-action w -r requirements/edx/post.txt'
)
# Check for private-requirements.txt: used to install our libs as working dirs,
# or personal-use tools.
if
File
.
file?
(
"requirements/private.txt"
)
sh
(
'pip install -r requirements/private.txt'
)
if
!
ENV
[
'NO_PREREQ_INSTALL'
]
Tempfile
.
open
(
'pyinstalled'
)
do
|
pyinstalled
|
# Read the names of everything in site-packages, and include them in the fingerprint.
sh
(
"python -c 'import os; import distutils.sysconfig as dusc; print sorted(os.listdir(dusc.get_python_lib()))' >
#{
pyinstalled
.
path
}
"
)
unchanged
=
'Python requirements unchanged, nothing to install'
when_changed
(
unchanged
,
'requirements/**/*'
,
pyinstalled
.
path
)
do
ENV
[
'PIP_DOWNLOAD_CACHE'
]
||=
'.pip_download_cache'
sh
(
'pip install --exists-action w -r requirements/edx/base.txt'
)
sh
(
'pip install --exists-action w -r requirements/edx/post.txt'
)
# requirements/private.txt is used to install our libs as
# working dirs, or for personal-use tools.
if
File
.
file?
(
"requirements/private.txt"
)
sh
(
'pip install -r requirements/private.txt'
)
end
end
end
end
unless
ENV
[
'NO_PREREQ_INSTALL'
]
end
end
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