Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding deprecation as dependency #568

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

failed = False


def run_test_suite():
import unittest

Expand All @@ -42,11 +43,12 @@ def addFailure(self, test, err):
class TrackingTextTestRunner(unittest.TextTestRunner):
def _makeResult(self):
return _TrackingTextTestResult(
self.stream, self.descriptions, self.verbosity)
self.stream, self.descriptions, self.verbosity
)

original_cwd = os.path.abspath(os.getcwd())
os.chdir('tests')
suite = unittest.defaultTestLoader.discover('.')
os.chdir("tests")
suite = unittest.defaultTestLoader.discover(".")
runner = TrackingTextTestRunner(verbosity=2)
runner.run(suite)
os.chdir(original_cwd)
Expand All @@ -60,15 +62,17 @@ def run_test_suite_with_junit_output():
except ImportError:
import unittest
import xmlrunner

original_cwd = os.path.abspath(os.getcwd())
os.chdir('tests')
suite = unittest.defaultTestLoader.discover('.')
xmlrunner.XMLTestRunner(output='../test-reports').run(suite)
os.chdir("tests")
suite = unittest.defaultTestLoader.discover(".")
xmlrunner.XMLTestRunner(output="../test-reports").run(suite)
os.chdir(original_cwd)


class CoverageCommand(Command):
"""setup.py command to run code coverage of the test suite."""

description = "Create an HTML coverage report from running the full test suite."
user_options = []

Expand All @@ -84,15 +88,16 @@ def run(self):
except ImportError:
print("Could not import coverage. Please install it and try again.")
exit(1)
cov = coverage.coverage(source=['splunklib'])
cov = coverage.coverage(source=["splunklib"])
cov.start()
run_test_suite()
cov.stop()
cov.html_report(directory='coverage_report')
cov.html_report(directory="coverage_report")


class TestCommand(Command):
"""setup.py command to run the whole test suite."""

description = "Run test full test suite."
user_options = []

Expand All @@ -110,6 +115,7 @@ def run(self):

class JunitXmlTestCommand(Command):
"""setup.py command to run the whole test suite."""

description = "Run test full test suite with JUnit-formatted output."
user_options = []

Expand All @@ -125,28 +131,19 @@ def run(self):

setup(
author="Splunk, Inc.",

author_email="[email protected]",

cmdclass={'coverage': CoverageCommand,
'test': TestCommand,
'testjunit': JunitXmlTestCommand},

cmdclass={
"coverage": CoverageCommand,
"test": TestCommand,
"testjunit": JunitXmlTestCommand,
},
description="The Splunk Software Development Kit for Python.",

license="http://www.apache.org/licenses/LICENSE-2.0",

name="splunk-sdk",

packages = ["splunklib",
"splunklib.modularinput",
"splunklib.searchcommands"],

packages=["splunklib", "splunklib.modularinput", "splunklib.searchcommands"],
url="http://github.com/splunk/splunk-sdk-python",

version=splunklib.__version__,

classifiers = [
classifiers=[
"Programming Language :: Python",
"Development Status :: 6 - Mature",
"Environment :: Other Environment",
Expand All @@ -156,4 +153,6 @@ def run(self):
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries :: Application Frameworks",
],
install_requires=["deprecation"],
readme=open("README.md").read(),
yaleman marked this conversation as resolved.
Show resolved Hide resolved
)
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ deps = pytest
xmlrunner
unittest-xml-reporting
python-dotenv
deprecation

distdir = build
commands =
Expand Down