Skip to content

Commit

Permalink
Merge pull request #1191 from sjsrey/2.3.0
Browse files Browse the repository at this point in the history
2.3.0
  • Loading branch information
sjsrey committed Jul 30, 2020
2 parents d1a1f7d + 883717f commit 94b7eed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
7 changes: 2 additions & 5 deletions pysal/__init__.py
@@ -1,12 +1,8 @@
__version__ = '2.3.0'

"""
PySAL: Python Spatial Analysis Library
======================================
Contents
--------
pysal imports federation information
A federation of packages for spatial data science.
Layers and Subpackages
Expand Down Expand Up @@ -57,3 +53,4 @@
"""
from .base import memberships, federation_hierarchy, versions
__version__ = '2.3.0'
19 changes: 15 additions & 4 deletions setup.py
@@ -1,5 +1,6 @@
# coding: utf-8

import codecs
import os.path
from setuptools import setup, find_packages

from distutils.command.build_py import build_py
Expand All @@ -9,9 +10,19 @@
with open('README.md') as file:
long_description = file.read()

with open('pysal/__init__.py', 'r') as f:
exec(f.readline())

def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.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__'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")

print(find_packages())
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
Expand Down Expand Up @@ -44,7 +55,7 @@ def setup_package():
extras_reqs = reqs
setup(
name='pysal',
version=__version__,
version=get_version('pysal/__init__.py'),
description="A library of spatial analysis functions.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 94b7eed

Please sign in to comment.