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 (17)
Showing with 90 additions and 674 deletions
......@@ -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:
code_quality_analyzer: ruff
install_extra: "test"
run_advanced_sast: true
# -- 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
# -*- coding: utf-8 -*-
#
# gwdatafind documentation build configuration file
......@@ -6,7 +5,7 @@ import glob
import os.path
import re
from gwdatafind import __version__ as VERSION
from gwdatafind import __version__ as gwdatafind_version
extensions = [
'sphinx.ext.intersphinx',
......@@ -22,14 +21,14 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'gwdatafind'
copyright = u'2018-2021, Cardiff University'
author = u'Duncan Macleod'
project = "gwdatafind"
copyright = "2018-2021, Cardiff University"
author = "Duncan Macleod"
# The short X.Y version.
version = re.split(r'[\w-]', VERSION)[0]
version = re.split(r'[\w-]', gwdatafind_version)[0]
# The full version, including alpha/beta/rc tags.
release = VERSION
release = gwdatafind_version
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
......
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2017-2022)
#
# This file is part of GWDataFind.
......
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2017-2022)
#
# This file is part of GWDataFind.
......@@ -25,8 +24,14 @@ import sys
from ligo import segments
from . import (__version__, ui)
from .io import (lal_cache, format_cache)
from . import (
__version__,
ui,
)
from .io import (
format_cache,
lal_cache,
)
from .utils import get_default_host
__author__ = 'Duncan Macleod <duncan.macleod@ligo.org>'
......@@ -51,13 +56,13 @@ class DataFindArgumentParser(argparse.ArgumentParser):
"""Create a new `DataFindArgumentParser`.
"""
kwargs.setdefault("formatter_class", DataFindFormatter)
super(DataFindArgumentParser, self).__init__(*args, **kwargs)
super().__init__(*args, **kwargs)
self._optionals.title = "Optional arguments"
def parse_args(self, *args, **kwargs):
"""Parse arguments with an extra sanity check.
"""
args = super(DataFindArgumentParser, self).parse_args(*args, **kwargs)
args = super().parse_args(*args, **kwargs)
args.show_urls = not any((args.ping, args.show_observatories,
args.show_types, args.show_times,
args.filename, args.latest))
......@@ -105,6 +110,7 @@ def command_line():
parser = DataFindArgumentParser(
description=__doc__,
)
parser.man_short_description = __doc__.splitlines()[0].lower().rstrip(".")
parser.add_argument(
"-V",
......
# -*- coding: utf-8 -*-
# Copyright (C) 2012-2015 Scott Koranda, 2015+ Duncan Macleod
#
# This program is free software; you can redistribute it and/or modify it
......
# -*- coding: utf-8 -*-
# Copyright (C) Cardiff University (2018-2022)
#
# This file is part of GWDataFind.
......