From 9b80ea0e1ac9ec380fcc70fc6790f03184de4980 Mon Sep 17 00:00:00 2001 From: Duncan Macleod Date: Thu, 17 Jan 2019 17:48:33 +0000 Subject: [PATCH] added system-level packaging include circle configuration --- .circleci/config.yml | 96 +++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + MANIFEST.in | 2 + debian/changelog | 5 ++ debian/compat | 1 + debian/control | 55 ++++++++++++++++++++++ debian/copyright | 24 ++++++++++ debian/rules | 7 +++ debian/source/format | 1 + dqsegdb2.spec | 106 +++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 2 + 11 files changed, 300 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 dqsegdb2.spec create mode 100644 setup.cfg diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..c77a554 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,96 @@ +version: 2 + +run-tests: &run-tests + name: Test + command: python -m pytest --cov dqsegdb2 --pyargs dqsegdb2 + +debian-build: &debian-build + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Build + command: | + set -x; + apt-get -yqq update; + apt-get -yqq install dpkg-dev devscripts; + pushd $(mktemp -d -p .); + tar -xf ../dqsegdb2-*.tar.* --strip-components=1; + mk-build-deps --tool "apt-get -y" --install --remove; + dpkg-buildpackage -us -uc -b; + popd; + dpkg --install python*dqsegdb2*.deb; + - run: *run-tests + - store_artifacts: + path: "*.deb" + +centos-build: ¢os-build + steps: + - checkout + - attach_workspace: + at: . + - run: + name: Build + command: | + set -x; + yum -y -q update; + yum -y -q install rpm-build yum-utils; + SRPM=$(rpmbuild --define "_topdir $(pwd)" -ts ./dqsegdb2-*.tar.* | cut -d\ -f2); + yum-builddep -y -q ${SRPM}; + rpmbuild --define "_rpmdir $(pwd)" --rebuild ${SRPM}; + mv noarch/*.rpm .; + yum -y -q --nogpgcheck localinstall ./python*dqsegdb2*.rpm; + - run: *run-tests + - store_artifacts: + path: "*.rpm" + +jobs: + sdist: + docker: + - image: python + steps: + - checkout + - run: + name: Build tarball + command: python setup.py --quiet sdist --dist-dir . + - persist_to_workspace: + root: . + paths: + - dqsegdb2-*.tar.* + + debian:stretch:2.7: + <<: *debian-build + docker: + - image: ligo/base:stretch + environment: + PYTHON_VERSION: "2.7" + + debian:stretch:3.5: + <<: *debian-build + docker: + - image: ligo/base:stretch + environment: + PYTHON_VERSION: "3.5" + + el7:2.7: + <<: *centos-build + docker: + - image: ligo/base:el7 + environment: + PYTHON_VERSION: "2.7" + +workflows: + version: 2 + build_and_test: + jobs: + - sdist + - debian:stretch:2.7: + requires: + - sdist + - debian:stretch:3.5: + requires: + - sdist + - el7:2.7: + requires: + - sdist diff --git a/.gitignore b/.gitignore index 9b5250c..45f55e1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # build files/directories to ignore /build/ +/dist/ /.cache/ /*.egg-info/ /.eggs/ diff --git a/MANIFEST.in b/MANIFEST.in index 1aba38f..9771e04 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ include LICENSE +include dqsegdb2.spec +recursive-include debian * diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..9b00eac --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +dqsegdb2 (1.0.0-1) unstable; urgency=low + + * first release + + -- Duncan Macleod Wed, 01 Aug 2018 19:01:11 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..9ba6152 --- /dev/null +++ b/debian/control @@ -0,0 +1,55 @@ +# -- dqsegdb2 source package -------------------------------------------------- + +Source: dqsegdb2 +Section: python +Priority: optional +Maintainer: Duncan Macleod +Standards-Version: 4.2.1 +X-Python-Version: >= 2.7 +X-Python3-Version: >= 3.4 +Homepage: https://github.com/duncanmmacleod/dqsegdb2 +Build-Depends: debhelper (>= 9), + dh-python, + python-all, + python3-all, + python-setuptools, + python3-setuptools, + python-ligo-segments, + python3-ligo-segments, + python-gwdatafind, + python3-gwdatafind, + python-pytest, + python3-pytest, + python-mock + +# -- python-dqsegdb2 ---------------------------------------------------------- + +Package: python-dqsegdb2 +Architecture: all +Depends: ${misc:Depends}, + ${python:Depends}, + python-ligo-segments, + python-gwdatafind +Description: Simplified Python 2 interface to DQSEGDB + DQSEGDB2 is a simplified Python implementation of the DQSEGDB API as + defined in LIGO-T1300625. + . + This package only provides a query interface for `GET` requests, any users + wishing to make `POST` requests should refer to the official `dqsegdb` Python + client available from https://github.com/ligovirgo/dqsegdb/. + +# -- python3-dqsegdb2 --------------------------------------------------------- + +Package: python3-dqsegdb2 +Architecture: all +Depends: ${misc:Depends}, + ${python3:Depends}, + python3-ligo-segments, + python3-gwdatafind +Description: Simplified Python 3 interface to DQSEGDB + DQSEGDB2 is a simplified Python implementation of the DQSEGDB API as + defined in LIGO-T1300625. + . + This package only provides a query interface for `GET` requests, any users + wishing to make `POST` requests should refer to the official `dqsegdb` Python + client available from https://github.com/ligovirgo/dqsegdb/. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ddaa84d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Contact: Duncan Macleod +Source: https://git.ligo.org/duncanmmacleod/python-pmdc + +Files: * +Copyright: 2018 Duncan Macleod +License: GPL-3+ + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..ecb3657 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +export PYBUILD_NAME = dqsegdb2 +export PYBUILD_TEST_PYTEST = 1 + +%: + dh $@ --with python2,python3 --buildsystem=pybuild diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/dqsegdb2.spec b/dqsegdb2.spec new file mode 100644 index 0000000..1dd7a32 --- /dev/null +++ b/dqsegdb2.spec @@ -0,0 +1,106 @@ +%define name dqsegdb2 +%define version 1.0.0 +%define release 1 + +Name: %{name} +Version: %{version} +Release: %{release}%{?dist} +Summary: Simplified python interface to DQSEGDB + +License: GPLv3 +Url: https://pypi.org/project/%{name}/ +Source0: https://pypi.io/packages/source/d/%{name}/%{name}-%{version}.tar.gz + +Vendor: Duncan Macleod + +BuildArch: noarch + +BuildRequires: rpm-build +BuildRequires: python-rpm-macros +BuildRequires: python-srpm-macros +BuildRequires: python2-rpm-macros +BuildRequires: python3-rpm-macros + +# python2-dqsegdb2 +BuildRequires: python2-setuptools +BuildRequires: python2-ligo-segments +BuildRequires: python2-gwdatafind +BuildRequires: pytest +BuildRequires: python2-mock + +# python3x-dqsegdb2 +BuildRequires: python%{python3_version_nodots}-setuptools +BuildRequires: python%{python3_version_nodots}-ligo-segments +BuildRequires: python%{python3_version_nodots}-gwdatafind +BuildRequires: python%{python3_version_nodots}-pytest + +%description +DQSEGDB2 is a simplified Python implementation of the DQSEGDB API as defined in +LIGO-T1300625. +This package only provides a query interface for `GET` requests, any users +wishing to make `POST` requests should refer to the official `dqsegdb` Python +client available from https://github.com/ligovirgo/dqsegdb/. + +# -- python2-gwdatafind + +%package -n python2-%{name} +Summary: Simplified Python %{python2_version} interface to DQSEGDB +Requires: python2-ligo-segments +Requires: python2-gwdatafind +%{?python_provide:%python_provide python2-%{name}} +%description -n python2-%{name} +DQSEGDB2 is a simplified Python implementation of the DQSEGDB API as defined in +LIGO-T1300625. +This package only provides a query interface for `GET` requests, any users +wishing to make `POST` requests should refer to the official `dqsegdb` Python +client available from https://github.com/ligovirgo/dqsegdb/. + +# -- python3x-gwdatafind + +%package -n python%{python3_version_nodots}-%{name} +Summary: Simplified Python %{python3_version} interface to DQSEGDB +Requires: python%{python3_version_nodots}-ligo-segments +Requires: python%{python3_version_nodots}-gwdatafind +%{?python_provide:%python_provide python%{python3_version_nodots}-%{name}} +%description -n python%{python3_version_nodots}-%{name} +DQSEGDB2 is a simplified Python implementation of the DQSEGDB API as defined in +LIGO-T1300625. +This package only provides a query interface for `GET` requests, any users +wishing to make `POST` requests should refer to the official `dqsegdb` Python +client available from https://github.com/ligovirgo/dqsegdb/. + +# -- build steps + +%prep +%autosetup -n %{name}-%{version} + +%build +%py2_build +%py3_build + +%check +%{__python2} -m pytest --pyargs %{name} +%{__python3} -m pytest --pyargs %{name} + +%install +%py2_install +%py3_install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -n python2-%{name} +%license LICENSE +%doc README.md +%{python2_sitelib}/* + +%files -n python%{python3_version_nodots}-%{name} +%license LICENSE +%doc README.md +%{python3_sitelib}/* + +# -- changelog + +%changelog +* Wed Aug 01 2018 Duncan Macleod +- 1.0.0 first release diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..0c9e0fc --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +license_file = LICENSE