diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..c4bd94c2 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,36 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: end-of-file-fixer + exclude: test_data + - id: trailing-whitespace + exclude: test_data + - id: check-toml +- repo: https://github.com/pappasam/toml-sort + rev: v0.23.0 + hooks: + - id: toml-sort-fix +- repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black +# - repo: https://github.com/charliermarsh/ruff-pre-commit +# rev: 'v0.0.261' +# hooks: +# - id: ruff +- repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v1.1.1' + hooks: + - id: mypy + exclude: tests|test_data +- repo: local + hooks: + - id: pytest + name: pytest + entry: pytest + language: conda + pass_filenames: false + always_run: true +fail_fast: false diff --git a/pyproject.toml b/pyproject.toml index 65de09a0..3996a818 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,83 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=61.2" +] + +[project] +authors = [ + {email = "bwhmather@bwhmather.com", name = "Ben Mather"} +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Quality Assurance" +] +dependencies = [ + "pathspec >=0.9.0" +] +description = "The python statement sorter" +dynamic = [ + "version" +] +maintainers = [ + {email = "bwhmather@bwhmather.com", name = "Ben Mather"} +] +name = "ssort" +readme = "README.rst" +requires-python = ">=3.8" + +[project.license] +text = "MIT" + +[project.scripts] +ssort = "ssort._main:main" + +[project.urls] +Homepage = "https://github.com/bwhmather/ssort" + [tool.black] +force-exclude = 'test_data/samples/*' line_length = 79 +[tool.distutils.bdist_wheel] +universal = 1 + [tool.isort] -profile = "black" -multi_line_output = 3 +extend_skip = ["test_data/samples"] line_length = 79 +multi_line_output = 3 +profile = "black" [[tool.mypy.overrides]] -module = "pathspec" ignore_missing_imports = true +module = "pathspec" + +[tool.setuptools] +include-package-data = false +license-files = [ + "LICENSE" +] + +[tool.setuptools.dynamic.version] +attr = "ssort.__version__" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.tomlsort] +all = true +in_place = true +spaces_before_inline_comment = 2 +spaces_indent_inline_array = 4 + +[tool.tomlsort.overrides] +"project.classifiers".inline_arrays = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 1fa69640..00000000 --- a/setup.cfg +++ /dev/null @@ -1,43 +0,0 @@ -[bdist_wheel] -universal = 1 - -[metadata] -name = ssort -version = attr: ssort.__version__ -license = MIT -license_file = LICENSE -description = The python statement sorter -long_description = file: README.rst -author = Ben Mather -author_email = bwhmather@bwhmather.com -maintainer = Ben Mather -maintainer_email = bwhmather@bwhmather.com -url = https://github.com/bwhmather/ssort -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Topic :: Software Development :: Libraries :: Python Modules - Topic :: Software Development :: Quality Assurance - -[options] -package_dir= - =src -packages = find: - -install_requires = - pathspec >=0.9.0 -python_requires = >=3.8 - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - ssort = ssort._main:main diff --git a/setup.py b/setup.py deleted file mode 100644 index 435df652..00000000 --- a/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -import os -import sys - -import setuptools - -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) # noqa - -setuptools.setup() diff --git a/tests/test_bindings.py b/tests/test_bindings.py index 220f10d0..723785f0 100644 --- a/tests/test_bindings.py +++ b/tests/test_bindings.py @@ -849,7 +849,6 @@ def test_bool_op_bindings_walrus_multiple(): def test_bin_op_bindings(): - """ ..code:: python diff --git a/tests/test_requirements.py b/tests/test_requirements.py index 9122527f..378ab8fe 100644 --- a/tests/test_requirements.py +++ b/tests/test_requirements.py @@ -706,7 +706,6 @@ def test_named_expr_requirements(): def test_bin_op_requirements(): - """ ..code:: python @@ -995,7 +994,6 @@ def test_starred_requirements(): def test_name_requirements(): - """ ..code:: python @@ -1006,7 +1004,6 @@ def test_name_requirements(): def test_list_requirements(): - """ ..code:: python