Skip to content

Commit

Permalink
add epel77/python36 rpm build and test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Nov 15, 2019
1 parent e5086c5 commit 9b256b2
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 44 deletions.
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ jobs:
environment:
PIP_FLAGS: " "

el7:3.6:
<<: *centos-build
docker:
- image: igwn/base:el7
environment:
PIP_FLAGS: " "

# -- deploy ---------------

deploy:
Expand Down Expand Up @@ -309,6 +316,9 @@ workflows:
filters:
tags:
only: /^v.*/
- el7:3.6:
requires:
- sdist

# deploy
- deploy:
Expand Down
75 changes: 33 additions & 42 deletions ci/install-el.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@

# -- setup --------------------------------------

# install basic build dependencies
yum -y -q update

yum -y -q install \
rpm-build \
yum-utils \
epel-rpm-macros

# correct issue with missing tzdata files
# https://listserv.fnal.gov/scripts/wa.exe?A2=ind1910&L=SCIENTIFIC-LINUX-USERS&P=21164
yum -y -q reinstall tzdata

# determine python prefix, even though we only install for python2

if [[ "${PYTHON_VERSION}" == "2.7" ]]; then
PY_PREFIX="python2"
else
PY_PREFIX="python${PYTHON_VERSION/./}"
PY_PREFIX="python$(rpm --eval "%python3_pkgversion")"
fi

# -- build --------------------------------------
Expand All @@ -38,17 +50,6 @@ TARBALL="$(pwd)/gwpy-*.tar.*"
mkdir build
pushd build

yum -y -q update

# correct issue with missing tzdata files
# https://listserv.fnal.gov/scripts/wa.exe?A2=ind1910&L=SCIENTIFIC-LINUX-USERS&P=21164
yum -y -q reinstall tzdata

# install basic build dependencies
yum -y -q install \
rpm-build \
yum-utils

# build src rpm
SRPM=$(rpmbuild --define "_topdir ${TOPDIR}" -ts ${TARBALL} | cut -d\ -f2)

Expand All @@ -66,38 +67,28 @@ RPM="${TOPDIR}/RPMS/noarch/${PY_PREFIX}-gwpy-*.rpm"
yum -y -q --nogpgcheck localinstall ${RPM}

# -- extras -------------------------------------
#
# This is explicitly only set up for python2.7 on RHEL7
#

# install system-level extras
yum -y -q install \
which \
python2-pip \
python2-pytest \
python2-pytest-cov \
python2-mock \
python2-freezegun \
python-sqlparse \
python-beautifulsoup4 \
python-sqlalchemy \
python2-PyMySQL \
m2crypto \
glue \
dqsegdb \
python-psycopg2 \
python-pandas \
python2-root \
python2-nds2-client \
python2-ldas-tools-framecpp \
python2-lalframe \
python2-lalsimulation \
python-ligo-lw \
${PY_PREFIX}-beautifulsoup4 \
${PY_PREFIX}-dqsegdb \
${PY_PREFIX}-freezegun \
${PY_PREFIX}-glue \
${PY_PREFIX}-lalframe \
${PY_PREFIX}-lalsimulation \
${PY_PREFIX}-ligo-lw \
${PY_PREFIX}-m2crypto \
${PY_PREFIX}-nds2-client \
${PY_PREFIX}-pandas \
${PY_PREFIX}-pip \
${PY_PREFIX}-psycopg2 \
${PY_PREFIX}-PyMySQL \
${PY_PREFIX}-pytest \
${PY_PREFIX}-pytest-cov \
${PY_PREFIX}-root \
${PY_PREFIX}-sqlparse \
${PY_PREFIX}-sqlalchemy \
texlive-dvipng-bin texlive-latex-bin-bin \
texlive-type1cm texlive-collection-fontsrecommended

# HACK: fix missing file from ldas-tools-framecpp
if [ -d /usr/lib64/${PYTHON}/site-packages/LDAStools -a \
! -f /usr/lib64/${PYTHON}/site-packages/LDAStools/__init__.py ]; then
touch /usr/lib64/${PYTHON}/site-packages/LDAStools/__init__.py
fi
texlive-type1cm texlive-collection-fontsrecommended \
;
38 changes: 36 additions & 2 deletions etc/spec.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ Summary: {{ description }}

License: {{ license }}
URL: {{ url }}
Source0: https://files.pythonhosted.org/packages/source/g/%{srcname}/%{srcname}-%{version}.tar.gz
Source0: %pypi_source

BuildArch: noarch
BuildRequires: rpm-build
BuildRequires: python-rpm-macros
BuildRequires: python-srpm-macros
BuildRequires: python2-rpm-macros
BuildRequires: python3-rpm-macros
BuildRequires: epel-rpm-macros

BuildRequires: python2-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools

%description
{{ long_description }}
Expand All @@ -43,21 +48,45 @@ Requires: python2-tqdm >= 4.10.0
Requires: python2-gwosc
Requires: python2-dqsegdb2
Requires: python2-gwdatafind

%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
{{ long_description }}

# -- python3-gwpy -------------------------------------------------------------

%package -n python%{python3_pkgversion}-%{srcname}
Summary: %{summary}
Requires: python%{python3_pkgversion}-astropy >= 1.1.1
Requires: python%{python3_pkgversion}-dateutil
Requires: python%{python3_pkgversion}-dqsegdb2
Requires: python%{python3_pkgversion}-gwdatafind
Requires: python%{python3_pkgversion}-gwosc
Requires: python%{python3_pkgversion}-h5py >= 1.3
Requires: python%{python3_pkgversion}-lal >= 6.14.0
Requires: python%{python3_pkgversion}-ldas-tools-framecpp >= 2.6.0
Requires: python%{python3_pkgversion}-ligo-segments >= 1.0.0
Requires: python%{python3_pkgversion}-matplotlib >= 1.2.0
Requires: python%{python3_pkgversion}-numpy >= 1.7.1
Requires: python%{python3_pkgversion}-scipy >= 0.12.1
Requires: python%{python3_pkgversion}-six >= 1.5
Requires: python%{python3_pkgversion}-tqdm >= 4.10.0
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}

%description -n python%{python3_pkgversion}-%{srcname}
{{ long_description }}

# -- build stages -------------------------------------------------------------

%prep
%autosetup -n %{srcname}-%{version}

%build
%py2_build
%py3_build

%install
%py3_install
%py2_install

# -- files --------------------------------------------------------------------
Expand All @@ -68,6 +97,11 @@ Requires: python2-gwdatafind
%{python2_sitelib}/*
%{_bindir}/gwpy-plot

%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc README.md
%{python3_sitelib}/*

# -- changelog ----------------------------------------------------------------

%changelog
Expand Down

0 comments on commit 9b256b2

Please sign in to comment.