diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 85fe447..e397587 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bad2c5..2a6f8c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes in **salt-lint** are documented below. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Deprecated +- Drop Python 3.6 support ([#319](https://github.com/warpnet/salt-lint/pull/319)). + ### Added - Add Python 3.12 support ([#315](https://github.com/warpnet/salt-lint/pull/315)). - Lookup configuration file in parent directory ([#305](https://github.com/warpnet/salt-lint/pull/305)). diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2b652ae --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,59 @@ +[build-system] +requires = [ + "setuptools >= 65.3.0", +] +build-backend = "setuptools.build_meta" + +[project] +dynamic = ["version"] +name = "salt-lint" +description = "A command-line utility that checks for best practices in SaltStack." +readme = "README.md" +requires-python = ">=3.7" +authors = [ + {name = "Roald Nefs", email = "roald.nefs@warpnet.nl"}, +] +maintainers = [ + {name = "Roald Nefs", email = "roald.nefs@warpnet.nl"}, + {name = "Jeffrey Bouter", email = "jeffrey.bouter@warpnet.nl"}, +] +license = {text = "MIT License"} +keywords = ['salt', 'saltstack', 'lint', 'linter', 'checker'] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: System Administrators", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "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", + "Topic :: Software Development :: Bug Tracking", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + "Topic :: Utilities", +] +dependencies = [ + "pyyaml", + "pathspec>=0.6.0", +] + +[project.scripts] +salt-lint = "saltlint.cli:run" + +[project.urls] +homepage = "https://github.com/warpnet/salt-lint" +documentation = "https://salt-lint.readthedocs.io/en/latest/" +repository = "https://github.com/warpnet/salt-lint" +issues = "https://github.com/warpnet/salt-lint/issues" +changelog = "https://raw.githubusercontent.com/warpnet/salt-lint/main/CHANGELOG.md" + +[tool.setuptools.dynamic] +version = {attr = "saltlint.__version__"} diff --git a/saltlint/__init__.py b/saltlint/__init__.py index 7bfd8b3..bcf732b 100644 --- a/saltlint/__init__.py +++ b/saltlint/__init__.py @@ -1,13 +1,4 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2020-2023 Warpnet B.V. +# Copyright (c) 2020-2024 Warpnet B.V. -"""A command-line utility that checks for best practices in SaltStack. -""" - -NAME = 'salt-lint' -VERSION = '0.9.2' -DESCRIPTION = __doc__ - -__author__ = 'Warpnet B.V.' -__license__ = 'MIT' -__version__ = VERSION +__version__ = '0.9.2' diff --git a/saltlint/cli.py b/saltlint/cli.py index 4824e75..be37536 100644 --- a/saltlint/cli.py +++ b/saltlint/cli.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Will Thames -# Modified work Copyright (c) 2020 Warpnet B.V. +# Modified work Copyright (c) 2020-2024 Warpnet B.V. from __future__ import print_function @@ -9,7 +9,7 @@ import sys import tempfile -from saltlint import NAME, VERSION, DESCRIPTION +from saltlint import __version__ from saltlint import formatters from saltlint.config import Configuration, SaltLintConfigError, default_rulesdir from saltlint.linter.collection import RulesCollection @@ -80,13 +80,13 @@ def run(args=None): def init_argument_parser(): """Returns a new initialized argument parser.""" - parser = argparse.ArgumentParser(prog=NAME, description=DESCRIPTION) + parser = argparse.ArgumentParser() # The files argument is optional as STDIN is always read parser.add_argument(dest='files', metavar='FILE', nargs='*', default=[], help='one or more files or paths') - parser.add_argument('--version', action='version', version='%(prog)s {}'.format(VERSION)) + parser.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__)) parser.add_argument('-L', dest='listrules', default=False, action='store_true', help="list all the rules") parser.add_argument('-r', action='append', dest='rulesdir', diff --git a/setup.py b/setup.py deleted file mode 100644 index 3a467c3..0000000 --- a/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2013-2018 Will Thames -# Copyright (c) 2018 Ansible by Red Hat -# Modified work Copyright (c) 2019-2023 Warpnet B.V. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -from setuptools import setup, find_packages - -from saltlint import (__author__, __license__, - NAME, VERSION, DESCRIPTION) - - -def long_description(): - """ - Returns the long description containing both the README.md and CHANGELOG.md - files. - """ - # Read content from the README.md file - with open('README.md', encoding='utf-8') as readme_file: - readme = readme_file.read() - - # Read content from the CHANGELOG.md file - with open('CHANGELOG.md', encoding='utf-8') as changelog_file: - changelog = changelog_file.read() - - return readme + changelog - - -setup( - name=NAME, - version=VERSION, - description=DESCRIPTION.split('\n')[0], # pylint: disable=C0207 - long_description=long_description(), - long_description_content_type='text/markdown', - author=__author__, - author_email='info@warpnet.nl', - url='https://github.com/warpnet/salt-lint', - packages=find_packages(exclude=['tests', 'tests.*']), - entry_points={ - 'console_scripts': [ - 'salt-lint = saltlint.cli:run', - ] - }, - include_package_data=True, - python_requires='>=3.6', - install_requires=['pyyaml', 'pathspec>=0.6.0'], - license=__license__, - zip_safe=False, - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'Operating System :: OS Independent', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - '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', - 'Topic :: Software Development :: Bug Tracking', - 'Topic :: Software Development :: Quality Assurance', - 'Topic :: Software Development :: Testing', - 'Topic :: Utilities', - ], - keywords=['salt', 'saltstack', 'lint', 'linter', 'checker'] -) diff --git a/tox.ini b/tox.ini index 093c1d8..97198d4 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,8 @@ # install tox" and then run "tox" from this directory. [tox] -envlist = lint,{py36,py37,py38,py39,py310,py311,py312}-install,mypy +isolated_build = True +envlist = lint,{py37,py38,py39,py310,py311,py312}-install,mypy skip_missing_interpreters = True [testenv] @@ -27,10 +28,6 @@ commands = python setup.py bdist_wheel pip install --no-index --find-links=dist salt-lint -[testenv:py36-install] -skip_install = {[testenv:install]skip_install} -commands = {[testenv:install]commands} - [testenv:py37-install] skip_install = {[testenv:install]skip_install} commands = {[testenv:install]commands}