Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.buildout
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.buildout
Commits
e679f354
Commit
e679f354
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Plain Diff
Merge branch 'pytest' into 'master'
Pytest See merge request
!41
parents
f5ffb964
edc4edcf
No related branches found
No related tags found
1 merge request
!41
Pytest
Pipeline
#45595
passed
4 years ago
Stage: build
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
bob/buildout/scripts.py
+33
-0
33 additions, 0 deletions
bob/buildout/scripts.py
bob/buildout/test_envwrapper.py
+181
-159
181 additions, 159 deletions
bob/buildout/test_envwrapper.py
conda/meta.yaml
+8
-7
8 additions, 7 deletions
conda/meta.yaml
with
224 additions
and
166 deletions
.gitignore
+
2
−
0
View file @
e679f354
...
@@ -18,3 +18,5 @@ build
...
@@ -18,3 +18,5 @@ build
*.egg
*.egg
src/
src/
record.txt
record.txt
.coverage
coverage.xml
This diff is collapsed.
Click to expand it.
bob/buildout/scripts.py
+
33
−
0
View file @
e679f354
...
@@ -139,6 +139,37 @@ class NoseTests(Script):
...
@@ -139,6 +139,37 @@ class NoseTests(Script):
update
=
install
update
=
install
class
PyTest
(
Script
):
"""
Installs pytest infrastructure
"""
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
name
=
name
self
.
buildout
=
buildout
self
.
options
=
options
if
'
interpreter
'
in
options
:
del
options
[
'
interpreter
'
]
if
'
pytest-flags
'
in
options
:
# use 'options' instead of 'options' to force use
flags
=
tools
.
parse_list
(
options
[
'
pytest-flags
'
])
init_code
=
[
'
sys.argv.append(%r)
'
%
k
for
k
in
flags
]
options
[
'
initialization
'
]
=
'
\n
'
.
join
(
init_code
)
self
.
options
[
'
entry-points
'
]
=
'
pytest=pytest:console_main
'
self
.
options
[
'
scripts
'
]
=
'
pytest
'
self
.
options
[
'
dependent-scripts
'
]
=
'
false
'
eggs
=
tools
.
eggs
(
self
.
buildout
[
'
buildout
'
],
self
.
options
,
self
.
name
)
self
.
options
[
'
eggs
'
]
=
tools
.
add_eggs
(
eggs
,
[
'
pytest
'
,
'
pytest-cov
'
])
# initializes base class
super
(
PyTest
,
self
).
__init__
(
self
.
buildout
,
self
.
name
,
self
.
options
)
def
install
(
self
):
return
super
(
PyTest
,
self
).
install
()
update
=
install
class
Coverage
(
Script
):
class
Coverage
(
Script
):
"""
Installs Coverage infrastructure
"""
"""
Installs Coverage infrastructure
"""
...
@@ -231,6 +262,7 @@ class Recipe(object):
...
@@ -231,6 +262,7 @@ class Recipe(object):
options
.
copy
())
options
.
copy
())
self
.
scripts
=
UserScripts
(
buildout
,
'
Scripts
'
,
options
.
copy
())
self
.
scripts
=
UserScripts
(
buildout
,
'
Scripts
'
,
options
.
copy
())
self
.
nose
=
NoseTests
(
buildout
,
'
Nose
'
,
options
.
copy
())
self
.
nose
=
NoseTests
(
buildout
,
'
Nose
'
,
options
.
copy
())
self
.
pytest
=
PyTest
(
buildout
,
'
PyTest
'
,
options
.
copy
())
self
.
coverage
=
Coverage
(
buildout
,
'
Coverage
'
,
options
.
copy
())
self
.
coverage
=
Coverage
(
buildout
,
'
Coverage
'
,
options
.
copy
())
self
.
sphinx
=
Sphinx
(
buildout
,
'
Sphinx
'
,
options
.
copy
())
self
.
sphinx
=
Sphinx
(
buildout
,
'
Sphinx
'
,
options
.
copy
())
...
@@ -241,6 +273,7 @@ class Recipe(object):
...
@@ -241,6 +273,7 @@ class Recipe(object):
self
.
dbpy
.
install_on_wrapped_env
()
+
\
self
.
dbpy
.
install_on_wrapped_env
()
+
\
self
.
scripts
.
install_on_wrapped_env
()
+
\
self
.
scripts
.
install_on_wrapped_env
()
+
\
self
.
nose
.
install_on_wrapped_env
()
+
\
self
.
nose
.
install_on_wrapped_env
()
+
\
self
.
pytest
.
install_on_wrapped_env
()
+
\
self
.
coverage
.
install_on_wrapped_env
()
+
\
self
.
coverage
.
install_on_wrapped_env
()
+
\
self
.
sphinx
.
install_on_wrapped_env
()
self
.
sphinx
.
install_on_wrapped_env
()
...
...
This diff is collapsed.
Click to expand it.
bob/buildout/test_envwrapper.py
+
181
−
159
View file @
e679f354
...
@@ -3,235 +3,257 @@
...
@@ -3,235 +3,257 @@
# Andre Anjos <andre.dos.anjos@gmail.com>
# Andre Anjos <andre.dos.anjos@gmail.com>
# Fri 21 Mar 2014 11:50:06 CET
# Fri 21 Mar 2014 11:50:06 CET
'''
Tests for our environment wrapper class
'''
"""
Tests for our environment wrapper class
"""
import
os
import
os
import
logging
import
logging
import
nose.tools
import
platform
import
platform
import
pytest
from
.envwrapper
import
EnvironmentWrapper
from
.envwrapper
import
EnvironmentWrapper
def
cleanup
():
'''
Removes weird variables from the user environment just for the tests
'''
remove
=
[
'
CFLAGS
'
,
'
CXXFLAGS
'
,
'
LDFLAGS
'
,
'
BOB_PREFIX_PATH
'
,
@pytest.fixture
(
autouse
=
True
)
'
PKG_CONFIG_PATH
'
,
'
CMAKE_PREFIX_PATH
'
]
def
cleanup
(
monkeypatch
):
for
key
in
remove
:
"""
Removes weird variables from the user environment just for the tests
"""
if
key
in
os
.
environ
:
del
os
.
environ
[
key
]
monkeypatch
.
delenv
(
"
CFLAGS
"
,
raising
=
False
)
monkeypatch
.
delenv
(
"
CXXFLAGS
"
,
raising
=
False
)
monkeypatch
.
delenv
(
"
LDFLAGS
"
,
raising
=
False
)
monkeypatch
.
delenv
(
"
BOB_PREFIX_PATH
"
,
raising
=
False
)
monkeypatch
.
delenv
(
"
PKG_CONFIG_PATH
"
,
raising
=
False
)
monkeypatch
.
delenv
(
"
CMAKE_PREFIX_PATH
"
,
raising
=
False
)
@nose.with_setup
(
cleanup
)
def
test_default
():
def
test_default
():
e
=
EnvironmentWrapper
(
logging
.
getLogger
())
e
=
EnvironmentWrapper
(
logging
.
getLogger
())
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
()
for
key
in
before
:
assert
key
in
os
.
environ
for
key
in
os
.
environ
:
assert
key
in
before
assert
before
==
os
.
environ
e
.
set
()
e
.
un
set
()
for
key
in
before
:
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
assert
key
in
os
.
environ
for
key
in
os
.
environ
:
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
key
in
before
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_set_debug_true
():
def
test_set_debug_true
():
# a few checks before we start
# a few checks before we start
assert
'
CFLAGS
'
not
in
os
.
environ
assert
"
CFLAGS
"
not
in
os
.
environ
assert
'
CXXFLAGS
'
not
in
os
.
environ
assert
"
CXXFLAGS
"
not
in
os
.
environ
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
()
e
.
set
()
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
)
,
2
)
assert
len
(
os
.
environ
)
-
len
(
before
)
==
2
assert
'
CFLAGS
'
in
os
.
environ
assert
"
CFLAGS
"
in
os
.
environ
assert
os
.
environ
[
'
CFLAGS
'
].
find
(
EnvironmentWrapper
.
DEBUG_CFLAGS
)
>=
0
assert
os
.
environ
[
"
CFLAGS
"
].
find
(
EnvironmentWrapper
.
DEBUG_CFLAGS
)
>=
0
assert
'
CXXFLAGS
'
in
os
.
environ
assert
"
CXXFLAGS
"
in
os
.
environ
assert
os
.
environ
[
'
CXXFLAGS
'
].
find
(
EnvironmentWrapper
.
DEBUG_CFLAGS
)
>=
0
assert
os
.
environ
[
"
CXXFLAGS
"
].
find
(
EnvironmentWrapper
.
DEBUG_CFLAGS
)
>=
0
e
.
unset
()
for
key
in
before
:
assert
(
key
in
os
.
environ
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_set_debug_false
():
def
test_set_debug_false
():
# a few checks before we start
# a few checks before we start
assert
'
CFLAGS
'
not
in
os
.
environ
assert
"
CFLAGS
"
not
in
os
.
environ
assert
'
CXXFLAGS
'
not
in
os
.
environ
assert
"
CXXFLAGS
"
not
in
os
.
environ
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
False
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
False
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
(
)
e
.
set
()
assert
len
(
os
.
environ
)
-
len
(
before
)
==
0
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
),
0
)
assert
"
CFLAGS
"
not
in
os
.
environ
assert
"
CXXFLAGS
"
not
in
os
.
environ
assert
'
CFLAGS
'
not
in
os
.
environ
e
.
unset
()
assert
'
CXXFLAGS
'
not
in
os
.
environ
for
key
in
before
:
assert
(
key
in
os
.
environ
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_set_prefixes
():
def
test_set_prefixes
():
# a few checks before we start
# a few checks before we start
assert
'
PKG_CONFIG_PATH
'
not
in
os
.
environ
assert
"
PKG_CONFIG_PATH
"
not
in
os
.
environ
prefixes
=
[
'
/a/b
'
,
'
/c/d
'
]
prefixes
=
[
"
/a/b
"
,
"
/c/d
"
]
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
prefixes
=
prefixes
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
prefixes
=
prefixes
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
()
e
.
set
()
#nose.tools.eq_(len(os.environ) - len(before), 2)
# assert len(os.environ) - len(before) == 2
assert
'
PKG_CONFIG_PATH
'
in
os
.
environ
assert
"
PKG_CONFIG_PATH
"
in
os
.
environ
nose
.
tools
.
eq_
(
os
.
environ
[
'
PKG_CONFIG_PATH
'
],
e
.
environ
[
'
PKG_CONFIG_PATH
'
])
assert
os
.
environ
[
"
PKG_CONFIG_PATH
"
]
==
e
.
environ
[
"
PKG_CONFIG_PATH
"
]
assert
'
BOB_PREFIX_PATH
'
in
os
.
environ
assert
"
BOB_PREFIX_PATH
"
in
os
.
environ
nose
.
tools
.
eq_
(
os
.
environ
[
'
BOB_PREFIX_PATH
'
],
os
.
pathsep
.
join
(
prefixes
))
assert
os
.
environ
[
"
BOB_PREFIX_PATH
"
]
==
os
.
pathsep
.
join
(
prefixes
)
assert
'
CMAKE_PREFIX_PATH
'
in
os
.
environ
assert
"
CMAKE_PREFIX_PATH
"
in
os
.
environ
nose
.
tools
.
eq_
(
os
.
environ
[
'
CMAKE_PREFIX_PATH
'
],
os
.
pathsep
.
join
(
prefixes
))
assert
os
.
environ
[
"
CMAKE_PREFIX_PATH
"
]
==
os
.
pathsep
.
join
(
prefixes
)
e
.
unset
()
for
key
in
before
:
assert
(
key
in
os
.
environ
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_set_environment
():
def
test_set_environment
():
# a few checks before we start
# a few checks before we start
varname
=
'
BOB_FOO
'
varname
=
"
BOB_FOO
"
varvalue
=
'
abc
'
varvalue
=
"
abc
"
assert
varname
not
in
os
.
environ
assert
varname
not
in
os
.
environ
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
environ
=
{
varname
:
varvalue
})
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
environ
=
{
varname
:
varvalue
}
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
(
)
e
.
set
()
assert
len
(
os
.
environ
)
-
len
(
before
)
==
1
assert
varname
in
os
.
environ
assert
os
.
environ
[
varname
]
==
varvalue
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
),
1
)
e
.
unset
()
assert
varname
in
os
.
environ
for
key
in
before
:
nose
.
tools
.
eq_
(
os
.
environ
[
varname
],
varvalue
)
assert
(
key
in
os
.
environ
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_environ_substitutions
():
def
test_environ_substitutions
():
# defines the environment with all legal substitutions
# defines the environment with all legal substitutions
environ
=
dict
(
environ
=
dict
(
BOB_FOO
=
'
foo
'
,
BOB_FOO
=
"
foo
"
,
BOB_T1
=
'
${BOB_FOO}:bar
'
,
BOB_T1
=
"
${BOB_FOO}:bar
"
,
BOB_T2
=
'
bar$BOB_FOO
'
,
BOB_T2
=
"
bar$BOB_FOO
"
,
)
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
environ
=
environ
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
environ
=
environ
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
()
e
.
set
()
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
),
3
)
assert
len
(
os
.
environ
)
-
len
(
before
)
==
3
for
key
in
environ
:
assert
key
in
os
.
environ
for
key
in
environ
:
nose
.
tools
.
eq_
(
os
.
environ
[
'
BOB_FOO
'
],
environ
[
'
BOB_FOO
'
])
assert
key
in
os
.
environ
nose
.
tools
.
eq_
(
os
.
environ
[
'
BOB_T1
'
],
environ
[
'
BOB_FOO
'
]
+
'
:bar
'
)
assert
os
.
environ
[
"
BOB_FOO
"
]
==
environ
[
"
BOB_FOO
"
]
nose
.
tools
.
eq_
(
os
.
environ
[
'
BOB_T2
'
],
'
bar
'
+
environ
[
'
BOB_FOO
'
])
assert
os
.
environ
[
"
BOB_T1
"
]
==
environ
[
"
BOB_FOO
"
]
+
"
:bar
"
assert
os
.
environ
[
"
BOB_T2
"
]
==
"
bar
"
+
environ
[
"
BOB_FOO
"
]
e
.
unset
()
for
key
in
before
:
assert
(
key
in
os
.
environ
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_set_multiple
():
def
test_set_multiple
():
# a few checks before we start
# a few checks before we start
environ
=
dict
(
environ
=
dict
(
CFLAGS
=
'
-DNDEBUG
'
,
CFLAGS
=
"
-DNDEBUG
"
,
CXXFLAGS
=
'
${CFLAGS}
'
,
CXXFLAGS
=
"
${CFLAGS}
"
,
PKG_CONFIG_PATH
=
'
/a/b/lib/pkgconfig
'
,
PKG_CONFIG_PATH
=
"
/a/b/lib/pkgconfig
"
,
BOB_PREFIX_PATH
=
'
/c/d
'
,
BOB_PREFIX_PATH
=
"
/c/d
"
,
CMAKE_PREFIX_PATH
=
'
/d/f
'
,
CMAKE_PREFIX_PATH
=
"
/d/f
"
,
)
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
,
environ
=
environ
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
,
environ
=
environ
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
(
)
e
.
set
()
assert
len
(
os
.
environ
)
-
len
(
before
)
==
5
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
),
5
)
assert
(
os
.
environ
[
"
CFLAGS
"
]
==
EnvironmentWrapper
.
DEBUG_CFLAGS
+
"
"
+
environ
[
"
CFLAGS
"
]
)
assert
os
.
environ
[
"
CXXFLAGS
"
]
==
os
.
environ
[
"
CFLAGS
"
]
assert
os
.
environ
[
"
BOB_PREFIX_PATH
"
].
startswith
(
environ
[
"
BOB_PREFIX_PATH
"
])
assert
os
.
environ
[
"
BOB_PREFIX_PATH
"
].
endswith
(
environ
[
"
CMAKE_PREFIX_PATH
"
])
assert
os
.
environ
[
"
CMAKE_PREFIX_PATH
"
]
==
os
.
environ
[
"
BOB_PREFIX_PATH
"
]
assert
os
.
environ
[
"
PKG_CONFIG_PATH
"
].
startswith
(
environ
[
"
PKG_CONFIG_PATH
"
])
assert
os
.
environ
[
"
PKG_CONFIG_PATH
"
].
find
(
environ
[
"
BOB_PREFIX_PATH
"
])
>=
0
nose
.
tools
.
eq_
(
os
.
environ
[
'
CFLAGS
'
],
EnvironmentWrapper
.
DEBUG_CFLAGS
+
'
'
+
environ
[
'
CFLAGS
'
])
e
.
unset
()
nose
.
tools
.
eq_
(
os
.
environ
[
'
CXXFLAGS
'
],
os
.
environ
[
'
CFLAGS
'
])
for
key
in
before
:
assert
os
.
environ
[
'
BOB_PREFIX_PATH
'
].
startswith
(
environ
[
'
BOB_PREFIX_PATH
'
])
assert
(
assert
os
.
environ
[
'
BOB_PREFIX_PATH
'
].
endswith
(
environ
[
'
CMAKE_PREFIX_PATH
'
])
key
in
os
.
environ
assert
os
.
environ
[
'
CMAKE_PREFIX_PATH
'
]
==
os
.
environ
[
'
BOB_PREFIX_PATH
'
]
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
assert
os
.
environ
[
'
PKG_CONFIG_PATH
'
].
startswith
(
environ
[
'
PKG_CONFIG_PATH
'
])
for
key
in
os
.
environ
:
assert
os
.
environ
[
'
PKG_CONFIG_PATH
'
].
find
(
environ
[
'
BOB_PREFIX_PATH
'
])
>=
0
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
e
.
unset
()
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
@nose.with_setup
(
cleanup
)
def
test_preserve_user
():
def
test_preserve_user
():
# a few checks before we start
# a few checks before we start
environ
=
dict
(
environ
=
dict
(
CFLAGS
=
'
-DNDEBUG
'
,
CFLAGS
=
"
-DNDEBUG
"
,
CXXFLAGS
=
'
${CFLAGS}
'
,
CXXFLAGS
=
"
${CFLAGS}
"
,
)
)
os
.
environ
[
'
CFLAGS
'
]
=
'
-BUILDOUT-TEST-STRING
'
os
.
environ
[
"
CFLAGS
"
]
=
"
-BUILDOUT-TEST-STRING
"
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
,
environ
=
environ
)
e
=
EnvironmentWrapper
(
logging
.
getLogger
(),
debug
=
True
,
environ
=
environ
)
before
=
dict
(
os
.
environ
)
before
=
dict
(
os
.
environ
)
e
.
set
()
e
.
set
()
nose
.
tools
.
eq_
(
len
(
os
.
environ
)
-
len
(
before
)
,
1
)
assert
len
(
os
.
environ
)
-
len
(
before
)
==
1
assert
os
.
environ
[
'
CFLAGS
'
].
startswith
(
'
-BUILDOUT-TEST-STRING
'
)
assert
os
.
environ
[
"
CFLAGS
"
].
startswith
(
"
-BUILDOUT-TEST-STRING
"
)
e
.
unset
()
e
.
unset
()
for
key
in
before
:
for
key
in
before
:
assert
key
in
os
.
environ
,
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
assert
(
for
key
in
os
.
environ
:
key
in
os
.
environ
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
),
"
key `%s
'
from before is not on os.environ
"
%
(
key
,)
nose
.
tools
.
eq_
(
before
,
os
.
environ
)
for
key
in
os
.
environ
:
assert
key
in
before
,
"
key `%s
'
was not on os.environ before
"
%
(
key
,)
assert
before
==
os
.
environ
This diff is collapsed.
Click to expand it.
conda/meta.yaml
+
8
−
7
View file @
e679f354
{
%
set name = 'bob.buildout' %
}
{
%
set name = 'bob.buildout' %
}
{
%
set project_dir = environ.get('RECIPE_DIR') + '/..' %
}
package
:
package
:
name
:
{{
name
}}
name
:
{{
name
}}
...
@@ -9,7 +10,7 @@ build:
...
@@ -9,7 +10,7 @@ build:
run_exports
:
run_exports
:
-
{{
pin_subpackage(name)
}}
-
{{
pin_subpackage(name)
}}
script
:
script
:
-
cd {{
environ.get('RECIPE_DIR') + '/..'
}}
-
cd {{
project_dir
}}
{
%
if environ.get('BUILD_EGG') %
}
{
%
if environ.get('BUILD_EGG') %
}
-
python setup.py sdist --formats=zip
-
python setup.py sdist --formats=zip
{
%
endif %
}
{
%
endif %
}
...
@@ -29,24 +30,24 @@ requirements:
...
@@ -29,24 +30,24 @@ requirements:
-
setuptools
-
setuptools
-
zc.recipe.egg
-
zc.recipe.egg
-
nose
-
nose
-
pytest
-
pytest-cov
-
coverage
-
coverage
-
sphinx
-
sphinx
-
sphinx_rtd_theme
test
:
test
:
imports
:
imports
:
-
{{
name
}}
-
{{
name
}}
commands
:
commands
:
-
nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
-
sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc sphinx
-
sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc sphinx
-
if [ -n "${CI_PROJECT_DIR}" ]; then mv sphinx "${CI_PROJECT_DIR}/"; fi
-
if [ -n "${CI_PROJECT_DIR}" ]; then mv sphinx "${CI_PROJECT_DIR}/"; fi
-
sphinx-build -aEb doctest ${PREFIX}/share/doc/{{ name }}/doc sphinx
-
sphinx-build -aEb doctest ${PREFIX}/share/doc/{{ name }}/doc sphinx
# runs tests for package only, report only what is in the package
# creates html and xml reports and place them in specific directories
-
pytest --verbose --cov {{ name }} --cov-report term-missing --cov-report html:{{ project_dir }}/sphinx/coverage --cov-report xml:{{ project_dir }}/coverage.xml --pyargs {{ name }}
-
conda inspect linkages -p $PREFIX {{ name }}
# [not win]
-
conda inspect linkages -p $PREFIX {{ name }}
# [not win]
-
conda inspect objects -p $PREFIX {{ name }}
# [osx]
-
conda inspect objects -p $PREFIX {{ name }}
# [osx]
requires
:
-
nose
-
coverage
-
sphinx
-
sphinx_rtd_theme
about
:
about
:
home
:
https://www.idiap.ch/software/bob/
home
:
https://www.idiap.ch/software/bob/
...
...
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