Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Show more breadcrumbs
yoogottamk
Flatland
Commits
6e1eac6f
Commit
6e1eac6f
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
#57 run tests, examples, notebooks from other directory
parent
f51c77cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
setup.py
+9
-1
9 additions, 1 deletion
setup.py
tox.ini
+9
-6
9 additions, 6 deletions
tox.ini
with
18 additions
and
7 deletions
setup.py
+
9
−
1
View file @
6e1eac6f
...
@@ -68,6 +68,14 @@ def get_all_svg_files(directory='./svg/'):
...
@@ -68,6 +68,14 @@ def get_all_svg_files(directory='./svg/'):
return
ret
return
ret
def
get_all_images_files
(
directory
=
'
./images/
'
):
ret
=
[]
for
f
in
os
.
listdir
(
directory
):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
directory
,
f
)):
ret
.
append
(
directory
+
f
)
return
ret
# Gather requirements from requirements_dev.txt
# Gather requirements from requirements_dev.txt
install_reqs
=
[]
install_reqs
=
[]
requirements_path
=
'
requirements_dev.txt
'
requirements_path
=
'
requirements_dev.txt
'
...
@@ -103,7 +111,7 @@ setup(
...
@@ -103,7 +111,7 @@ setup(
keywords
=
'
flatland
'
,
keywords
=
'
flatland
'
,
name
=
'
flatland-rl
'
,
name
=
'
flatland-rl
'
,
packages
=
find_packages
(
'
.
'
),
packages
=
find_packages
(
'
.
'
),
data_files
=
[(
'
svg
'
,
get_all_svg_files
())],
data_files
=
[(
'
svg
'
,
get_all_svg_files
())
,
(
'
images
'
,
get_all_images_files
())
],
setup_requires
=
setup_requirements
,
setup_requires
=
setup_requirements
,
test_suite
=
'
tests
'
,
test_suite
=
'
tests
'
,
tests_require
=
test_requirements
,
tests_require
=
test_requirements
,
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
9
−
6
View file @
6e1eac6f
...
@@ -76,10 +76,10 @@ whitelist_externals = sh
...
@@ -76,10 +76,10 @@ whitelist_externals = sh
deps
=
deps
=
-r{toxinidir}/requirements_dev.txt
-r{toxinidir}/requirements_dev.txt
commands
=
commands
=
sh
-c
'echo
DISPLAY
=
$DISPLAY'
; run examples from subfolder to ensure that resources are accessed via resources and not via relative paths
sh
-c
'
echo
XAUTHORITY
=
$XAUTHORITY
'
sh
-c
'
mkdir
-p
{envtmpdir}/c236d3c240d61a0969d4cb59e2180ce5
'
; pipe echo into python since some examples expect input to close the window after the example is run
; pipe echo into python since some examples expect input to close the window after the example is run
sh
-c
'
ls
examples/*.py
|
xargs
-I{}
-n
1
sh
-c
"echo
-e
\"\
n
=
===== Running {} ========
\n\"
; echo "q" | python {}"'
sh
-c
'
cd
{envtmpdir}/c236d3c240d61a0969d4cb59e2180ce5
&&
ls
{toxinidir}/
examples/*.py
|
xargs
-I{}
-n
1
sh
-c
"echo
-e
\"\
n
=
===== Running {} ========
\n\"
; echo "q" | python {}"'
[testenv:notebooks]
[testenv:notebooks]
basepython
=
python
basepython
=
python
...
@@ -96,11 +96,13 @@ deps =
...
@@ -96,11 +96,13 @@ deps =
-r{toxinidir}/requirements_dev.txt
-r{toxinidir}/requirements_dev.txt
-r{toxinidir}/requirements_continuous_integration.txt
-r{toxinidir}/requirements_continuous_integration.txt
commands
=
commands
=
; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths
sh
-c
'mkdir
-p
{envtmpdir}/6f59bc68108c3895b1828abdd04b9a06'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
widgetsnbextension'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
widgetsnbextension'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
jpy_canvas'
sh
-c
'jupyter
nbextension
enable
--py
--sys-prefix
jpy_canvas'
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
sh
-c
'ls
notebooks/*.ipynb
|
xargs
-n
1
jupyter
nbconvert
--to
python'
sh
-c
'ls
notebooks/*.ipynb
|
xargs
-n
1
jupyter
nbconvert
--to
python'
sh
-c
'
ls
notebooks/*.py
|
xargs
-I{}
-n
1
sh
-c
"echo
-e
\"\
n
=
===== Running {} ========
\n\"
; ipython {}"'
sh
-c
'
cd
{envtmpdir}/6f59bc68108c3895b1828abdd04b9a06
&&
ls
{toxinidir}/
notebooks/*.py
|
xargs
-I{}
-n
1
sh
-c
"echo
-e
\"\
n
=
===== Running {} ========
\n\"
; ipython {}"'
[testenv]
[testenv]
whitelist_externals
=
sh
whitelist_externals
=
sh
...
@@ -115,5 +117,6 @@ passenv =
...
@@ -115,5 +117,6 @@ passenv =
deps
=
deps
=
-r{toxinidir}/requirements_dev.txt
-r{toxinidir}/requirements_dev.txt
commands
=
commands
=
sh
-c
'echo
DISPLAY:
$DISPLAY'
; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths
py.test
--basetemp
=
{envtmpdir}
sh
-c
'mkdir
-p
{envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea'
sh
-c
'cd
{envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea
&&
py.test
--basetemp
=
{envtmpdir} {toxinidir}'
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