diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef7cd12..4e8b795 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: conda: name: Python ${{ matrix.python-version }} (${{ matrix.os }}) @@ -42,12 +46,12 @@ jobs: steps: - name: Get source code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Cache conda packages - uses: actions/cache@v1 + uses: actions/cache@v4 env: # increment to reset cache CACHE_NUMBER: 0 diff --git a/.github/workflows/distribution.yml b/.github/workflows/distribution.yml index 84a5bed..66a618f 100644 --- a/.github/workflows/distribution.yml +++ b/.github/workflows/distribution.yml @@ -12,10 +12,10 @@ jobs: os: [ubuntu-20.04] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 - name: Install cibuildwheel run: python -m pip install cibuildwheel==2.17.0 @@ -31,7 +31,7 @@ jobs: CIBW_ARCHS: auto64 CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux_2_28 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl deploy_pypi: @@ -39,14 +39,14 @@ jobs: runs-on: ubuntu-20.04 needs: build_wheels steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: 3.8 - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: path: ./ - name: build pycbc for pypi diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 72e25f9..10bfca4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,9 +19,9 @@ jobs: name: Flake8 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 7f0493b..5abd704 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -17,6 +17,10 @@ on: - main - master +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: tarball: name: Tarball @@ -25,12 +29,12 @@ jobs: steps: - name: Get source code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.x' @@ -40,7 +44,7 @@ jobs: - name: Create distributions run: python -m build --outdir . --sdist . - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: tarball path: sbank-*.tar.* @@ -56,14 +60,14 @@ jobs: fail-fast: false matrix: debian: - - buster + - bookworm runs-on: ubuntu-latest container: igwn/base:${{ matrix.debian }} env: TARBALL: "sbank-*.tar.*" steps: - name: Download tarball - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: tarball @@ -92,7 +96,7 @@ jobs: # create debian source package files dpkg-source --build src - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: dsc-${{ matrix.debian }} path: | @@ -109,14 +113,14 @@ jobs: fail-fast: false matrix: debian: - - buster + - bookworm runs-on: ubuntu-latest container: igwn/base:${{ matrix.debian }} env: DSC: "sbank_*.dsc" steps: - name: Download source package - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: dsc-${{ matrix.debian }} @@ -157,7 +161,7 @@ jobs: dpkg --contents "${debf}" done - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: deb-${{ matrix.debian }} path: | @@ -174,12 +178,12 @@ jobs: fail-fast: false matrix: debian: - - buster + - bookworm runs-on: ubuntu-latest container: igwn/base:${{ matrix.debian }} steps: - name: Download binary packages - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: deb-${{ matrix.debian }} @@ -202,9 +206,9 @@ jobs: - debian-binary steps: - name: Download debian package - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - name: deb-buster + name: deb-bookworm - name: Install lintian run: | @@ -226,21 +230,17 @@ jobs: fail-fast: false matrix: el: - - el7-testing + - el8-testing runs-on: ubuntu-latest container: igwn/base:${{ matrix.el }} env: TARBALL: "sbank-*.tar.*" steps: - name: Download tarball - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: tarball - - name: Configure DNF - if: matrix.el == 'el7-testing' - run: ln -s /usr/bin/yum /usr/bin/dnf - - name: Configure EPEL run: | dnf -y install epel-release @@ -249,14 +249,14 @@ jobs: - name: Configure rpmbuild run: | dnf -y install \ - python-srpm-macros \ + "*-srpm-macros" \ rpm-build \ ; - name: Create source package run: rpmbuild -ts --define "_srcrpmdir $(pwd)" ${TARBALL} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: srpm-${{ matrix.el }} path: "*.src.rpm" @@ -270,54 +270,35 @@ jobs: fail-fast: false matrix: el: - - el7-testing + - el8-testing runs-on: ubuntu-latest container: igwn/base:${{ matrix.el }} env: SRPM: "python-sbank-*.src.rpm" steps: - name: Download SRPM - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: srpm-${{ matrix.el }} - - name: Configure DNF - if: matrix.el == 'el7-testing' - run: ln -s /usr/bin/yum /usr/bin/dnf - - name: Configure EPEL run: | dnf -y install epel-release - dnf -y install epel-rpm-macros - - name: Enable PowerTools (EL8+) - if: matrix.el != 'el7-testing' + - name: Enable PowerTools (EL8) + if: matrix.el == 'el8-testing' run: | dnf -y -q install "dnf-command(config-manager)" dnf config-manager --set-enabled powertools - - name: Install build tools (EL7) - if: matrix.el == 'el7-testing' - run: | - dnf -y -q install \ - rpm-build \ - yum-utils \ - ; - - - name: Install build tools (EL8+) - if: matrix.el != 'el7-testing' + - name: Install build tools run: | dnf -y -q install \ rpm-build \ "dnf-command(builddep)" \ ; - - name: Install build dependencies (EL7) - if: matrix.el == 'el7-testing' - run: yum-builddep -y ${SRPM} - - - name: Install build dependencies (EL8+) - if: matrix.el != 'el7-testing' + - name: Install build dependencies run: dnf builddep -y ${SRPM} - name: Build binary packages @@ -340,7 +321,7 @@ jobs: rpm -qp --requires "${rpmf}" done - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: rpm-${{ matrix.el }} path: "*.rpm" @@ -354,23 +335,18 @@ jobs: fail-fast: false matrix: el: - - el7-testing + - el8-testing runs-on: ubuntu-latest container: igwn/base:${{ matrix.el }} steps: - name: Download RPMs - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: rpm-${{ matrix.el }} - - name: Configure DNF - if: matrix.el == 'el7-testing' - run: ln -s /usr/bin/yum /usr/bin/dnf - - name: Configure EPEL run: | dnf -y install epel-release - dnf -y install epel-rpm-macros - name: Install RPMs run: dnf -y install *.rpm @@ -378,18 +354,18 @@ jobs: lint-rhel: name: Lint RPMs runs-on: ubuntu-latest - container: centos:7 + container: igwn/base:el8-testing needs: - rhel-binary steps: - name: Download RPM - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - name: rpm-el7-testing + name: rpm-el8-testing - name: Install rpmlint run: | - yum -y -q install \ + dnf -y -q install \ rpmlint \ ; diff --git a/python-sbank.spec b/python-sbank.spec index b5858a4..bc52422 100644 --- a/python-sbank.spec +++ b/python-sbank.spec @@ -19,34 +19,29 @@ Prefix: %{_prefix} # -- requirements ----------- -# rpmbuild dependencies -BuildRequires: python-srpm-macros -BuildRequires: python-rpm-macros -BuildRequires: python3-rpm-macros - # build dependencies BuildRequires: gcc BuildRequires: liblal-devel -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-Cython -BuildRequires: python%{python3_pkgversion}-numpy -BuildRequires: python%{python3_pkgversion}-setuptools >= 30.3.0 +BuildRequires: python3-devel +BuildRequires: python3-Cython +BuildRequires: python3dist(numpy) +BuildRequires: python3dist(setuptools) >= 30.3.0 # runtime dependencies (required for %check and help2man) BuildRequires: help2man BuildRequires: lalapps -BuildRequires: python%{python3_pkgversion}-h5py -BuildRequires: python%{python3_pkgversion}-lal -BuildRequires: python%{python3_pkgversion}-lalsimulation -BuildRequires: python%{python3_pkgversion}-ligo-lw-bin -BuildRequires: python%{python3_pkgversion}-lscsoft-glue -BuildRequires: python%{python3_pkgversion}-matplotlib -BuildRequires: python%{python3_pkgversion}-scipy -BuildRequires: python%{python3_pkgversion}-six +BuildRequires: python3-lal +BuildRequires: python3-lalsimulation +BuildRequires: python3-ligo-lw-bin +BuildRequires: python3dist(h5py) +BuildRequires: python3dist(lscsoft-glue) +BuildRequires: python3dist(matplotlib) +BuildRequires: python3dist(scipy) +BuildRequires: python3dist(six) # testing dependencies (required for %check) %if 0%{?rhel} == 0 || 0%{?rhel} >= 9 -BuildRequires: python%{python3_pkgversion}-pytest >= 3.9.1 +BuildRequires: python3dist(pytest) >= 3.9.1 %endif # -- src rpm ---------------- @@ -72,31 +67,30 @@ template banks. Summary: Command-line utilities for Sbank BuildArch: noarch Requires: lalapps -Requires: python%{python3_pkgversion}-%{srcname} = %{version}-%{release} -Requires: python%{python3_pkgversion}-h5py -Requires: python%{python3_pkgversion}-lal -Requires: python%{python3_pkgversion}-lalsimulation -Requires: python%{python3_pkgversion}-ligo-lw-bin -Requires: python%{python3_pkgversion}-lscsoft-glue -Requires: python%{python3_pkgversion}-matplotlib -Requires: python%{python3_pkgversion}-numpy -Requires: python%{python3_pkgversion}-scipy -Requires: python%{python3_pkgversion}-six +Requires: python3-%{srcname} = %{version}-%{release} +Requires: python3-lal +Requires: python3-lalsimulation +Requires: python3-ligo-lw-bin +Requires: python3dist(h5py) +Requires: python3dist(lscsoft-glue) +Requires: python3dist(matplotlib) +Requires: python3dist(numpy) +Requires: python3dist(scipy) +Requires: python3dist(six) %description -n %{srcname} Sbank provides a library for generating template banks of compact binary mergers for gravitational-wave searches using the "stochastic" placement algorithm. The package provides the command-line utilities. -%package -n python%{python3_pkgversion}-%{srcname} +%package -n python3-%{srcname} Summary: Python %{python3_version} library for Sbank -Requires: python%{python3_pkgversion}-lal -Requires: python%{python3_pkgversion}-lalsimulation -Requires: python%{python3_pkgversion}-lscsoft-glue -Requires: python%{python3_pkgversion}-numpy -Requires: python%{python3_pkgversion}-six -%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} -%description -n python%{python3_pkgversion}-%{srcname} +Requires: python3-lal +Requires: python3-lalsimulation +Requires: python3dist(lscsoft-glue) +Requires: python3dist(numpy) +Requires: python3dist(six) +%description -n python3-%{srcname} Sbank provides a library for generating template banks of compact binary mergers for gravitational-wave searches using the "stochastic" placement algorithm. @@ -122,7 +116,7 @@ sbank --help %install %py3_install -# generate man pages with elp2man +# generate man pages with help2man mkdir -p %{buildroot}%{_mandir}/man1 export PYTHONPATH="%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}:${PYTHONPATH}" ls %{buildroot}%{_bindir}/ | xargs --verbose -I @ \ @@ -135,9 +129,6 @@ help2man \ --version-string %{version} \ %{buildroot}%{_bindir}/@ -%clean -rm -rf $RPM_BUILD_ROOT - # -- files ------------------ %files -n %{srcname} @@ -146,7 +137,7 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/* %{_mandir}/man1/* -%files -n python%{python3_pkgversion}-%{srcname} +%files -n python3-%{srcname} %license COPYING %doc README.md %{python3_sitearch}/*