Skip to content
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

use environments.yml to setup for travis-ci #370

Closed
prjemian opened this issue Jul 18, 2020 · 8 comments · Fixed by #371
Closed

use environments.yml to setup for travis-ci #370

prjemian opened this issue Jul 18, 2020 · 8 comments · Fixed by #371
Assignees
Milestone

Comments

@prjemian
Copy link
Contributor

prjemian commented Jul 18, 2020

The current setup for travis uses conda, then pip. The pip part creates wheels which duplicate much of the conda setup. Use the existing environment.yml file (created for RTD) to setup for travis-ci.

Example: https://travis-ci.org/github/BCDA-APS/apstools/jobs/709523510#L185

@prjemian prjemian added this to the 1.3.1 milestone Jul 18, 2020
@prjemian prjemian self-assigned this Jul 18, 2020
@prjemian
Copy link
Contributor Author

Looking at Line 185 (from above), a pip installation happens BEFORE the miniconda is downloaded and then installed.

@prjemian
Copy link
Contributor Author

Here is how to create a new conda environment using the environment.yml file:

conda env create -n test -f environment.yml

How to specify the python version (python=$TRAVIS_PYTHON_VERSION) here?

@prjemian
Copy link
Contributor Author

this does not work

conda env create -n test python=$TRAVIS_PYTHON_VERSION -f environment.yml

Need a CI version of environment.yml that has no python version listed.

@prjemian
Copy link
Contributor Author

Nope, still gets python 3.8:

(bluesky_2020_5) prjemian@poof ~/.../projects/apstools $ conda env create -n test python=3.7 -f environment-travis.yml
Collecting package metadata (repodata.json): done
Solving environment: done
Preparing transaction: done
Verifying transaction: |
SafetyError: The package for pyqt located at /home/prjemian/Apps/anaconda/pkgs/pyqt-5.9.2-py38h05f1152_4
appears to be corrupted. The path 'plugins/designer/libpyqt5.so'
has an incorrect size.
  reported size: 35656 bytes
  actual size: 35664 bytes

ClobberError: This transaction has incompatible packages due to a shared path.
  packages: defaults/linux-64::python-3.8.3-hcff3b4d_2, defaults/linux-64::markupsafe-1.1.1-py38h7b6447c_0, defaults/linux-64::pymongo-3.9.0-py38he6710b0_0, defaults/linux-64::pyqt-5.9.2-py38h05f1152_4
  path: 'lib/python3.8/__pycache__/_sysconfigdata_x86_64_conda_cos6_linux_gnu.cpython-38.pyc'
# ... installation
(bluesky_2020_5) prjemian@poof ~/.../projects/apstools $ conda list -n test python
# packages in environment at /home/prjemian/Apps/anaconda/envs/test:
#
# Name                    Version                   Build  Channel
ipython                   7.16.1           py38h5ca1d4c_0
ipython_genutils          0.2.0                    py38_0
msgpack-python            1.0.0            py38hfd86e86_1
python                    3.8.3                hcff3b4d_2
python-dateutil           2.8.1                      py_0
python_abi                3.8                      1_cp38    conda-forge

@prjemian
Copy link
Contributor Author

Need to edit the environment.yml file with the python=$TRAVIS_PYTHON_VERSION requirement.

@prjemian
Copy link
Contributor Author

Like this:

cp environment.yml environment-travis.yml
sed -i s:python\>=3.6.0:python=\$\{TRAVIS_PYTHON_VERSION\}:g environment-travis.yml

@prjemian
Copy link
Contributor Author

Before this change, remove the first pip installation.

prjemian added a commit that referenced this issue Jul 18, 2020
prjemian added a commit that referenced this issue Jul 18, 2020
@prjemian
Copy link
Contributor Author

Wow! Cut the travis-ci test time in half!

prjemian added a commit that referenced this issue Jul 18, 2020
prjemian added a commit that referenced this issue Jul 18, 2020
prjemian added a commit that referenced this issue Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant