From 5b426a97c8fc470d9e2b8ba2cabe22ed89c05034 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 13:37:32 -0600 Subject: [PATCH 1/8] Update .travis.yml to use ci_check_code script --- .travis.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 75742eff..b75025fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,26 +2,18 @@ language: python python: - 3.6 - 3.7 -before_install: + - 3.8 +install: ## courtesy of http://conda.pydata.org/docs/travis.html - - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then - wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; - else - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - fi + - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - hash -r - conda config --set always_yes yes --set changeps1 no - conda update --yes conda - conda info -a -install: - - conda config --add channels conda-forge - - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION obspy pycurl black pytest pytest-cov webtest pydantic openpyxl - - source activate test-environment - - pip install authlib flask flask-login flask-migrate flask-session flask-sqlalchemy psycopg2-binary script: - - black --check . - - pytest + - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION + - scripts/ci_check_code.sh after_success: - bash <(curl -s https://codecov.io/bash) -- GitLab From 70789975cab4df522b44e313a0a8b96f626d823e Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 14:31:34 -0600 Subject: [PATCH 2/8] Add which python check to ci_check_code --- scripts/ci_check_code.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci_check_code.sh b/scripts/ci_check_code.sh index d0921c65..5bba50af 100755 --- a/scripts/ci_check_code.sh +++ b/scripts/ci_check_code.sh @@ -13,7 +13,7 @@ conda config --add channels conda-forge conda install python=${PYTHON_VERSION} obspy pycurl pip install pipenv pipenv --site-packages install --dev --pre --skip-lock - +pipenv run which python # Run Code Checks pipenv run black --check . pipenv run pytest --cov-report xml:cov.xml --cov=geomagio -- GitLab From 5f83d1c55ddc11304841e1831b696dfbb6d79a40 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 15:06:23 -0600 Subject: [PATCH 3/8] add activate call to load conda --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index b75025fa..d5b3fe6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,11 @@ install: - conda update --yes conda - conda info -a script: + # activate conda environment + - source activate + # pass PYTHON_VERSION to check code script - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION + # run linting and tests - scripts/ci_check_code.sh after_success: - bash <(curl -s https://codecov.io/bash) -- GitLab From aea4f2a28ec4f555eb22324e5d5236f11c6e9885 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 15:33:44 -0600 Subject: [PATCH 4/8] Use conda activate --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d5b3fe6a..dd939c57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: - conda info -a script: # activate conda environment - - source activate + - conda activate # pass PYTHON_VERSION to check code script - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # run linting and tests -- GitLab From 4b85b8da133d43413c876f31ea79258d927e0780 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 15:53:42 -0600 Subject: [PATCH 5/8] Try PIPENV_PYTHON environment variable --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd939c57..7a75700e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ install: - conda update --yes conda - conda info -a script: - # activate conda environment - - conda activate + # point pipenv to conda + - export PIPENV_PYTHON=$HOME/miniconda/bin/python # pass PYTHON_VERSION to check code script - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # run linting and tests -- GitLab From a2d4fca3c6474861a1d8b66cf9234bb2583d400f Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 16:15:05 -0600 Subject: [PATCH 6/8] Try deactivating travis environment --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a75700e..9409d1dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,9 @@ install: - conda update --yes conda - conda info -a script: - # point pipenv to conda - - export PIPENV_PYTHON=$HOME/miniconda/bin/python + # use conda + - source ~/virtualenv/python3.7/bin/deactivate + - source $HOME/miniconda/bin/activate base # pass PYTHON_VERSION to check code script - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # run linting and tests -- GitLab From 41656858c0e847a0f37e01ffc8bd379aae54b5f1 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 16:43:27 -0600 Subject: [PATCH 7/8] Switch to travis minimal container --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9409d1dc..e85467a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ -language: python -python: - - 3.6 - - 3.7 - - 3.8 +language: minimal +# run in container +arch: arm64 +dist: focal +env: + - PYTHON_VERSION=3.6 + - PYTHON_VERSION=3.7 + - PYTHON_VERSION=3.8 install: ## courtesy of http://conda.pydata.org/docs/travis.html - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh @@ -13,9 +16,6 @@ install: - conda update --yes conda - conda info -a script: - # use conda - - source ~/virtualenv/python3.7/bin/deactivate - - source $HOME/miniconda/bin/activate base # pass PYTHON_VERSION to check code script - export PYTHON_VERSION=$TRAVIS_PYTHON_VERSION # run linting and tests -- GitLab From 0aa003a7d039288a6d8e08b14f620691b350ebf5 Mon Sep 17 00:00:00 2001 From: Jeremy Fee <jmfee@usgs.gov> Date: Wed, 21 Oct 2020 16:46:28 -0600 Subject: [PATCH 8/8] Use amd64 arch for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e85467a3..3c5ff775 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: minimal # run in container -arch: arm64 +arch: amd64 dist: focal env: - PYTHON_VERSION=3.6 -- GitLab