Skip to content

Commit

Permalink
Added some more small enhancements, SCM versioning, and pypi autodepl…
Browse files Browse the repository at this point in the history
…oy from master to test warehouse.
  • Loading branch information
transientlunatic committed Mar 12, 2018
1 parent ffb72b3 commit 1d8256f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 32 deletions.
41 changes: 20 additions & 21 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ test:
stage: test
script:
- export PYTHONPATH="/usr/local/lib64/python2.7/site-packages:/usr/local/lib/python2.7/site-packages"
- pip install pandas numpy
- echo "pandas" > requirements.txt
- pip install -r requirements.txt
- python setup.py install
- python setup.py test
# As a temporary measure
Expand All @@ -30,7 +31,7 @@ pages:


# Build receipe for standalone wheels on Linux
build:wheel:
wheel:
stage: build
script:
- pip install wheel
Expand All @@ -40,23 +41,21 @@ build:wheel:
artifacts:
expire_in: 3h
paths:
- wheelhouse
- dist



# deploy:wheel:
# stage: deploy
# image: containers.ligo.org/lscsoft/lalsuite-manylinux:master
# script:
# - /opt/python/cp36-cp36m/bin/pip install twine
# - /opt/python/cp36-cp36m/bin/twine upload wheelhouse/*

# artifacts:
# expire_in: 3h
# paths:
# - wheelhouse
# only:
# - master@lscsoft/lalsuite
# except:
# - pushes
# - web
deploy:wheel:
stage: deploy
script:
- pip install twine
- twine upload dist/*
artifacts:
expire_in: 3h
paths:
- dist
only:
- master
#only:
# - tags
# except:
# - pushes
# - web
2 changes: 1 addition & 1 deletion minke/mdctools.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ def generate_gwf(self, mdc, directory, channel="SCIENCE", force=False, rate=1638
# Loop through each interferometer
for ifo in self.ifos:
# Calculate the number of samples in the timeseries
nsamp = (self.end-self.start)*rate
nsamp = int((self.end-self.start)*rate)
# Make the timeseries
h_resp = lal.CreateREAL8TimeSeries("inj time series", epoch, 0, 1.0/rate, lal.StrainUnit, nsamp)
# Loop over all of the injections corresponding to this frame
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
numpy
scipy
matplotlib
pandas
26 changes: 19 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools.command.build_ext import build_ext as _build_ext

try:
from setuptools import setup
Expand All @@ -14,34 +15,45 @@
with open('HISTORY.rst') as history_file:
history = history_file.read()

requirements = [
'numpy',
'matplotlib',
'pandas',
'scipy',
# see https://stackoverflow.com/a/21621689/1862861 for why this is here
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())

setup_requirements = [
'numpy',
'setuptools_scm'
]

with open("requirements.txt") as requires_file:
requirements = requires_file.read().split("\n")

test_requirements = [
"py",
"pytest",
"coverage"
# TODO: put package test requirements here
]

setup(
name='minke',
version='1.0.1',
use_scm_version=True,
description="Minke is a Python package to produce Mock Data Challenge data sets for LIGO interferometers.",
long_description=readme + '\n\n' + history,
author="Daniel Williams",
author_email='d.williams.2@research.gla.ac.uk',
author_email='daniel.williams@ligo.org',
url='https://github.com/transientlunatic/minke',
packages=[
'minke',
],
package_dir={'minke':
'minke'},
include_package_data=True,
setup_requires = setup_requirements,
install_requires=requirements,
license="ISCL",
zip_safe=False,
Expand Down

0 comments on commit 1d8256f

Please sign in to comment.