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
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
Next Next commit
adding deprecation as dependency
  • Loading branch information
yaleman committed Mar 20, 2024
commit 13a99aaa39ed897a027e66d08d930a7976eb5647
47 changes: 23 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@

failed = False


def run_test_suite():
import unittest

@@ -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)
@@ -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 = []

@@ -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 = []

@@ -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 = []

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

setup(
author="Splunk, Inc.",

author_email="devinfo@splunk.com",

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",
@@ -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(),
)
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ deps = pytest
xmlrunner
unittest-xml-reporting
python-dotenv
deprecation

distdir = build
commands =