Skip to content

Commit

Permalink
fix: properly import all modules
Browse files Browse the repository at this point in the history
  • Loading branch information
imathews committed Mar 23, 2021
1 parent 1c62559 commit f1686f9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Redivis
Copyright (c) 2021 Redivis Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,8 @@ python setup.py develop
You can then run the tests, e.g.:
```
REDIVIS_API_TOKEN=YOUR_TOKEN python tests
```
To upload to PyPi:
```
python setup.py upload
```
9 changes: 9 additions & 0 deletions redivis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
try:
import pkg_resources

pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)

from .common.Dataset import *
from .common.Table import *
31 changes: 23 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# -*- coding: utf-8 -*-

# Note: To use the 'upload' functionality of this file, you must:
# $ pipenv install twine --dev
# $ pipenv install twine wheel --dev

import io
import os
import sys
from shutil import rmtree

from setuptools import find_packages, setup, Command
import setuptools

# from setuptools import find_packages, setup, Command

# Package meta-data.
NAME = "redivis"
Expand All @@ -18,7 +20,7 @@
EMAIL = "support@redivis.com"
AUTHOR = "Redivis Inc."
REQUIRES_PYTHON = ">=3.6.0"
VERSION = "0.0.1"
VERSION = "0.0.5"

# Required dependencies
REQUIRED = ["google-cloud-bigquery == 1.25.0", "requests == 2.24.0"]
Expand Down Expand Up @@ -53,7 +55,7 @@
about["__version__"] = VERSION


class UploadCommand(Command):
class UploadCommand(setuptools.Command):
"""Support setup.py upload."""

description = "Build and publish the package."
Expand Down Expand Up @@ -90,8 +92,19 @@ def run(self):
sys.exit()


# Only include packages under the 'redivis' namespace. Do not include tests,
# benchmarks, etc.
packages = [
package
for package in setuptools.PEP420PackageFinder.find()
if package.startswith("redivis")
]

# Determine which namespaces are needed.
namespaces = ["redivis"]

# Where the magic happens:
setup(
setuptools.setup(
name=NAME,
version=about["__version__"],
description=DESCRIPTION,
Expand All @@ -101,9 +114,11 @@ def run(self):
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=[
"redivis"
], # find_packages(where="redivis", exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
packages=packages,
namespace_packages=namespaces,
# packages=[
# "redivis"
# ], # find_packages(where="redivis", exclude=["tests", "*.tests", "*.tests.*", "tests.*"]),
install_requires=REQUIRED,
extras_require=EXTRAS,
include_package_data=True,
Expand Down

0 comments on commit f1686f9

Please sign in to comment.