Skip to content

Commit

Permalink
feat: replace setup.py by pyproject.toml according to PEP 518 (#319)
Browse files Browse the repository at this point in the history
Replace setup.py by pyproject.toml according to PEP 518 and drop python 3.6 support.

---------

Signed-off-by: Roald Nefs <info@roaldnefs.com>
  • Loading branch information
roaldnefs committed Jan 8, 2024
1 parent fc5151a commit 4414e7c
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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__"}
13 changes: 2 additions & 11 deletions saltlint/__init__.py
Original file line number Diff line number Diff line change
@@ -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'
8 changes: 4 additions & 4 deletions saltlint/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au>
# Modified work Copyright (c) 2020 Warpnet B.V.
# Modified work Copyright (c) 2020-2024 Warpnet B.V.

from __future__ import print_function

Expand All @@ -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
Expand Down Expand Up @@ -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',
Expand Down
88 changes: 0 additions & 88 deletions setup.py

This file was deleted.

7 changes: 2 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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}
Expand Down

0 comments on commit 4414e7c

Please sign in to comment.