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
7b36645e
Commit
7b36645e
authored
10 years ago
by
Christine Lytwynec
Browse files
Options
Downloads
Plain Diff
Merge pull request #6024 from edx/clytwynec/fix_no_prereq_install
fix NO_PREREQ_INSTALL
parents
73dd6fe2
e9e59574
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pavelib/paver_tests/test_prereqs.py
+40
-0
40 additions, 0 deletions
pavelib/paver_tests/test_prereqs.py
pavelib/prereqs.py
+23
-4
23 additions, 4 deletions
pavelib/prereqs.py
with
63 additions
and
4 deletions
pavelib/paver_tests/test_prereqs.py
0 → 100644
+
40
−
0
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
)
This diff is collapsed.
Click to expand it.
pavelib/prereqs.py
+
23
−
4
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
()
...
...
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