diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d602817..ecae48a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,11 +5,11 @@ jobs: strategy: matrix: python: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" runs-on: ubuntu-latest steps: - name: Checkout diff --git a/setup.py b/setup.py index 94a1698..8a08045 100644 --- a/setup.py +++ b/setup.py @@ -2,31 +2,10 @@ import sys from setuptools import setup, find_packages -from setuptools.command.test import test as TestCommand __version__ = "0.0.26" -class PyTest(TestCommand): - user_options = [("pytest-args=", "a", "Arguments to pass to py.test")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = ["-x", "tests"] - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - # import here, cause outside the eggs aren't loaded - import pytest - - errno = pytest.main(self.pytest_args) - sys.exit(errno) - - def readme(): with open("README.rst") as f: return f.read() @@ -44,11 +23,11 @@ def readme(): "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Intended Audience :: Developers", ], keywords="validate CSV vampires", @@ -63,7 +42,6 @@ def readme(): install_requires=[], extras_require={"s3": ["boto"]}, tests_require=["pretend", "pytest", 'black;python_version>="3.6"'], - cmdclass={"test": PyTest}, entry_points={ "console_scripts": [ "vladiate = vladiate.main:main", diff --git a/tests/test_main.py b/tests/test_main.py index 838b552..4cf5a8f 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -29,7 +29,7 @@ def test_parse_args(): assert options.processes == 1 assert options.show_version is False assert options.vladfile == "vladfile" - assert options.vlads == ["test"] + assert options.vlads == ["tests"] @pytest.mark.parametrize( diff --git a/tox.ini b/tox.ini index f50ed87..48f3cb2 100644 --- a/tox.ini +++ b/tox.ini @@ -12,8 +12,9 @@ deps = black [testenv] -commands = coverage run --append --source=vladiate setup.py test +commands = coverage run --append --source=vladiate -m pytest tests deps = + pretend pytest coverage diff --git a/vladiate/main.py b/vladiate/main.py index d04ba86..b18f3a3 100644 --- a/vladiate/main.py +++ b/vladiate/main.py @@ -1,3 +1,4 @@ +from importlib.metadata import version from multiprocessing import Pool, Queue from vladiate import Vlad from vladiate import logs @@ -7,7 +8,6 @@ import sys import inspect from argparse import ArgumentParser -from pkg_resources import get_distribution def parse_args(): @@ -187,7 +187,7 @@ def main(): logger = logs.logger if arguments.show_version: - print("Vladiate %s" % (get_distribution("vladiate").version,)) + print("Vladiate %s" % (version("vladiate"),)) return exits.OK vladfile = find_vladfile(arguments.vladfile)