Skip to content

Commit

Permalink
chore: drop usage of setup.cfg & setup.py (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
hille721 authored Sep 16, 2024
1 parent 13c6ee0 commit d110205
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 82 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,19 @@ jobs:

# build & publish to PyPI
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
if: ${{ steps.release.outputs.release_created }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
if: ${{ steps.release.outputs.release_created }}
- name: Build package
run: python -m build
if: ${{ steps.release.outputs.release_created }}

- name: Publish package
uses: pypa/gh-action-pypi-publish@0ab0b79471669eb3a4d647e625009c62f9f3b241
Expand Down
72 changes: 68 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,83 @@
# for now only be used for black and ruff config
# maybe in the future we will use it instead of setup.py / setup.cfg
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "ansible-variables"
version = "0.7.2"
dependencies = [
"ansible-core>=2.11.0",
"rich"
]
requires-python = ">=3.8"
authors = [
{"name" = "Christoph Hille", "email" = "[email protected]"}
]
description = "Keep track of Ansible host context variables"
readme = "README.md"
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: POSIX",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: 3 :: Only",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Systems Administration",
"Topic :: Utilities",
]

[project.urls]
Homepage = "https://github.com/hille721/ansible-variables"
Documentation = "https://github.com/hille721/ansible-variables/blob/main/README.md"
Repository = "https://github.com/hille721/ansible-variables.git"
"Bug Tracker" = "https://github.com/hille721/ansible-variables/issues"
Changelog = "https://github.com/hille721/ansible-variables/blob/master/CHANGELOG.md"

[project.scripts]
ansible-variables = "ansible_variables.cli.variables:main"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["lib"]
exclude = ["tests"]

[tool.black]
line-length = 120

[tool.pylint.format]
max-line-length = 120

[tool.pylint."message control"]
disable= ["C", "R"]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
select = [
# Pyflakes
"F",
# Pycodestyle
"E",
"W",
# isort
"I001"
"I",
# pylint
"PLE", "PLW"
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["ansible_variables"]
60 changes: 0 additions & 60 deletions setup.cfg

This file was deleted.

14 changes: 0 additions & 14 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
C.set_constant("CONFIG_FILE", "tests/test_data/ansible.cfg")
C.set_constant("DEFAULT_HOST_LIST", "tests/test_data/inventory")

# pylint: disable=fixme
# FIXME: we should not invoke the test with main() or VariablesCLI() as this will lead to context.CLIArgs set
# which will not be cleared between the tests and so could lead to unexpected results

Expand Down

0 comments on commit d110205

Please sign in to comment.