Skip to content

Commit

Permalink
First attempt to add python3 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndilalla committed Nov 18, 2019
1 parent 311f312 commit 8789b99
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ matrix:
- os: osx
python: 2.7
env: TRAVIS_PYTHON_VERSION=2.7
- os: linux
python: 3.7
env: TRAVIS_PYTHON_VERSION=3.7
- os: osx
python: 3.7
env: TRAVIS_PYTHON_VERSION=3.7
before_install:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
Expand Down
13 changes: 8 additions & 5 deletions ci/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if $UPDATE_CONDA ; then
conda update --yes -q conda conda-build
fi

if [[ ${TRAVIS_OS_NAME} == osx ]];
if [[ ${TRAVIS_PYTHON_VERSION} == 2.7 ]];
then
conda config --add channels $conda_channel
READLINE="readline=${READLINE_VERSION}"
fi

# Answer yes to all questions (non-interactive)
Expand All @@ -34,7 +34,7 @@ conda config --set anaconda_upload no
# Create test environment
echo " ======================> Creating the test environment..."

conda create --yes --name $ENVNAME -c $conda_channel python=$TRAVIS_PYTHON_VERSION readline=${READLINE_VERSION}
conda create --yes --name $ENVNAME -c $conda_channel python=$TRAVIS_PYTHON_VERSION ${READLINE}
#libgfortran=${LIBGFORTRAN_VERSION}

# Make sure conda-forge is the first channel
Expand Down Expand Up @@ -70,6 +70,9 @@ fi
echo "======> installing..."
conda install --use-local -c $conda_channel xspec-modelsonly

# TEMP
conda search xspec-modelsonly --use-local --info

# UPLOAD TO CONDA:
# If we are on the master branch upload to the channel
if [[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]]; then
Expand All @@ -81,9 +84,9 @@ else
conda install -c conda-forge anaconda-client
echo "Uploading..."
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
anaconda -q -t $CONDA_UPLOAD_TOKEN upload -u threeml /home/travis/miniconda/conda-bld/linux-64/*.tar.bz2 --force
anaconda -q -t $CONDA_UPLOAD_TOKEN upload -u xspecmodels /home/travis/miniconda/conda-bld/linux-64/*.tar.bz2 --force
else
anaconda -q -t $CONDA_UPLOAD_TOKEN upload -u threeml /Users/travis/miniconda/conda-bld/*/*.tar.bz2 --force
anaconda -q -t $CONDA_UPLOAD_TOKEN upload -u xspecmodels /Users/travis/miniconda/conda-bld/*/*.tar.bz2 --force
fi
fi
fi
Expand Down
12 changes: 8 additions & 4 deletions conda_recipe/xspec-modelsonly/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@ requirements:
- {{ compiler('cxx') }} # [linux]
- {{ compiler('fortran') }} # [linux]
- libgfortran>=3.0,<4.0
- ncurses==5.9
- readline==6.2
- ncurses==5.9 # [py2k]
- ncurses # [py3k]
- readline==6.2 # [py2k]
- readline # [py3k]
- toolchain==2.1.2
- wcslib==5.18
run:
- ccfits==2.5
- cfitsio==3.410
- wcslib==5.18
- libgfortran
- ncurses==5.9
- readline==6.2
- ncurses==5.9 # [py2k]
- ncurses # [py3k]
- readline==6.2 # [py2k]
- readline # [py3k]

# Note that ncurses is only needed to build but I am not
# sure it's needed at all at run-time. To keep things
Expand Down

0 comments on commit 8789b99

Please sign in to comment.