From f826de35799e7eb4190e4858948b63eba4e32962 Mon Sep 17 00:00:00 2001 From: ndilalla Date: Wed, 22 Jun 2022 14:50:40 -0700 Subject: [PATCH] First attempt to release a new version for py39. --- .github/workflows/test_and_build.yml | 36 +++++++++++--------- build_local.sh | 26 +++++--------- conda_recipe/xspec-modelsonly/build.sh | 20 ++++++----- conda_recipe/xspec-modelsonly/meta.yaml | 45 +++++++------------------ 4 files changed, 54 insertions(+), 73 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index b52e99c..79a6d74 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -26,8 +26,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-latest] - python-version: [3.7] + os: [ubuntu-20.04, macos-10.15] + python-version: [3.9] steps: - uses: actions/checkout@v2 @@ -45,8 +45,9 @@ jobs: with: activate-environment: "test_env" auto-activate-base: false + mamba-version: "*" architecture: "x64" - conda-build-version: 3.20.2 + #conda-build-version: 3.20.2 python-version: ${{ matrix.python-version }} auto-update-conda: true environment-file: ci/environment.yml @@ -57,21 +58,23 @@ jobs: echo "HOME= ${HOME}" echo "Python version: ${{matrix.python-version}}" echo "======> getting the file..." - if ! [ -f heasoft-6.25src.tar.gz ]; then - curl -LO -z heasoft-6.25src.tar.gz https://www.dropbox.com/s/zw6giglocr1z3o0/heasoft-6.25src.tar.gz + if ! [ -f heasoft-6.30.1src.tar.gz ]; then + curl -LO -z heasoft-6.30.1src.tar.gz https://www.dropbox.com/s/sv6ge6libcxfvas/heasoft-6.30.1src.tar.gz fi - name: Build the Distribution shell: bash -l {0} run: | # Build package + + conda install -c conda-forge boa -n base if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then - conda build --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly + conda mambabuild --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly else # there is some strange error about the prefix length - conda build --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly + conda mambabuild --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly fi - name: Intall the Package @@ -79,7 +82,7 @@ jobs: run: | conda install --use-local -c conda-forge xspec-modelsonly echo "======> dependency list..." - conda search xspec-modelsonly=6.25 --use-local --info + conda search xspec-modelsonly=6.30.1 --use-local --info publish-conda: name: Publish to Conda @@ -87,8 +90,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] - python-version: [3.7] + os: [ubuntu-20.04, macos-10.15] + python-version: [3.9] steps: - uses: actions/checkout@v2 @@ -106,8 +109,9 @@ jobs: with: activate-environment: "test_env" auto-activate-base: false + mamba-version: "*" architecture: "x64" - conda-build-version: 3.20.2 + #conda-build-version: 3.20.2 python-version: ${{ matrix.python-version }} auto-update-conda: true environment-file: ci/environment.yml @@ -119,21 +123,23 @@ jobs: echo "HOME= ${HOME}" echo "Python version: ${{matrix.python-version}}" echo "======> getting the file..." - if ! [ -f heasoft-6.25src.tar.gz ]; then - curl -LO -z heasoft-6.25src.tar.gz https://www.dropbox.com/s/zw6giglocr1z3o0/heasoft-6.25src.tar.gz + if ! [ -f heasoft-6.30.1src.tar.gz ]; then + curl -LO -z heasoft-6.30.1src.tar.gz https://www.dropbox.com/s/sv6ge6libcxfvas/heasoft-6.30.1src.tar.gz fi - name: Build the Distribution shell: bash -l {0} run: | # Build package + + conda install -c conda-forge boa -n base if [[ "${{matrix.os}}" == "ubuntu-latest" ]]; then - conda build --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly + conda mambabuild --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly else # there is some strange error about the prefix length - conda build --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly + conda mambabuild --no-build-id --python=${{matrix.python-version}} conda_recipe/xspec-modelsonly fi - name: Publish to Conda diff --git a/build_local.sh b/build_local.sh index 9655376..1ee63dc 100755 --- a/build_local.sh +++ b/build_local.sh @@ -3,7 +3,7 @@ set -e # FROM TRAVIS: TRAVIS_OS_NAME="unknown" -TRAVIS_PYTHON_VERSION=3.7 +TRAVIS_PYTHON_VERSION=3.9 TRAVIS_EVENT_TYPE="push" #TRAVIS_BRANCH="master" TRAVIS_BRANCH="no_master" @@ -41,8 +41,6 @@ fi # Build and test... # FLAGS AND ENVIRONMENT: -LIBGFORTRAN_VERSION="3.0" -READLINE_VERSION="6.2" UPDATE_CONDA=false ENVNAME=xsmodelsonly_test_$TRAVIS_PYTHON_VERSION @@ -57,13 +55,7 @@ if $UPDATE_CONDA ; then conda update --yes -q conda conda-build fi -if [[ ${TRAVIS_PYTHON_VERSION} == 2.7 ]]; -then - READLINE="readline=${READLINE_VERSION}" - conda_channel=conda-forge/label/cf201901 -else - conda_channel=conda-forge -fi +conda_channel=conda-forge # Answer yes to all questions (non-interactive) conda config --set always_yes true @@ -75,7 +67,6 @@ conda config --set anaconda_upload no echo " ======================> Creating the test environment..." conda create --yes --name $ENVNAME -c $conda_channel python=$TRAVIS_PYTHON_VERSION ${READLINE} -#libgfortran=${LIBGFORTRAN_VERSION} # Make sure conda-forge is the first channel conda config --add channels $conda_channel @@ -86,13 +77,12 @@ conda config --add channels $conda_channel echo "=====================> Activate test environment..." source $CONDA_PREFIX/etc/profile.d/conda.sh -#source /home/ndilalla/work/fermi/miniconda3/etc/profile.d/conda.sh +#source /home/ndilalla/work/miniconda3/etc/profile.d/conda.sh conda activate $ENVNAME echo "======> getting the file..." -if ! [ -f heasoft-6.25src.tar.gz ]; then -# curl -LO -z xspec-modelsonly-v6.22.1.tar.gz https://heasarc.gsfc.nasa.gov/FTP/software/lheasoft/lheasoft6.22.1/xspec-modelsonly-v6.22.1.tar.gz - curl -LO -z heasoft-6.25src.tar.gz https://www.dropbox.com/s/zw6giglocr1z3o0/heasoft-6.25src.tar.gz +if ! [ -f heasoft-6.30.1src.tar.gz ]; then + curl -LO -z heasoft-6.30.1src.tar.gz https://www.dropbox.com/s/sv6ge6libcxfvas/heasoft-6.30.1src.tar.gz fi # Build package @@ -100,12 +90,14 @@ echo "Build package..." #conda install conda-verify +conda install -c conda-forge boa -n base + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - conda build --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly + conda mambabuild --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly #conda index $HOME/miniconda/conda-bld else # there is some strange error about the prefix length - conda build --no-build-id --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly + conda mambabuild --no-build-id --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly #conda index $HOME/miniconda/conda-bld fi echo "======> installing..." diff --git a/conda_recipe/xspec-modelsonly/build.sh b/conda_recipe/xspec-modelsonly/build.sh index 991bbdc..f852c23 100644 --- a/conda_recipe/xspec-modelsonly/build.sh +++ b/conda_recipe/xspec-modelsonly/build.sh @@ -2,26 +2,26 @@ echo "=================" echo $PWD echo $RECIPE_DIR -tar xf heasoft-6.25src.tar.gz +tar xf heasoft-6.30.1src.tar.gz CWD="$PWD" -XSPEC_PATCH="Xspatch_121001l.tar.gz" -XSPEC_PATCH_INSTALLER="patch_install_4.10.tcl" -XSPEC_MODELS_ONLY=heasoft-6.25 +XSPEC_PATCH="Xspatch_121201c.tar.gz" +XSPEC_PATCH_INSTALLER="patch_install_4.15.tcl" +XSPEC_MODELS_ONLY=heasoft-6.30.1 # If a patch is required, download the necessary file and apply it if [ -n "$XSPEC_PATCH" ] then cd ${XSPEC_MODELS_ONLY}/Xspec/src; - curl -LO -z ${XSPEC_PATCH} http://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/issues/archive/${XSPEC_PATCH}; + curl -LO -z ${XSPEC_PATCH} https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/issues/archive/${XSPEC_PATCH}; curl -LO -z ${XSPEC_PATCH_INSTALLER} https://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/issues/archive/${XSPEC_PATCH_INSTALLER}; tclsh ${XSPEC_PATCH_INSTALLER} -m -n; - rm -rf XSFits; + #rm -rf XSFits; cd ${CWD}; fi #Copy in the OGIPTable fix -cp $RECIPE_DIR/../../OGIPTable.cxx heasoft-6.25/Xspec/src/XSModel/Model/Component/OGIPTable +#cp $RECIPE_DIR/../../OGIPTable.cxx heasoft-6.25/Xspec/src/XSModel/Model/Component/OGIPTable cd ${XSPEC_MODELS_ONLY}/BUILD_DIR @@ -82,7 +82,9 @@ echo "LEAVE IT HERE" > ${PREFIX}/lib/Xspec/headas/DO_NOT_REMOVE cp -rv ${SRC_DIR}/xspec-modelsonly-build/spectral ${PREFIX}/lib/Xspec mkdir -p ${PREFIX}/include +mkdir -p ${PREFIX}/include/XSFunctions +mkdir -p ${PREFIX}/include/XSFunctions/Utilities -cp -L ${SRC_DIR}/xspec-modelsonly-build/x86*/include/xsFortran.h ${PREFIX}/include +cp -L ${SRC_DIR}/xspec-modelsonly-build/Xspec/x86*/include/XSFunctions/Utilities/xsFortran.h ${PREFIX}/include/XSFunctions/Utilities cp -L ${SRC_DIR}/xspec-modelsonly-build/x86*/include/xsTypes.h ${PREFIX}/include -cp -L ${SRC_DIR}/xspec-modelsonly-build/x86*/include/funcWrappers.h ${PREFIX}/include +cp -L ${SRC_DIR}/xspec-modelsonly-build/Xspec/x86*/include/XSFunctions/funcWrappers.h ${PREFIX}/include/XSFunctions diff --git a/conda_recipe/xspec-modelsonly/meta.yaml b/conda_recipe/xspec-modelsonly/meta.yaml index cf310c9..3955d18 100644 --- a/conda_recipe/xspec-modelsonly/meta.yaml +++ b/conda_recipe/xspec-modelsonly/meta.yaml @@ -1,53 +1,34 @@ package: name: xspec-modelsonly - version: "6.25" + version: "6.30.1" source: - # md5: 0abea9e1609fcdc2c3e3ada92043d17b - # url: https://heasarc.gsfc.nasa.gov/FTP/software/lheasoft/lheasoft6.22.1/xspec-modelsonly-v6.22.1.tar.gz - #path: ../../xspec-modelsonly-v6.22.1.tar.gz - path: ../../heasoft-6.25src.tar.gz - #fn: xspec-modelsonly-v6.22.1.tar.gz + path: ../../heasoft-6.30.1src.tar.gz build: - number: 1 # [py2k] number: 3 # [py3k] requirements: build: - #- ccfits==2.5 # [py2k] - - cfitsio==3.410 # [py2k] - gfortran_osx-64 # [osx] #- {{ compiler('c') }} # [linux] #- {{ compiler('cxx') }} # [linux] - {{ compiler('fortran') }} # [linux] - - libgfortran>=3.0,<4.0 # [osx] - - libgfortran-ng==7.5.0 # [linux] - - ncurses==5.9 # [py2k] - - ncurses # [py3k] - - readline==6.2 # [py2k] - - readline # [py3k] - - toolchain==2.1.2 # [py2k] - - wcslib==5.18 # [py2k] - - curl # [py3k] - - perl # [py3k] + #- libgfortran>=3.0,<4.0 # [osx] + #- libgfortran-ng==7.5.0 # [linux] + - ncurses + - readline + - curl + - perl host: - - ncurses==5.9 # [py2k] - - ncurses # [py3k] - - readline==6.2 # [py2k] - - readline # [py3k] + - ncurses + - readline run: - - ccfits==2.5 # [py2k] - - cfitsio==3.410 # [py2k] - - cfitsio==3.470 # [py3k] - - wcslib==5.18 # [py2k] - - libgfortran # [py2k] - - ncurses==5.9 # [py2k] - - ncurses # [py3k] - - readline==6.2 # [py2k] - - readline # [py3k] + - cfitsio + - ncurses + - readline about: home: https://heasarc.gsfc.nasa.gov/xanadu/xspec/