Skip to content
Snippets Groups Projects
Unverified Commit 172ff7ab authored by David Rafferty's avatar David Rafferty Committed by GitHub
Browse files

Merge pull request #19 from darafferty/create-pip-package

Prepare to publish on PyPI
parents fb31a64d 2248681f
No related branches found
No related tags found
No related merge requests found
...@@ -49,16 +49,16 @@ master_doc = 'index' ...@@ -49,16 +49,16 @@ master_doc = 'index'
# General information about the project. # General information about the project.
project = u'LSMTool' 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 # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '1.4.1' version = '1.4.3'
# The full version, including alpha/beta/rc tags. # 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 # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# This module stores the version and changelog # This module stores the version and changelog
# Version number # Version number
__version__ = '1.4.2' __version__ = '1.4.3'
# Change log # Change log
def changelog(): def changelog():
...@@ -11,6 +11,16 @@ def changelog(): ...@@ -11,6 +11,16 @@ def changelog():
LSMTool 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 2019/10/01 - Version 1.4.2
Fix to incorrect header on write Fix to incorrect header on write
......
from __future__ import print_function from __future__ import print_function
from setuptools import setup, Command, Extension, Distribution from setuptools import setup, Command, Extension, Distribution
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
import os
import sys 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++ # Flag that determines whether to build the optional (but faster) C++
...@@ -39,7 +59,6 @@ class PyTest(Command): ...@@ -39,7 +59,6 @@ class PyTest(Command):
pass pass
def run(self): def run(self):
import sys
import subprocess import subprocess
errno = subprocess.call([sys.executable, 'runtests.py']) errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno) raise SystemExit(errno)
...@@ -48,8 +67,7 @@ class PyTest(Command): ...@@ -48,8 +67,7 @@ class PyTest(Command):
class LSMToolDistribution(Distribution): class LSMToolDistribution(Distribution):
def is_pure(self): def is_pure(self):
if self.pure: return self.pure
return True
def has_ext_modules(self): def has_ext_modules(self):
return not self.pure return not self.pure
...@@ -73,16 +91,23 @@ class BuildExt(build_ext): ...@@ -73,16 +91,23 @@ class BuildExt(build_ext):
ext.extra_compile_args = opts ext.extra_compile_args = opts
build_ext.build_extensions(self) build_ext.build_extensions(self)
setup( setup(
name='lsmtool', name='lsmtool',
version=lsmtool._version.__version__, version=get_version("lsmtool/_version.py"),
url='http://github.com/darafferty/lsmtool/', 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='David Rafferty',
author_email='drafferty@hs.uni-hamburg.de', author_email='drafferty@hs.uni-hamburg.de',
description='The LOFAR Local Sky Model Tool', description='The LOFAR Local Sky Model Tool',
long_description=read("README.md"),
long_description_content_type='text/markdown',
license="GPL",
platforms='any', platforms='any',
classifiers=[ classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python', 'Programming Language :: Python',
'Natural Language :: English', 'Natural Language :: English',
'Intended Audience :: Science/Research', 'Intended Audience :: Science/Research',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment