Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit 6385a35

Browse files
authored
Updated packaging testing (#93)
1 parent bfbc5ba commit 6385a35

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

pyproject.toml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 41.0.0",
4-
"setuptools_scm >= 1.15.0",
5-
"setuptools_scm_git_archive >= 1.0",
6-
"wheel",
3+
"pip >= 19.3.1",
4+
"setuptools >= 42",
5+
"setuptools_scm[toml] >= 3.5.0",
6+
"setuptools_scm_git_archive >= 1.1",
7+
"wheel >= 0.33.6",
78
]
89
build-backend = "setuptools.build_meta"
910

11+
[tool.black]
12+
skip-string-normalization = false
13+
14+
[tool.isort]
15+
profile = "black"
16+
known_first_party = "molecule"
1017
[tool.pylint.master]
1118
ignored-modules = [
1219
"molecule",
1320
"pytest",
1421
"yaml",
1522
"_pytest"
1623
]
24+
25+
[tool.setuptools_scm]
26+
local_scheme = "no-local-version"

tox.ini

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ setenv =
4747
ANSIBLE_STDOUT_CALLBACK={env:ANSIBLE_STDOUT_CALLBACK:debug}
4848
ANSIBLE_VERBOSITY={env:ANSIBLE_VERBOSITY:0}
4949
PIP_DISABLE_PIP_VERSION_CHECK=1
50-
PIP_USE_FEATURE=2020-resolver
5150
PY_COLORS={env:PY_COLORS:1}
5251
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
5352
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
@@ -67,11 +66,11 @@ passenv =
6766
TWINE_*
6867
allowlist_externals =
6968
ansible-inventory
70-
bash
71-
twine
72-
pytest
7369
pre-commit
70+
pytest
7471
rm
72+
sh
73+
twine
7574

7675
[testenv:linters]
7776
description = Performs linting, style checks, metadata-validation, packaging
@@ -86,20 +85,22 @@ description =
8685
Validate that we can install the wheel w/ or w/o extras on Ubuntu, Debian,
8786
Fedora, RHEL 8 and CentOS 7 by using containers.
8887
deps =
89-
collective.checkdocs >= 0.2
90-
pep517>=0.5.0
91-
twine >= 2.0.0
92-
# our distros molecule tests are using docker
93-
extras =
94-
docker
88+
build >= 0.5.0
89+
twine >= 3.4.1
9590
commands =
96-
bash -c "rm -rf {toxinidir}/dist/ && mkdir -p {toxinidir}/dist/"
97-
python -m pep517.build \
98-
--source \
99-
--binary \
100-
--out-dir {toxinidir}/dist/ {toxinidir}
101-
twine check dist/*
102-
; pytest --capture=tee-sys --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} --molecule-unavailable-driver=driver_error tests/roles/ensure-ansible
91+
# build wheel and sdist using PEP-517
92+
{envpython} -c 'import os.path, shutil, sys; \
93+
dist_dir = os.path.join("{toxinidir}", "dist"); \
94+
os.path.isdir(dist_dir) or sys.exit(0); \
95+
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
96+
shutil.rmtree(dist_dir)'
97+
{envpython} -m build \
98+
--outdir {toxinidir}/dist/ \
99+
{toxinidir}
100+
# Validate metadata using twine
101+
twine check {toxinidir}/dist/*
102+
# Install the wheel
103+
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
103104

104105
[testenv:devel]
105106
description= Unit testing using master branches of molecule and ansible

0 commit comments

Comments
 (0)