Skip to content
Snippets Groups Projects
Commit 4cfd6ec3 authored by Duncan Macleod's avatar Duncan Macleod
Browse files

Merge branch 'pep-517' into 'master'

Migrate package metadata to setup.cfg file

See merge request !42
parents 6add884f 914e8144
No related branches found
No related tags found
No related merge requests found
include LICENSE
include LICENSE README.md
recursive-include config *.conf *.conf.py *.ini *.service
recursive-include debian *
recursive-include tests *
......
[build-system]
requires = [
"setuptools>=42",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.coverage.run]
source = ["gwdatafind_server"]
[tool.pytest.ini_options]
addopts = "-r a"
filterwarnings = [
"error",
]
......@@ -21,6 +21,18 @@ BuildRequires: python3-rpm-macros
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: systemd
# these are needed for setuptools to parse the version number
# out of gwdatafind_server/__init__.py, but only because setuptools
# is so old on rhel (< 46.4.0, https://github.com/pypa/setuptools/pull/1753)
%if 0%{?rhel} > 0 && 0%{?rhel} < 9
BuildRequires: python%{python3_pkgversion}-configobj
BuildRequires: python%{python3_pkgversion}-flask
BuildRequires: python%{python3_pkgversion}-ligo-segments
BuildRequires: python%{python3_pkgversion}-scitokens
# https://git.ligo.org/computing/packaging/rhel/python-configobj/-/issues/1
BuildRequires: python%{python3_pkgversion}-six
%endif
# -- src.rpm
%description
......
; -- build
[metadata]
name = gwdatafind-server
version = attr: gwdatafind_server.__version__
author = Duncan Meacher
author_email = duncan.meacher@ligo.org
license = GPL-3.0-or-later
license_files = LICENSE
description = The server library for the GWDataFind service
long_description = file: README.md
long_description_content_type = text/markdown
url = https://git.ligo.org/computing/gwdatafind/server
classifiers =
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Natural Language :: English
Operating System :: Unix
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
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Physics
project_urls =
Bug Tracker = https://git.ligo.org/computing/gwdatafind/server/-/issues
Documentation = https://computing.docs.ligo.org/gwdatafind/server/
Source Code = https://git.ligo.org/computing/gwdatafind/server
[options]
packages = find:
python_version = >=3.6
install_requires =
configobj
flask >= 1.0.0
ligo-segments
scitokens
[options.extras_require]
test =
pytest
docs =
mkdocs
; -- tools
[flake8]
exclude =
......
# -*- coding: utf-8 -*-
# Copyright (2019) Cardiff University
# Copyright (2022) Cardiff University
# Licensed under GPLv3+ - see LICENSE
import re
from pathlib import Path
__author__ = "Duncan Macleod <duncan.macleod@ligo.org>"
from setuptools import (setup, find_packages)
from setuptools import setup
# -- utilities ----------------------------------
def find_version(path):
"""Parse the __version__ metadata in the given file.
"""
with Path(path).open("r") as fp:
version_file = fp.read()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# -- dependencies -------------------------------
install_requires = [
"setuptools",
"flask >= 1.0.0",
"configobj",
"ligo-segments",
"scitokens",
]
# -- setup --------------------------------------
setup(
# metadata
name="gwdatafind-server",
version=find_version(Path("gwdatafind_server") / "__init__.py"),
author="Duncan Macleod",
author_email="duncan.macleod@ligo.org",
description="The server library for the GWDataFind service",
license="GPLv3",
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
url="https://git.ligo.org/gwdatafind/gwdatafind-server",
classifiers=[
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics",
],
# dependencies
install_requires=install_requires,
# content
packages=find_packages(),
include_package_data=True,
)
setup()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment