Skip to content

Commit

Permalink
First attempt to release a new version for py39.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndilalla committed Jun 22, 2022
1 parent 8100ce6 commit f826de3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 73 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -57,38 +58,40 @@ 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
shell: bash -l {0}
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
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
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
Expand All @@ -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
Expand All @@ -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
Expand Down
26 changes: 9 additions & 17 deletions build_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -86,26 +77,27 @@ 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
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..."
Expand Down
20 changes: 11 additions & 9 deletions conda_recipe/xspec-modelsonly/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
45 changes: 13 additions & 32 deletions conda_recipe/xspec-modelsonly/meta.yaml
Original file line number Diff line number Diff line change
@@ -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/

0 comments on commit f826de3

Please sign in to comment.