-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Travis fix and distinct testing #1522
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f624079
add installation script for env
menshikh-iv b727d01
Add run script for test/codestyle
menshikh-iv 8dc1c81
modify travis file
menshikh-iv bdc5425
fix misprints
menshikh-iv 29f5613
add pytest
menshikh-iv e84b220
Add basic version checking
menshikh-iv 238515b
try to fix FAST_VERSION==-1
menshikh-iv 0d030eb
try to fix FAST_VERSION==-1[2]
menshikh-iv 320b069
remove debug info
menshikh-iv 6fa4cdd
fix flake8 problems with ignore list
menshikh-iv 03d6903
continue with flake (break pep8 in matutils)
menshikh-iv 01794ec
fix regexp for grep
menshikh-iv 3a6a7ec
restore matutils
menshikh-iv 2431dd6
echo files for flake8
menshikh-iv f7fb4f2
Add ipynb checking
menshikh-iv e37c51f
special mistakes in .ipynb for testing purposes
menshikh-iv 41e3fb6
Distinct file checking for ipynb
menshikh-iv 3dc3ab4
Merge branch 'develop' into travis-fix-and-distinct-testing
menshikh-iv 074bb03
remove mistakes from notebooks
menshikh-iv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,22 @@ | ||
sudo: false | ||
|
||
cache: | ||
apt: true | ||
directories: | ||
- $HOME/.cache/pip | ||
- $HOME/.ccache | ||
|
||
dist: trusty | ||
language: python | ||
python: | ||
- "2.7" | ||
- "3.5" | ||
- "3.6" | ||
before_install: | ||
- wget 'http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh' -O miniconda.sh | ||
- chmod +x miniconda.sh | ||
- ./miniconda.sh -b | ||
- export PATH=/home/travis/miniconda2/bin:$PATH | ||
- conda update --yes conda | ||
install: | ||
- conda create --yes -n gensim-test python=$TRAVIS_PYTHON_VERSION pip atlas numpy==1.11.3 scipy==0.18.1 | ||
- source activate gensim-test | ||
- python setup.py install | ||
- pip install .[test] | ||
script: | ||
- pip freeze | ||
- python setup.py test | ||
- pip install flake8 | ||
- continuous_integration/travis/flake8_diff.sh | ||
|
||
|
||
matrix: | ||
include: | ||
- env: PYTHON_VERSION="2.7" NUMPY_VERSION="1.11.3" SCIPY_VERSION="0.18.1" ONLY_CODESTYLE="yes" | ||
- env: PYTHON_VERSION="2.7" NUMPY_VERSION="1.11.3" SCIPY_VERSION="0.18.1" ONLY_CODESTYLE="no" | ||
- env: PYTHON_VERSION="3.5" NUMPY_VERSION="1.11.3" SCIPY_VERSION="0.18.1" ONLY_CODESTYLE="no" | ||
- env: PYTHON_VERSION="3.6" NUMPY_VERSION="1.11.3" SCIPY_VERSION="0.18.1" ONLY_CODESTYLE="no" | ||
|
||
|
||
install: source continuous_integration/travis/install.sh | ||
script: bash continuous_integration/travis/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,7 +118,13 @@ echo '-------------------------------------------------------------------------- | |
# Excluding vec files since they contain non-utf8 content and flake8 raises exception for non-utf8 input | ||
# We need the following command to exit with 0 hence the echo in case | ||
# there is no match | ||
MODIFIED_FILES="$(git diff --name-only $COMMIT_RANGE -- . ':(exclude)*.vec' || echo "no_match")" | ||
MODIFIED_PY_FILES="$(git diff --name-only $COMMIT_RANGE | grep '[a-zA-Z0-9]*.py$' || echo "no_match")" | ||
MODIFIED_IPYNB_FILES="$(git diff --name-only $COMMIT_RANGE | grep '[a-zA-Z0-9]*.ipynb$' || echo "no_match")" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why have this at all? I don't see any tests performed on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add it soon, it's "preparation" for testing |
||
|
||
|
||
echo "*.py files: " $MODIFIED_PY_FILES | ||
echo "*.ipynb files: " $MODIFIED_IPYNB_FILES | ||
|
||
|
||
check_files() { | ||
files="$1" | ||
|
@@ -131,9 +137,19 @@ check_files() { | |
fi | ||
} | ||
|
||
if [[ "$MODIFIED_FILES" == "no_match" ]]; then | ||
echo "No file has been modified" | ||
if [[ "$MODIFIED_PY_FILES" == "no_match" ]]; then | ||
echo "No .py files has been modified" | ||
else | ||
check_files "$(echo "$MODIFIED_FILES" )" "--ignore=E501,E731,E12,W503 --exclude=*.sh,*.md,*.yml,*.rst,*.ipynb,*.txt,*.csv,*.vec,Dockerfile*,*.c,*.pyx,*.inc,*.html" | ||
check_files "$(echo "$MODIFIED_PY_FILES" )" "--ignore=E501,E731,E12,W503" | ||
fi | ||
echo -e "No problem detected by flake8\n" | ||
|
||
if [[ "$MODIFIED_IPYNB_FILES" == "no_match" ]]; then | ||
echo "No .ipynb file has been modified" | ||
else | ||
for fname in ${MODIFIED_IPYNB_FILES} | ||
do | ||
echo "File: $fname" | ||
jupyter nbconvert --to script --stdout $fname | flake8 - --show-source --ignore=E501,E731,E12,W503,E402 --builtins=get_ipython || true | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
deactivate | ||
wget 'http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh' -O miniconda.sh | ||
chmod +x miniconda.sh && ./miniconda.sh -b | ||
export PATH=/home/travis/miniconda2/bin:$PATH | ||
conda update --yes conda | ||
|
||
|
||
conda create --yes -n gensim-test python=$PYTHON_VERSION pip atlas flake8 jupyter numpy==$NUMPY_VERSION scipy==$SCIPY_VERSION && source activate gensim-test | ||
pip install . && pip install .[test] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
pip freeze | ||
|
||
if [[ "$ONLY_CODESTYLE" == "yes" ]]; then | ||
continuous_integration/travis/flake8_diff.sh | ||
else | ||
python setup.py test | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -468,4 +468,4 @@ | |
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need this line in the new
script.sh
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because I already add it in install script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I missed that, sorry.