Skip to content

Commit

Permalink
Re-enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayP13 committed Nov 5, 2018
1 parent 1c7830e commit 68708fb
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 86 deletions.
164 changes: 81 additions & 83 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,92 +39,90 @@ Lint:
Test Python 2:
stage: Test
script:
- echo pass
# - apt-get install python-pip -y
# - pip2 install torch\>=0.4.1 # This is not in requirements.txt so must be installed like this
# - pip2 install -U pip setuptools
# - python2 setup.py install
# - pip install gensim
# - wget --quiet http://magnitude.plasticity.ai/word2vec/light/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.light.magnitude
# - wget --quiet http://magnitude.plasticity.ai/word2vec/medium/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.medium.magnitude
# - wget --quiet http://magnitude.plasticity.ai/word2vec/heavy/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.heavy.magnitude
# - python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude
# - python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o w2v.magnitude
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s -a
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -s
# - python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -a
# - ls
# - python2 -m tests.tests -i GoogleNews-vectors-negative300.light.magnitude -s GoogleNews-vectors-negative300.medium.magnitude -a GoogleNews-vectors-negative300.heavy.magnitude -- -v
- apt-get install python-pip -y
- pip2 install torch\>=0.4.1 # This is not in requirements.txt so must be installed like this
- pip2 install -U pip setuptools
- python2 setup.py install
- pip install gensim
- wget --quiet http://magnitude.plasticity.ai/word2vec/light/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.light.magnitude
- wget --quiet http://magnitude.plasticity.ai/word2vec/medium/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.medium.magnitude
- wget --quiet http://magnitude.plasticity.ai/word2vec/heavy/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.heavy.magnitude
- python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude
- python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/word2vec.bin -o w2v.magnitude
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s -a
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -s
- python2 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -a
- ls
- python2 -m tests.tests -i GoogleNews-vectors-negative300.light.magnitude -s GoogleNews-vectors-negative300.medium.magnitude -a GoogleNews-vectors-negative300.heavy.magnitude -- -v

Test Python 3:
stage: Test
script:
- echo pass
# - apt-get install build-essential -y
# - apt-get install libffi-dev libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev -y
# - apt-get install libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev -y
# - wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
# - tar xf Python-3.7.1.tar.xz
# - cd Python-3.7.1 && ./configure --enable-shared && make -j 8 && make altinstall && cd ../
# - echo $(pwd)/Python-3.7.1
# - ls $(pwd)/Python-3.7.1
# - export LD_LIBRARY_PATH=$(pwd)/Python-3.7.1:$LD_LIBRARY_PATH
# - echo $LD_LIBRARY_PATH
# - curl https://bootstrap.pypa.io/get-pip.py | python3.7
# - python3.7 -m pip install torch\>=0.4.1 # This is not in requirements.txt so must be installed like this
# - python3.7 -m pip install -U wheel setuptools # TEMP: removing upgrading of pip here, because the newest one is broken for Python 3
# - python3.7 setup.py install
# - python3.7 -m pip install gensim
# - wget --quiet http://magnitude.plasticity.ai/word2vec/light/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.light.magnitude
# - wget --quiet http://magnitude.plasticity.ai/word2vec/medium/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.medium.magnitude
# - wget --quiet http://magnitude.plasticity.ai/word2vec/heavy/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.heavy.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o w2v.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s -a
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -s
# - python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -a
# - ls
# - python3.7 -m tests.tests -i GoogleNews-vectors-negative300.light.magnitude -s GoogleNews-vectors-negative300.medium.magnitude -a GoogleNews-vectors-negative300.heavy.magnitude -- -v
- apt-get install build-essential -y
- apt-get install libffi-dev libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev -y
- apt-get install libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev -y
- wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
- tar xf Python-3.7.1.tar.xz
- cd Python-3.7.1 && ./configure --enable-shared && make -j 8 && make altinstall && cd ../
- echo $(pwd)/Python-3.7.1
- ls $(pwd)/Python-3.7.1
- export LD_LIBRARY_PATH=$(pwd)/Python-3.7.1:$LD_LIBRARY_PATH
- echo $LD_LIBRARY_PATH
- curl https://bootstrap.pypa.io/get-pip.py | python3.7
- python3.7 -m pip install torch\>=0.4.1 # This is not in requirements.txt so must be installed like this
- python3.7 -m pip install -U wheel setuptools # TEMP: removing upgrading of pip here, because the newest one is broken for Python 3
- python3.7 setup.py install
- python3.7 -m pip install gensim
- wget --quiet http://magnitude.plasticity.ai/word2vec/light/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.light.magnitude
- wget --quiet http://magnitude.plasticity.ai/word2vec/medium/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.medium.magnitude
- wget --quiet http://magnitude.plasticity.ai/word2vec/heavy/GoogleNews-vectors-negative300.magnitude -O GoogleNews-vectors-negative300.heavy.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.txt -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/glove.txt -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/fasttext.vec -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/zero.txt -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/large.txt -o out.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/word2vec.bin -o w2v.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -s -a
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -s
- python3.7 -m pymagnitude.converter -i tests/models/elmo_weights.hdf5 -o elmo.magnitude -v w2v.magnitude -a
- ls
- python3.7 -m tests.tests -i GoogleNews-vectors-negative300.light.magnitude -s GoogleNews-vectors-negative300.medium.magnitude -a GoogleNews-vectors-negative300.heavy.magnitude -- -v

Deploy to PyPI:
stage: Deploy to PyPI
Expand Down Expand Up @@ -176,7 +174,7 @@ Deploy Linux Wheels:
- echo "[default]" >> /.awsstore/credentials
- echo "aws_access_key_id = $AWS_ACCESS_KEY_ID" >> /.awsstore/credentials
- echo "aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" >> /.awsstore/credentials
- eval "copytocibuildwheel() { export CIBUILDWHEEL_CONTAINER=\$(docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Image}}' | grep 'quay.io/pypa/manylinux1' | head -n1 | awk '{print \$2}') && docker cp $CI_PROJECT_DIR/. \$CIBUILDWHEEL_CONTAINER:/project && docker exec \$CIBUILDWHEEL_CONTAINER mkdir -p /root/.aws && docker cp /.awsstore/credentials \$CIBUILDWHEEL_CONTAINER:/root/.aws/credentials; }"
- eval "copytocibuildwheel() { export CIBUILDWHEEL_CONTAINER=\$(docker ps --format 'table {{.ID}}\t{{.Names}}\t{{.Image}}' | grep 'quay.io/pypa/manylinux1' | head -n1 | awk '{print \$2}') && (docker cp $CI_PROJECT_DIR/. \$CIBUILDWHEEL_CONTAINER:/project || true) && docker exec \$CIBUILDWHEEL_CONTAINER mkdir -p /root/.aws && docker cp /.awsstore/credentials \$CIBUILDWHEEL_CONTAINER:/root/.aws/credentials; }"
- eval "repeatcopytocibuildwheel() { while sleep 1; do copytocibuildwheel || true; done }"
- export -f copytocibuildwheel
- export -f repeatcopytocibuildwheel
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ def install_wheel(whl):
]
rc = subprocess.Popen(whl_args + [whl]).wait()
if rc != 0:
print("Installing to user site packages...")
try:
import site
if hasattr(site, 'getusersitepackages'):
site_packages = site.getusersitepackages()
print("Installing to user site packages...", site_packages)
rc = subprocess.Popen(
whl_args + ["--install-option=\"--install-lib=" + site_packages + "\""] +
whl_args + ["--install-option=--install-lib=" + site_packages] +
[whl]
).wait()
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ('0', '1', '102')
__version_info__ = ('0', '1', '103')
__version__ = '.'.join(__version_info__)

0 comments on commit 68708fb

Please sign in to comment.