diff --git a/docs/source/conf.py b/docs/source/conf.py index 96d7f4516e0890608affbb71c970cff753cf8106..adcf82e96682c628a6fcfc3984b558329c0d48ea 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -49,16 +49,16 @@ master_doc = 'index' # General information about the project. project = u'LSMTool' -copyright = u'2019, David Rafferty' +copyright = u'2021, David Rafferty' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '1.4.1' +version = '1.4.3' # The full version, including alpha/beta/rc tags. -release = '1.4.1' +release = '1.4.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/lsmtool/_version.py b/lsmtool/_version.py index 1ee2275aa9a6036eded1875c4187c4e32bf98659..0e2c56937e2f33ac4d8ecbd3af810f98b158be9d 100644 --- a/lsmtool/_version.py +++ b/lsmtool/_version.py @@ -3,7 +3,7 @@ # This module stores the version and changelog # Version number -__version__ = '1.4.2' +__version__ = '1.4.3' # Change log def changelog(): @@ -11,6 +11,16 @@ def changelog(): LSMTool Changelog. ----------------------------------------------- + 2021/04/07 - Version 1.4.3 + + Publish on PyPI + + Add faster version of meanshift algorithm + + Fix to incorrect filtering with mask images + + Fix to Astropy registry check + 2019/10/01 - Version 1.4.2 Fix to incorrect header on write diff --git a/setup.py b/setup.py index 81b22d3d4372da0b6ae8f5a842557030055d3765..657524572ceb2263270b5b1afe603cd2e3e1e813 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,28 @@ from __future__ import print_function from setuptools import setup, Command, Extension, Distribution from setuptools.command.build_ext import build_ext +import os import sys -import lsmtool._version + + +# Functions read() and get_version() were copied from Pip package. +# Purpose is to get version info from current package without it +# being installed (which is usually the case when setup.py is run). +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + # intentionally *not* adding an encoding option to open, See: + # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 + with open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + # __version__ = "0.9" + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + raise RuntimeError("Unable to find version string.") # Flag that determines whether to build the optional (but faster) C++ @@ -39,7 +59,6 @@ class PyTest(Command): pass def run(self): - import sys import subprocess errno = subprocess.call([sys.executable, 'runtests.py']) raise SystemExit(errno) @@ -48,8 +67,7 @@ class PyTest(Command): class LSMToolDistribution(Distribution): def is_pure(self): - if self.pure: - return True + return self.pure def has_ext_modules(self): return not self.pure @@ -73,22 +91,29 @@ class BuildExt(build_ext): ext.extra_compile_args = opts build_ext.build_extensions(self) - setup( name='lsmtool', - version=lsmtool._version.__version__, - url='http://github.com/darafferty/lsmtool/', + version=get_version("lsmtool/_version.py"), + url='https://github.com/darafferty/LSMTool', + project_urls={ + "Documentation": "https://www.astron.nl/citt/lsmtool/", + "Source": "https://github.com/darafferty/LSMTool" + }, author='David Rafferty', author_email='drafferty@hs.uni-hamburg.de', description='The LOFAR Local Sky Model Tool', + long_description=read("README.md"), + long_description_content_type='text/markdown', + license="GPL", platforms='any', classifiers=[ + 'Development Status :: 5 - Production/Stable', 'Programming Language :: Python', 'Natural Language :: English', 'Intended Audience :: Science/Research', 'Topic :: Scientific/Engineering :: Astronomy', 'Topic :: Software Development :: Libraries :: Python Modules', - ], + ], install_requires=reqlist, scripts=['bin/lsmtool'], ext_modules=ext_modules, @@ -97,4 +122,4 @@ setup( packages=['lsmtool', 'lsmtool.operations'], setup_requires=['pytest-runner'], tests_require=['pytest'] - ) +)