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
7b36645e
Commit
7b36645e
authored
Nov 21, 2014
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6024 from edx/clytwynec/fix_no_prereq_install
fix NO_PREREQ_INSTALL
parents
73dd6fe2
e9e59574
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 @
7b36645e
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 @
7b36645e
...
...
@@ -26,6 +26,25 @@ if os.path.exists(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
):
"""
Hash the contents of all the files and directories in `path_list`.
...
...
@@ -123,7 +142,7 @@ def install_ruby_prereqs():
"""
Installs Ruby prereqs
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
prereq_cache
(
"Ruby prereqs"
,
[
"Gemfile"
],
ruby_prereqs_installation
)
...
...
@@ -134,7 +153,7 @@ def install_node_prereqs():
"""
Installs Node prerequisites
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
prereq_cache
(
"Node prereqs"
,
[
"package.json"
],
node_prereqs_installation
)
...
...
@@ -145,7 +164,7 @@ def install_python_prereqs():
"""
Installs Python prerequisites
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
prereq_cache
(
"Python prereqs"
,
PYTHON_REQ_FILES
+
[
sysconfig
.
get_python_lib
()],
python_prereqs_installation
)
...
...
@@ -156,7 +175,7 @@ def install_prereqs():
"""
Installs Ruby, Node and Python prerequisites
"""
if
os
.
environ
.
get
(
"NO_PREREQ_INSTALL"
,
False
):
if
no_prereq_install
(
):
return
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