Skip to content

Commit adfc685

Browse files
committed
Switch packaging to use hatchling
1 parent 0fb85f0 commit adfc685

File tree

9 files changed

+83
-151
lines changed

9 files changed

+83
-151
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,3 @@ repos:
3737
entry: ruff format --check --diff
3838
language: system
3939
types: [python]
40-
- repo: https://github.com/pre-commit/mirrors-mypy
41-
rev: v1.4.1
42-
hooks:
43-
- id: mypy
44-
# empty args needed in order to match mypy cli behavior
45-
additional_dependencies:
46-
- types-paramiko
47-
- types-setuptools
48-
- setuptools-scm
49-
- alabaster
50-
- pytest

MANIFEST.in

Lines changed: 0 additions & 21 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

hatch.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[version]
2+
source = "vcs"
3+
4+
[build.targets.sdist]
5+
packages = ["testinfra"]
6+
7+
[build.targets.wheel]
8+
packages = ["testinfra"]

pyproject.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[build-system]
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "pytest-testinfra"
7+
description = "Test infrastructures"
8+
requires-python = ">=3.9"
9+
dynamic = ["version"]
10+
readme = "README.rst"
11+
license-files = ["LICENSE"]
12+
authors = [{ name = "Philippe Pepiot", email = "[email protected]" }]
13+
classifiers = [
14+
"Development Status :: 5 - Production/Stable",
15+
"Environment :: Console",
16+
"Intended Audience :: Developers",
17+
"Intended Audience :: Information Technology",
18+
"Intended Audience :: System Administrators",
19+
"License :: OSI Approved :: Apache Software License",
20+
"Operating System :: POSIX",
21+
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3",
23+
"Programming Language :: Python :: 3 :: Only",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Programming Language :: Python :: 3.11",
27+
"Topic :: Software Development :: Testing",
28+
"Topic :: System :: Systems Administration",
29+
"Framework :: Pytest",
30+
]
31+
32+
dependencies = [
33+
"pytest>=6",
34+
]
35+
36+
[project.optional-dependencies]
37+
ansible = ["ansible"]
38+
paramiko = ["paramiko"]
39+
salt = ["salt", "tornado", "distro", "looseversion", "msgpack"]
40+
winrm = ["pywinrm"]
41+
test = [
42+
"pytest-cov",
43+
"pytest-xdist",
44+
"pytest-testinfra[ansible,paramiko,salt,winrm]",
45+
]
46+
typing = [
47+
"mypy",
48+
"types-paramiko",
49+
]
50+
lint = [
51+
"ruff",
52+
]
53+
doc = [
54+
"sphinx>=7.1,<7.2",
55+
"alabaster>=0.7.2",
56+
]
57+
dev = ["pytest-testinfra[test,typing,doc,lint]"]
58+
59+
[project.entry-points."pytest11"]
60+
"pytest11.testinfra" = "testinfra.plugin"

setup.cfg

Lines changed: 0 additions & 53 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

test-requirements.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

tox.ini

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ envlist=
88

99
[testenv]
1010
description = Runs unittests
11-
deps=
12-
-rtest-requirements.txt
11+
extra =
12+
test
13+
typing
1314
commands=
14-
{envpython} -m pytest {posargs:-v -n 4 --cov testinfra --cov-report xml --cov-report term test}
15+
mypy
16+
{envpython} -m pytest {posargs:-v -n 4 --cov testinfra --cov-report xml --cov-report term test}
1517
usedevelop=True
1618
passenv=
17-
HOME
18-
TRAVIS
19-
DOCKER_CERT_PATH
20-
DOCKER_HOST
21-
DOCKER_TLS_VERIFY
22-
WSL_DISTRO_NAME
19+
HOME
20+
TRAVIS
21+
DOCKER_CERT_PATH
22+
DOCKER_HOST
23+
DOCKER_TLS_VERIFY
24+
WSL_DISTRO_NAME
2325

2426
[testenv:lint]
2527
description = Performs linting tasks
2628
deps =
27-
pre-commit>=2.6.0
28-
ruff
29+
pre-commit>=2.6.0
30+
ruff
2931
commands=
3032
pre-commit run -a
3133

@@ -37,11 +39,7 @@ commands=sphinx-build -W -b html doc/source doc/build
3739
[testenv:packaging]
3840
description = Validate project packaging
3941
skip_install = true
40-
setenv =
41-
PEP440_VERSION=true
4242
deps=
43-
check-manifest
43+
build
4444
commands=
45-
{envpython} -m check_manifest {toxinidir}
46-
{envpython} setup.py sdist
47-
{envpython} setup.py bdist_wheel
45+
{envpython} -m build

0 commit comments

Comments
 (0)