Skip to content
Snippets Groups Projects
Commit 2d3a44f8 authored by Jameson Rollins's avatar Jameson Rollins
Browse files

update setuptools config and create version support

using setuptools_scm
parent aed85d9e
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ gwinc/base:
cat <<EOF > Dockerfile
FROM igwn/base:buster
RUN apt-get update -qq
RUN apt-get -y install --no-install-recommends git python3-gitlab python3 python3-yaml python3-scipy python3-matplotlib python3-lalsimulation python3-pypdf2 python3-h5py
RUN apt-get -y install --no-install-recommends git python3 python3-gitlab python3-setuptools-scm python3-yaml python3-scipy python3-matplotlib python3-lalsimulation python3-pypdf2 python3-h5py
RUN git clone https://gitlab-ci-token:ci_token@git.ligo.org/gwinc/inspiral_range.git
EOF
- docker build -t $IMAGE_TAG .
......
include CONTRIBUTIONS.md
include setup.cfg
include tox.ini
recursive-include gwinc *.yaml
recursive-include matlab *.m
recursive-include docs *
exclude IFO.md
global-exclude *.git*
prune docs
prune matlab
......@@ -5,6 +5,11 @@ import logging
import importlib
import numpy as np
try:
from ._version import __version__
except ModuleNotFoundError:
import setuptools_scm
__version__ = setuptools_scm.get_version()
from .ifo import IFOS
from .struct import Struct
from .plot import plot_budget
......
......@@ -5,6 +5,7 @@ import logging
import argparse
from . import (
__version__,
IFOS,
DEFAULT_FREQ,
freq_from_spec,
......@@ -66,6 +67,8 @@ parser = argparse.ArgumentParser(
prog='gwinc',
description=description,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument(
'--version', '-v', action='version', version=__version__)
parser.add_argument(
'--freq', '-f', metavar='FLO:[NPOINTS:]FHI',
help="logarithmic frequency array specification in Hz [{}]".format(DEFAULT_FREQ))
......
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
[aliases]
test=pytest
# [bdist_wheel]
# universal=1
[flake8]
exclude =
gwinc/_version.py
versioneer.py
ignore = D100,D102,D104,D107,D205,D400
[coverage:run]
source = gwinc
omit =
gwinc/_version.py
gwinc/test/*
[metadata]
description-file = README.rst
name = gwinc
license = UNLICENSE
license_file = LICENSE
author = LIGO Scientific Collaboration
author_email = jameson.rollins@ligo.org
description = Gravitation Wave Interferometer Noise Calculator
long_description = file:README.md
long_description_content_type = text/markdown
url = https://git.ligo.org/gwinc/pygwinc
classifiers =
Development Status :: 4 - Beta
Environment :: Console
License :: OSI Approved :: The Unlicense (Unlicense)
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Astronomy
Topic :: Scientific/Engineering :: Physics
Intended Audience :: Science/Research
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
project_urls =
Bug Tracker = https://git.ligo.org/gwinc/pygwinc/issues
Source Code = https://git.ligo.org/gwinc/pygwinc
[options]
packages = find:
python_requires = >=3.6
install_requires =
h5py
ipython
matplotlib
numpy
pyyaml
scipy
tests_require =
PyPDF2
[versioneer]
VCS = git
versionfile_build = gwinc/_version.py
versionfile_source = gwinc/_version.py
tag_prefix = v
parentdir_prefix = gwinc-
setup.py 100755 → 100644
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
# import sys
# import versioneer
from setuptools import setup
version = '0.1'
# if {'build_sphinx'}.intersection(sys.argv):
# setup_requires.append('sphinx')
# if {'pytest', 'test', 'ptr'}.intersection(sys.argv):
# setup_requires.append('pytest-runner')
setup_args = dict(
name = 'pygwinc',
version = version,
url = 'https://git.ligo.org/gwinc/pygwinc',
author = 'LIGO Laboratory',
author_email = 'jrollins@ligo.caltech.edu ',
description = "Gravitation Wave Interferometer Noise Calculator",
license = 'Copyright 2018 LIGO Laboratory',
keywords = 'Noise, LIGO, Gravitational Wave,',
classifiers = [
'Topic :: Scientific/Engineering',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
setup(
setup_requires=[
'setuptools >= 30.3.0',
'setuptools_scm',
],
install_requires = [
'h5py',
'ipython',
'matplotlib',
'numpy',
'PyPDF2',
'pyyaml',
'scipy',
],
packages = find_packages(
exclude = ['docs',],
),
entry_points={
'console_scripts': [
'gwinc = gwinc.__main__:main',
],
},
include_package_data = True,
zip_safe = False,
use_scm_version={
'write_to': 'gwinc/_version.py',
'write_to_template': '__version__ = "{version}"',
}
# version=versioneer.get_version(),
# cmdclass=versioneer.get_cmdclass(),
)
if __name__ == "__main__":
setup(**setup_args)
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist =
py27
py34
py35
py36
py37
py38
[testenv]
setenv =
PYTHONPATH = ''
deps =
deps =
h5py
pytest
pytest-xdist
pytest-benchmark
......@@ -20,5 +18,3 @@ deps =
scipy
commands=python -m gwinc.test
pip_pre=True
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