Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • duncan.meacher/gwdatafind
  • duncanmmacleod/gwdatafind
  • computing/gwdatafind/client
3 results
Show changes
Commits on Source (7)
Showing with 291 additions and 744 deletions
[metadata]
name = gwdatafind
version = attr: gwdatafind.__version__
author = Duncan Macleod
author_email = duncan.macleod@ligo.org
description = The GWDataFind data discovery client
license = GPL-3.0-or-later
license_files = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown
# urls
url = https://gwdatafind.readthedocs.io
download_url = https://pypi.org/project/gwdatafind
project_urls =
Bug Tracker = https://git.ligo.org/gwdatafind/gwdatafind/-/issues/
Documentation = https://gwdatfind.readthedocs.io
Source Code = https://git.ligo.org/gwdatafind/gwdatafind.git
# classifiers
classifiers =
Development Status :: 5 - Production/Stable
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Intended Audience :: Science/Research
Natural Language :: English
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Physics
License :: OSI Approved :: MIT License
[options]
packages = find:
python_requires = >=3.6
setup_requires =
setuptools
install_requires =
igwn-auth-utils >=0.3.1
ligo-segments
[options.entry_points]
console_scripts =
gw_data_find = gwdatafind.__main__:main
[options.extras_require]
docs =
numpydoc
sphinx >= 4.4.0
sphinx-argparse
sphinx_automodapi
sphinx_rtd_theme
test =
pytest >= 2.8.0
pytest-cov
requests-mock
lint =
flake8
flake8-bandit
flake8-docstrings
radon
# -- tools
; vim: set ft=dosini :
[flake8]
select =
......
......@@ -12,6 +12,7 @@
__pycache__/
/.coverage
.pytest_cache/
/man
# documentation outputs
/docs/_build/
......
stages:
- Source distribution
- Source packages
- Binary packages
- Testing
- Documentation
- Code quality
include:
# tarball
- local: '/.gitlab/ci/dist.yml'
# RHEL packaging
- local: '/.gitlab/ci/rhel.yml'
# Debian packaging
- local: '/.gitlab/ci/debian.yml'
# Python tests
- local: '/.gitlab/ci/python.yml'
# Code quality
- local: '/.gitlab/ci/analysis.yml'
# Documentation
- local: '/.gitlab/ci/docs.yml'
# -- Python -------------------------
- component: $CI_SERVER_FQDN/computing/gitlab/components/python/all@1
inputs:
install_extra: "test"
run_advanced_sast: true
- component: $CI_SERVER_FQDN/computing/gitlab/components/python/code-quality@1
inputs:
requirements: >-
flake8-docstrings
radon
# -- Debian packaging ---------------
- component: $CI_SERVER_FQDN/computing/gitlab/components/debian/all@2
inputs:
needs: [sdist]
debian_versions:
- bullseye
- bookworm
test_script: &system_test_script
- python3 -m pytest
--cov=gwdatafind
--durations=0
--junit-xml=junit.xml
-ra
-v
--pyargs
gwdatafind.tests
- python3 -m coverage run
--append
--source=gwdatafind
/usr/bin/gw_data_find --help
test_install: &system_test_install >-
gwdatafind
python3-pytest
python3-pytest-cov
python3-requests-mock
# -- Red Hat packaging --------------
- component: $CI_SERVER_FQDN/computing/gitlab/components/redhat/all@1
inputs:
needs: [sdist]
redhat_versions:
- 8
- 9
test_script: *system_test_script
test_install: *system_test_install
# -- Documentation ------------------
- component: $CI_SERVER_FQDN/computing/gitlab/components/sphinx/build@1
inputs:
requirements: ".[docs]"
# ---------------------------
# Code Quality workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
file:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
- python.yml
# https://docs.gitlab.com/ee/user/application_security/dependency_scanning/
- template: Security/Dependency-Scanning.gitlab-ci.yml
# -- code quality -----------
#
# These jobs check the code for
# quality issues
#
flake8:
stage: Code quality
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:flake8
- .python:flake8
needs: []
variables:
# don't fail the pipeline because of linting issues,
# these are presented in the code-quality box in the
# merge_request UI
FLAKE8_OPTIONS: "--exit-zero"
before_script:
# pick requirements out of the metadata
- |
REQUIREMENTS=$(${PYTHON} -c "
from setuptools import Distribution
dist = Distribution()
dist.parse_config_files()
for req in dist.extras_require['lint']:
print(req)
")
# install things
- !reference [".python:flake8", before_script]
# -- dependency scanning ----
#
# This job checks for dependency
# issues
#
dependency_scanning:
stage: Code quality
needs: []
before_script:
- |
python -c "
from setuptools import Distribution
dist = Distribution()
dist.parse_config_files()
reqs = dist.setup_requires + dist.install_requires
for extra in ('test',):
reqs.extend(dist.extras_require[extra])
print('\n'.join(reqs))
" | sort -u > requirements.txt
# ---------------------------
# Debian packaging workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/debian/
file: debian.yml
# local test template
- local: /.gitlab/ci/test.yml
# -- macros
.bullseye:
image: igwn/builder:bullseye
.bookworm:
image: igwn/builder:bookworm
# -- source packages --------
#
# These jobs make DSC packages
#
.dsc:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/debian/#.debian:dsc
- .debian:dsc
stage: Source packages
needs:
- tarball
variables:
TARBALL: "gwdatafind-*.tar.*"
before_script:
- !reference [".debian:dsc", "before_script"]
# unpack the tarball, update the debian changelog, and pack it up again
- apt-get -yqq install devscripts
- export DEBFULLNAME="GitLab"
- export DEBEMAIL="gitlab@git.ligo.org"
- tar -zxf ${TARBALL}
- (cd gwdatafind-*/ && dch --rebuild 'ci')
- tar -zcf ${TARBALL} gwdatafind-*/
- rm -rf gwdatafind-*/
dsc:bullseye:
extends:
- .dsc
- .bullseye
dsc:bookworm:
extends:
- .dsc
- .bookworm
# -- binary packages --------
#
# These jobs generate DEB
# binary packages from the
# DSC sources packages
#
.deb:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/debian/#.debian:deb
- .debian:deb
stage: Binary packages
variables:
DSC: "gwdatafind_*.dsc"
deb:bullseye:
extends:
- .deb
- .bullseye
needs:
- dsc:bullseye
deb:bookworm:
extends:
- .deb
- .bookworm
needs:
- dsc:bookworm
# -- test -------------------
.test:debian:
extends:
# see /.gitlab/ci/test.yml
- .test:linux
# https://computing.docs.ligo.org/gitlab-ci-templates/debian/#.debian:base
- .debian:base
before_script:
# set up apt
- !reference [".debian:base", before_script]
# setup local apt repository
- apt-get -y -q -q install local-apt-repository
- mkdir -pv /srv/local-apt-repository
# fill our local apt repo and rebuild it
- mv -v *.deb /srv/local-apt-repository
- /usr/lib/local-apt-repository/rebuild
- apt-get -y -q update
# install our package(s)
- apt-cache policy gwdatafind
- apt-cache show gwdatafind
- apt-get -y install gwdatafind
# install testing dependencies
- apt-get -y -q install
findutils
man-db
python3-coverage
python3-pytest
python3-pytest-cov
python3-requests-mock
test:bullseye:
extends:
- .test:debian
- .bullseye
needs:
- deb:bullseye
test:bookworm:
extends:
- .test:debian
- .bookworm
needs:
- deb:bookworm
# -- lint -------------------
#
# These jobs check the code
# for quality issues
#
.lintian:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/debian/#.debian:lint
- .debian:lint
stage: Code quality
variables:
LINTIAN_OPTIONS: "--color always --suppress-tags new-package-should-close-itp-bug,groff-message --fail-on warning,error --allow-root --pedantic"
lintian:bullseye:
extends:
- .lintian
- .bullseye
needs:
- deb:bullseye
variables:
lintian:bookworm:
extends:
- .lintian
- .bookworm
needs:
- deb:bookworm
# ---------------------------
# Distribution workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
file: python.yml
# -- dist -------------------
#
# This job makes the gwdatafind-X.Y.Z.tar.gz
# distribution and uploads it as a job
# artifact
#
tarball:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:build
- .python:build
image: python:3
stage: Source distribution
variables:
SDIST: "true"
WHEEL: "false"
# ---------------------------
# Documentation workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
file: python.yml
# -- docs -------------------
#
# These jobs run the sphinx
# documentation build
#
docs:
stage: Documentation
needs: []
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:sphinx
extends: .python:sphinx
variables:
BUILDER: "html"
SPHINXOPTS: "-E -W"
before_script:
- python -m pip install .[docs]
#
# Publishing is done automatically
# on readthedocs.org via a webhook,
# see
#
# https://readthedocs.org/projects/gwdatafind/builds/
#
# for full details
#
# ---------------------------
# Python workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
file: python.yml
# local test template
- local: /.gitlab/ci/test.yml
# -- build ------------------
#
# this job builds the wheel
# distribution
#
wheel:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:build
- .python:build
image: python:3
stage: Binary packages
variables:
SDIST: "false"
WHEEL: "true"
# -- test -------------------
#
# These jobs run the tests
#
.test:pip:
extends:
# see /.gitlab/ci/test.yml
- .test
needs:
- wheel
before_script:
# resolve wildcard in wheel so we specify an extra
- WHEEL=$(echo gwdatafind-*.whl)
- INSTALL_TARGET="${WHEEL}[test]"
# configure from template
- !reference [".python:pytest", before_script]
test:python3.6:
extends:
- .test:pip
image: python:3.6
test:python3.7:
extends:
- .test:pip
image: python:3.7
test:python3.8:
extends:
- .test:pip
image: python:3.8
test:python3.9:
extends:
- .test:pip
image: python:3.9
test:python3.10:
extends:
- .test:pip
image: python:3.10
test:python3.11:
extends:
- .test:pip
image: python:3.11
test:python3.12:
extends:
- .test:pip
image: python:3.12
# ---------------------------
# RHEL packaging workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
# https://computing.docs.ligo.org/gitlab-ci-templates/rhel/
file: rhel.yml
# local test template
- local: /.gitlab/ci/test.yml
# -- macros
.el:
variables:
EPEL: "true"
.el7:
extends: .el
image: igwn/base:el7-testing
.el7-builder:
extends: .el7
image: igwn/builder:el7-testing
.el8:
extends: .el
image: igwn/base:el8-testing
.el8-builder:
extends: .el8
image: igwn/builder:el8-testing
.el9:
extends: .el
image: igwn/base:el9-testing
.el9-builder:
extends: .el9
image: igwn/builder:el9-testing
# -- source packages --------
#
# These jobs make src RPMs
#
.srpm:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/rhel/#.rhel:srpm
- .rhel:srpm
stage: Source packages
needs:
- tarball
variables:
TARBALL: "gwdatafind-*.tar.*"
srpm:el7:
extends:
- .srpm
- .el7-builder
srpm:el8:
extends:
- .srpm
- .el8-builder
srpm:el9:
extends:
- .srpm
- .el9-builder
# -- binary packages --------
#
# These jobs generate binary RPMs
# from the src RPMs
#
.rpm:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/rhel/#.rhel:rpm
- .rhel:rpm
stage: Binary packages
variables:
SRPM: "python-gwdatafind-*.src.rpm"
rpm:el7:
extends:
- .rpm
- .el7-builder
needs:
- srpm:el7
rpm:el8:
extends:
- .rpm
- .el8-builder
needs:
- srpm:el8
rpm:el9:
extends:
- .rpm
- .el9-builder
needs:
- srpm:el9
# -- test -------------------
.test:el:
extends:
# see /.gitlab/ci/test.yml
- .test:linux
before_script:
# set up yum caching
- !reference [".rhel:base", before_script]
# configure EPEL
- yum -y -q install epel-release && yum -y -q install epel-rpm-macros
# install testing dependencies
- PY3=$(rpm --eval '%{?python3_pkgversion:%{python3_pkgversion}}%{!?python3_pkgversion:3}')
- yum -y -q install
findutils
man-db
python${PY3}-coverage
python${PY3}-pytest
python${PY3}-pytest-cov
python${PY3}-requests-mock
# install our package(s)
- yum -y -q install *.rpm
# -- the test suite needs requests-mock,
# which isn't available for el7, hence
# no test:el7 job
#test:el7:
# extends:
# - .test:el
# - .el7
# needs:
# - rpm:el7
test:el8:
extends:
- .test:el
- .el8
needs:
- rpm:el8
test:el9:
extends:
- .test:el
- .el9
needs:
- rpm:el9
# -- lint -------------------
#
# These jobs check the code
# for quality issues
#
.rpmlint:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/rhel/#.rhel:lint
- .rhel:lint
stage: Code quality
variables:
GIT_STRATEGY: fetch
INSTALLED_RPMS: "*gwdatafind*"
RPMLINT_OPTIONS: "--info --file rpm/rpmlintrc"
rpmlint:el7:
extends:
- .rpmlint
- .el7
needs:
- rpm:el7
rpmlint:el8:
extends:
- .rpmlint
- .el8
needs:
- rpm:el8
rpmlint:el9:
extends:
- .rpmlint
- .el9
needs:
- rpm:el9
# ---------------------------
# Testing workflow
# ---------------------------
include:
# https://computing.docs.ligo.org/gitlab-ci-templates/
- project: computing/gitlab-ci-templates
file:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/
- python.yml
# test template used in other jobs
# see python.yml for example
.test:
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:pytest
- .python:pytest
stage: Testing
variables:
# target for coverage
COVERAGE_TARGET: "gwdatafind"
# don't need the git repo
GIT_STRATEGY: none
# configure pytest
PYTEST_OPTIONS: "-ra -v --pyargs gwdatafind"
# use python3
PYTHON: "python3"
script:
# run pytest
- !reference [".python:pytest", script]
# run other stuff
- python3 -m coverage run
--append
--source=gwdatafind
-m gwdatafind --help
# upload coverage database to be aggregated later
artifacts:
paths:
- .coverage*
# disable coverage total parsing, this is reported by
# the coverage job
coverage: null
.test:linux:
extends: .test
script:
- !reference [.test, script]
- man -Pcat gw_data_find
# -- coverage ---------------
#
# This job combinces the individual
# coverage reports from each job
# to make a proper coverage result
#
coverage:
stage: .post
extends:
# https://computing.docs.ligo.org/gitlab-ci-templates/python/#.python:coverage-combine
- .python:coverage-combine
9
......@@ -4,19 +4,19 @@ Source: gwdatafind
Maintainer: Duncan Macleod <duncan.macleod@ligo.org>
Section: python
Priority: optional
Standards-Version: 3.9.1
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.4
Standards-Version: 4.2.1
X-Python3-Version: >= 3.6
Build-Depends:
debhelper (>= 9),
debhelper-compat (= 13),
dh-python,
pybuild-plugin-pyproject,
python3-all,
python3-argparse-manpage,
python3-igwn-auth-utils (>= 0.3.1),
python3-ligo-segments,
python3-setuptools,
help2man,
python3-pytest (>= 2.8.0),
python3-requests-mock,
python3-setuptools,
# -- python3-gwdatafind -------------------------------------------------------
......
usr/bin/*
usr/share/man/man1/*
debian/tmp/man/*.1
# dist-info files aren't documentation (<=Bullseye)
python3-gwdatafind: package-contains-documentation-outside-usr-share-doc */*.dist-info/*
#!/usr/bin/make -f
# build man page for gw_data_find for python3
# Automatically generate man pages with help2man
export PYBUILD_AFTER_INSTALL_python3 := \
echo 'Generating man pages with help2man' && \
mkdir -p {destdir}/usr/share/man/man1 && \
env PYTHONPATH={destdir}{install_dir} \
help2man \
--output {destdir}/usr/share/man/man1/gw_data_find.1 \
--name "discover available GW data" \
--no-discard-stderr \
--no-info \
--section 1 \
--source $(DEB_SOURCE) \
--version-string $(DEB_VERSION_UPSTREAM) \
{destdir}/usr/bin/gw_data_find \
;
%:
dh $@ --with python3 --buildsystem=pybuild
override_dh_installman:
# -- hack manpage generation for old argparse-manpage
# this hack can be removed when we get to Debian 13 (argparse-manpage 4.5)
python3 -c "import toml; meta = toml.load(open('pyproject.toml', 'r')); print(f\"[metadata]\nname = {meta['project']['name']}\nurl = {meta['project']['urls']['Homepage']}\n[build_manpages]\"); print(\"manpages =\n\t\", end=\"\"); print(\"\n\t\".join(meta['tool']['build_manpages']['manpages']))" > setup.cfg
# -- generate manpages manually
python3 -c "from setuptools import setup; setup()" \
--command-packages=build_manpages \
build_manpages \
;
mv -v man/ debian/tmp/
dh_installman -O--buildsystem=pybuild
......@@ -105,6 +105,7 @@ def command_line():
parser = DataFindArgumentParser(
description=__doc__,
)
parser.man_short_description = __doc__.splitlines()[0].lower().rstrip(".")
parser.add_argument(
"-V",
......
[build-system]
requires = [
"setuptools>=42",
"wheel",
"setuptools >= 61.0.0",
"wheel",
]
build-backend = "setuptools.build_meta"
[project]
name = "gwdatafind"
description = "The GWDataFind data discovery client"
authors = [
{ name = "Duncan Macleod", email = "duncan.macleod@ligo.org" },
]
license = { text = "GPL-3.0-or-later" }
readme = "README.md"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics",
]
# requirements
requires-python = ">=3.6"
dependencies = [
"igwn-auth-utils >=0.3.1",
"ligo-segments",
]
dynamic = [
"version",
]
[project.optional-dependencies]
docs = [
"numpydoc",
"sphinx >= 4.4.0",
"sphinx-argparse",
"sphinx_automodapi",
"sphinx_rtd_theme",
]
test = [
"pytest >= 2.8.0",
"pytest-cov",
"requests-mock",
]
lint = [
"flake8",
"flake8-bandit",
"flake8-docstrings",
"radon",
]
[project.urls]
"Homepage" = "https://gwdatafind.readthedocs.io"
"Bug Tracker" = "https://git.ligo.org/gwdatafind/gwdatafind/-/issues/"
"Documentation" = "https://gwdatafind.readthedocs.io"
"Source Code" = "https://git.ligo.org/gwdatafind/gwdatafind.git"
[project.scripts]
gw_data_find = "gwdatafind.__main__:main"
# -- tools
[tool.build_manpages]
manpages = [
"man/gw_data_find.1:prog=gw_data_find:function=command_line:module=gwdatafind.__main__",
]
[tool.coverage.paths]
source = [
"gwdatafind/",
"/usr/lib/python*/*-packages/gwdatafind/",
"/usr/local/lib/python*/*-packages/gwdatafind/",
"gwdatafind/",
"*/gwdatafind/",
]
[tool.coverage.report]
precision = 1
[tool.coverage.run]
source = ["gwdatafind"]
......@@ -21,3 +96,14 @@ filterwarnings = [
"error",
"ignore:.*pkg_resources"
]
[tool.setuptools]
license-files = [ "LICENSE" ]
[tool.setuptools.dynamic]
version = { attr = "gwdatafind.__version__" }
[tool.setuptools.packages.find]
include = [
"gwdatafind*",
]
%define srcname gwdatafind
%define version 1.2.0
%define release 1
%global srcname gwdatafind
%global version 1.2.0
%global release 1
Name: python-%{srcname}
Version: %{version}
......@@ -13,26 +13,23 @@ Source0: %pypi_source
Packager: Duncan Macleod <duncan.macleod@ligo.org>
BuildArch: noarch
Prefix: %{_prefix}
# build requirements
BuildRequires: python%{python3_pkgversion}-devel >= 3.6
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-wheel
BuildRequires: python3-devel >= 3.6
BuildRequires: python3dist(pip)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(wheel)
# man pages
%if 0%{?rhel} == 0 || 0%{?rhel} >= 8
BuildRequires: argparse-manpage >= 3
%endif
BuildRequires: python%{python3_pkgversion}-igwn-auth-utils >= 0.3.1
BuildRequires: python%{python3_pkgversion}-ligo-segments
BuildRequires: python3dist(argparse-manpage)
BuildRequires: python3dist(igwn-auth-utils) >= 0.3.1
BuildRequires: python3dist(ligo-segments)
# testing dependencies
BuildRequires: man-db
%if 0%{?rhel} == 0 || 0%{?rhel} >= 8
BuildRequires: python%{python3_pkgversion}-pytest >= 2.8.0
BuildRequires: python%{python3_pkgversion}-requests-mock
%endif
BuildRequires: python3dist(pytest) >= 2.8.0
BuildRequires: python3dist(requests-mock)
# -- src.rpm
......@@ -46,7 +43,7 @@ GWDataFind client API.
%package -n %{srcname}
Summary: %{summary}
Requires: python%{python3_pkgversion}-%{srcname} = %{version}-%{release}
Requires: python3-%{srcname} = %{version}-%{release}
Conflicts: glue < 1.61.0
Conflicts: python2-gwdatafind < 1.0.4-3
%description -n %{srcname}
......@@ -54,73 +51,94 @@ The DataFind service allows users to query for the location of
Gravitational-Wave Frame (GWF) files containing data from the current
gravitational-wave detectors. This package provides the python interface
libraries.
%files -n %{srcname}
%license LICENSE
%doc README.md
%{_bindir}/gw_data_find
%{_mandir}/man1/gw_data_find.1*
# -- python3x-gwdatafind
%package -n python%{python3_pkgversion}-%{srcname}
%package -n python3-%{srcname}
Summary: Python %{python3_version} library for the GWDataFind service
Requires: python%{python3_pkgversion}-igwn-auth-utils >= 0.3.1
Requires: python%{python3_pkgversion}-ligo-segments
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
%description -n python%{python3_pkgversion}-%{srcname}
Requires: python3dist(igwn-auth-utils) >= 0.3.1
Requires: python3dist(ligo-segments)
%description -n python3-%{srcname}
The DataFind service allows users to query for the location of
Gravitational-Wave Frame (GWF) files containing data from the current
gravitational-wave detectors. This package provides the
Python %{python3_version} interface libraries.
%files -n python3-%{srcname}
%license LICENSE
%doc README.md
%{python3_sitelib}/*
# -- build steps
%prep
%autosetup -n %{srcname}-%{version}
# for RHEL < 9 hack together setup.{cfg,py} for old setuptools
%if 0%{?rhel} && 0%{?rhel} < 10
cat > setup.cfg << SETUP_CFG
[metadata]
name = %{srcname}
version = %{version}
author-email = %{packager}
description = %{summary}
license = %{license}
license_files = LICENSE
url = %{url}
[options]
packages = find:
python_requires = >=3.6
install_requires =
igwn-auth-utils >= 0.3.1
ligo-segments
[options.entry_points]
console_scripts =
gw_data_find = gwdatafind.__main__:main
[build_manpages]
manpages =
man/gw_data_find.1:prog=gwdatafind:function=command_line:module=gwdatafind.__main__
SETUP_CFG
%endif
%if %{undefined pyproject_wheel}
cat > setup.py << SETUP_PY
from setuptools import setup
setup()
SETUP_PY
%endif
%build
%if %{defined pyproject_wheel}
%pyproject_wheel
%else
%py3_build_wheel
%endif
# generate manuals
%python3 -c "from setuptools import setup; setup()" \
--command-packages=build_manpages \
build_manpages \
;
%install
%py3_install_wheel gwdatafind-%{version}-*.whl
%if 0%{?rhel} == 0 || 0%{?rhel} >= 8
mkdir -vp %{buildroot}%{_mandir}/man1
env PYTHONPATH="%{buildroot}%{python3_sitelib}" \
argparse-manpage \
--description "discover available GW data" \
--function command_line \
--module gwdatafind.__main__ \
--output %{buildroot}%{_mandir}/man1/gw_data_find.1 \
--prog gw_data_find \
--project-name %{srcname} \
--version %{version} \
--url %{url} \
;
%if %{defined pyproject_install}
%pyproject_install
%else
%py3_install_wheel *.whl
%endif
%__mkdir -p -v %{buildroot}%{_mandir}/man1
%__install -m 644 -p -v man/*.1* %{buildroot}%{_mandir}/man1/
%check
export PYTHONPATH="%{buildroot}%{python3_sitelib}"
# sanity checks
%{__python3} -m gwdatafind --help
%{buildroot}%{_bindir}/gw_data_find --help
%if 0%{?rhel} == 0 || 0%{?rhel} >= 8
# run test suite
%{pytest} --pyargs gwdatafind
# test man pages
env MANPATH="%{buildroot}%{_mandir}" man -P cat gw_data_find
# run test suite
%{__python3} -m pytest --pyargs gwdatafind
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files -n %{srcname}
%license LICENSE
%doc README.md
%{_bindir}/gw_data_find
%if 0%{?rhel} == 0 || 0%{?rhel} >= 8
%{_mandir}/man1/gw_data_find.1*
%endif
%files -n python%{python3_pkgversion}-%{srcname}
%license LICENSE
%doc README.md
%{python3_sitelib}/*
# -- changelog
......
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2017-2021)
#
# This file is part of GWDataFind
#
# GWDataFind 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.
#
# GWDataFind 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 GWDataFind. If not, see <http://www.gnu.org/licenses/>.
"""Setup GWDataFind.
"""
from setuptools import setup
setup()