Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5b5fbc6b
Commit
5b5fbc6b
authored
May 17, 2013
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fingerprint the filenames in site-packages to decide when to install requirements.
parent
372084e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
rakefiles/helpers.rb
+1
-1
rakefiles/prereqs.rake
+14
-10
No files found.
rakefiles/helpers.rb
View file @
5b5fbc6b
...
@@ -16,7 +16,7 @@ end
...
@@ -16,7 +16,7 @@ end
def
when_changed
(
unchanged_message
,
*
files
)
def
when_changed
(
unchanged_message
,
*
files
)
Rake
::
Task
[
PREREQS_MD5_DIR
].
invoke
Rake
::
Task
[
PREREQS_MD5_DIR
].
invoke
cache_file
=
File
.
join
(
PREREQS_MD5_DIR
,
files
.
join
(
'-'
).
gsub
(
/\W+/
,
'-'
)
)
+
'.md5'
cache_file
=
File
.
join
(
PREREQS_MD5_DIR
,
files
[
0
].
gsub
(
/\W+/
,
'-'
).
sub
(
/-+$/
,
''
)
+
'.md5'
digest
=
Digest
::
MD5
.
new
()
digest
=
Digest
::
MD5
.
new
()
Dir
[
*
files
].
select
{
|
file
|
File
.
file?
(
file
)}.
each
do
|
file
|
Dir
[
*
files
].
select
{
|
file
|
File
.
file?
(
file
)}.
each
do
|
file
|
digest
.
file
(
file
)
digest
.
file
(
file
)
...
...
rakefiles/prereqs.rake
View file @
5b5fbc6b
require
'./rakefiles/helpers.rb'
require
'./rakefiles/helpers.rb'
require
'tempfile'
PREREQS_MD5_DIR
=
ENV
[
"PREREQ_CACHE_DIR"
]
||
File
.
join
(
REPO_ROOT
,
'.prereqs_cache'
)
PREREQS_MD5_DIR
=
ENV
[
"PREREQ_CACHE_DIR"
]
||
File
.
join
(
REPO_ROOT
,
'.prereqs_cache'
)
...
@@ -28,15 +28,19 @@ end
...
@@ -28,15 +28,19 @@ end
desc
"Install all python prerequisites for the lms and cms"
desc
"Install all python prerequisites for the lms and cms"
task
:install_python_prereqs
=>
"ws:migrate"
do
task
:install_python_prereqs
=>
"ws:migrate"
do
unchanged
=
'Python requirements unchanged, nothing to install'
Tempfile
.
open
(
'pyinstalled'
)
do
|
pyinstalled
|
when_changed
(
unchanged
,
'requirements/**/*'
)
do
# Read the names of everything in site-packages, and include them in the fingerprint.
ENV
[
'PIP_DOWNLOAD_CACHE'
]
||=
'.pip_download_cache'
sh
(
"python -c 'import os; import distutils.sysconfig as dusc; print sorted(os.listdir(dusc.get_python_lib()))' >
#{
pyinstalled
.
path
}
"
)
sh
(
'pip install --exists-action w -r requirements/edx/base.txt'
)
unchanged
=
'Python requirements unchanged, nothing to install'
sh
(
'pip install --exists-action w -r requirements/edx/post.txt'
)
when_changed
(
unchanged
,
'requirements/**/*'
,
pyinstalled
.
path
)
do
# Check for private-requirements.txt: used to install our libs as working dirs,
ENV
[
'PIP_DOWNLOAD_CACHE'
]
||=
'.pip_download_cache'
# or personal-use tools.
sh
(
'pip install --exists-action w -r requirements/edx/base.txt'
)
if
File
.
file?
(
"requirements/private.txt"
)
sh
(
'pip install --exists-action w -r requirements/edx/post.txt'
)
sh
(
'pip install -r requirements/private.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
unless
ENV
[
'NO_PREREQ_INSTALL'
]
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment