Skip to content

Commit

Permalink
fix: update pypi package name (#454)
Browse files Browse the repository at this point in the history
* feat: add PyPI release support

* fix: update package name

Fixes #455 

* deps: remove dependency on google-cloud

* chore: added extra fields to setup.py

* fix: single-source the version

* fix: made setup.py consistent with client lib

* fix: removed comment that no longer applies

* fix: only support python version >=3.5

* add missing os import

* add missing io import

* fix README file extension

* add missing pkg_resources import

* fix import ordering

Co-authored-by: larkee <larkee@users.noreply.github.com>
  • Loading branch information
skuruppu and larkee committed May 26, 2020
1 parent e8c5afc commit 47154d1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
3 changes: 2 additions & 1 deletion django_spanner/__init__.py
Expand Up @@ -9,6 +9,7 @@
# do that.
from uuid import uuid4

import pkg_resources
from django.db.models.fields import AutoField, Field
# Monkey-patch google.DatetimeWithNanoseconds's __eq__ compare against datetime.datetime.
from google.api_core.datetime_helpers import DatetimeWithNanoseconds
Expand All @@ -18,7 +19,7 @@
from .lookups import register_lookups
from .utils import check_django_compatability

__version__ = '2.2a0'
__version__ = pkg_resources.get_distribution("django-google-spanner").version

check_django_compatability()
register_expressions()
Expand Down
42 changes: 32 additions & 10 deletions setup.py
Expand Up @@ -4,30 +4,50 @@
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd

import io
import os

from setuptools import find_packages, setup

version = '2.2a0'
# Package metadata.

install_requires = [
name = "django-google-spanner"
description = "Bridge to enable using Django with Spanner."
version = "2.2a0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 3 - Alpha"
dependencies = [
'sqlparse >= 0.3.0',
'google-cloud >= 0.34.0',
'google-cloud-spanner >= 1.8.0',
]
extras = {}


# Setup boilerplate below this line.

package_root = os.path.abspath(os.path.dirname(__file__))

readme_filename = os.path.join(package_root, "README.md")
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()


setup(
name='django-spanner',
# Duplicate version here rather than using
# __import__('django_spanner').__version__ because that file imports
# django and google.cloud which may not be installed.
name=name,
version=version,
description=description,
long_description=readme,
author='Google LLC',
author_email='cloud-spanner-developers@googlegroups.com',
description=('Bridge to enable using Django with Spanner.'),
license='BSD',
packages=find_packages(exclude=['tests']),
install_requires=install_requires,
install_requires=dependencies,
url="https://github.com/googleapis/python-spanner-django",
classifiers=[
'Development Status :: 4 - Beta',
release_status,
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD',
Expand All @@ -40,4 +60,6 @@
'Framework :: Django',
'Framework :: Django :: 2.2',
],
extras_require=extras,
python_requires=">=3.5",
)

0 comments on commit 47154d1

Please sign in to comment.