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
1eb07a4f
Commit
1eb07a4f
authored
Nov 21, 2014
by
Christine Lytwynec
Committed by
Zia Fazal
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix NO_PREREQ_INSTALL
parent
db2454bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
4 deletions
+63
-4
pavelib/paver_tests/test_prereqs.py
+40
-0
pavelib/prereqs.py
+23
-4
No files found.
pavelib/paver_tests/test_prereqs.py
0 → 100644
View file @
1eb07a4f
import
os
import
unittest
from
pavelib.prereqs
import
no_prereq_install
class
TestPaverPrereqInstall
(
unittest
.
TestCase
):
def
check_val
(
self
,
set_val
,
expected_val
):
_orig_environ
=
dict
(
os
.
environ
)
os
.
environ
[
'NO_PREREQ_INSTALL'
]
=
set_val
self
.
assertEqual
(
no_prereq_install
(),
expected_val
,
'NO_PREREQ_INSTALL is set to {}, but we read it as {}'
.
format
(
set_val
,
expected_val
),
)
# Reset Environment back to original state
os
.
environ
.
clear
()
os
.
environ
.
update
(
_orig_environ
)
def
test_no_prereq_install_true
(
self
):
self
.
check_val
(
'true'
,
True
)
def
test_no_prereq_install_false
(
self
):
self
.
check_val
(
'false'
,
False
)
def
test_no_prereq_install_True
(
self
):
self
.
check_val
(
'True'
,
True
)
def
test_no_prereq_install_False
(
self
):
self
.
check_val
(
'False'
,
False
)
def
test_no_prereq_install_0
(
self
):
self
.
check_val
(
'0'
,
False
)
def
test_no_prereq_install_1
(
self
):
self
.
check_val
(
'1'
,
True
)
pavelib/prereqs.py
View file @
1eb07a4f
...
@@ -27,6 +27,25 @@ if os.path.exists(PRIVATE_REQS):
...
@@ -27,6 +27,25 @@ if os.path.exists(PRIVATE_REQS):
PYTHON_REQ_FILES
.
append
(
PRIVATE_REQS
)
PYTHON_REQ_FILES
.
append
(
PRIVATE_REQS
)
def
no_prereq_install
():
"""
Determine if NO_PREREQ_INSTALL should be truthy or falsy.
"""
vals
=
{
'0'
:
False
,
'1'
:
True
,
'true'
:
True
,
'false'
:
False
,
}
val
=
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
'False'
)
.
lower
()
try
:
return
vals
[
val
]
except
:
return
False
def
compute_fingerprint
(
path_list
):
def
compute_fingerprint
(
path_list
):
"""
"""
Hash the contents of all the files and directories in `path_list`.
Hash the contents of all the files and directories in `path_list`.
...
@@ -125,7 +144,7 @@ def install_ruby_prereqs():
...
@@ -125,7 +144,7 @@ def install_ruby_prereqs():
"""
"""
Installs Ruby prereqs
Installs Ruby prereqs
"""
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
return
prereq_cache
(
"Ruby prereqs"
,
[
"Gemfile"
],
ruby_prereqs_installation
)
prereq_cache
(
"Ruby prereqs"
,
[
"Gemfile"
],
ruby_prereqs_installation
)
...
@@ -136,7 +155,7 @@ def install_node_prereqs():
...
@@ -136,7 +155,7 @@ def install_node_prereqs():
"""
"""
Installs Node prerequisites
Installs Node prerequisites
"""
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
return
prereq_cache
(
"Node prereqs"
,
[
"package.json"
],
node_prereqs_installation
)
prereq_cache
(
"Node prereqs"
,
[
"package.json"
],
node_prereqs_installation
)
...
@@ -147,7 +166,7 @@ def install_python_prereqs():
...
@@ -147,7 +166,7 @@ def install_python_prereqs():
"""
"""
Installs Python prerequisites
Installs Python prerequisites
"""
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
return
prereq_cache
(
"Python prereqs"
,
PYTHON_REQ_FILES
+
[
sysconfig
.
get_python_lib
()],
python_prereqs_installation
)
prereq_cache
(
"Python prereqs"
,
PYTHON_REQ_FILES
+
[
sysconfig
.
get_python_lib
()],
python_prereqs_installation
)
...
@@ -158,7 +177,7 @@ def install_prereqs():
...
@@ -158,7 +177,7 @@ def install_prereqs():
"""
"""
Installs Ruby, Node and Python prerequisites
Installs Ruby, Node and Python prerequisites
"""
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
return
install_ruby_prereqs
()
install_ruby_prereqs
()
...
...
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