diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f014add14e56cde06af73f51fbf321f08503db37..b110e0b05fc12cf93b6d6a101cf49d1b82ce0d34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -30,7 +31,7 @@ pages: # Build receipe for standalone wheels on Linux -build:wheel: +wheel: stage: build script: - pip install wheel @@ -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 \ No newline at end of file +deploy:wheel: + stage: deploy + script: + - pip install twine + - twine upload dist/* + artifacts: + expire_in: 3h + paths: + - dist + only: + - master + #only: + # - tags + # except: + # - pushes + # - web \ No newline at end of file diff --git a/minke/mdctools.py b/minke/mdctools.py index 3e0e4dd4a7fe6babfa5070b56655113e69031730..fb2b4d94bee04be7c5dbe60ae2f8c8477cc915e3 100644 --- a/minke/mdctools.py +++ b/minke/mdctools.py @@ -603,7 +603,7 @@ class Frame(): # 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 diff --git a/requirements.txt b/requirements.txt index 8fed041814e4c61a208c50efb42b469c07f988e0..fb6c7ed7ec60dafcf523d2e12daa17abc92ae384 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1 @@ -numpy -scipy -matplotlib pandas diff --git a/setup.py b/setup.py index 74d73b335ef62c7c1a50e111edd57d1811685143..13d1a5fff8fb2a87f4a0c5a27c10f9f3fc5c6f2d 100755 --- a/setup.py +++ b/setup.py @@ -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 @@ -14,27 +15,37 @@ with open('README.rst') as readme_file: 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', @@ -42,6 +53,7 @@ setup( package_dir={'minke': 'minke'}, include_package_data=True, + setup_requires = setup_requirements, install_requires=requirements, license="ISCL", zip_safe=False,