Skip to content

Commit bf60fa0

Browse files
committed
📦 Substitute pbr with setuptools-scm
Also: * 🎨 include a shim to simulate setuptools' ability to read data from ``setup.cfg`` under ancient envs. * ⬆️ BSpecify project stability in metadata properly * ⬆️ Bump required tox to v3.8.4 * 🎨 Retrieve Molecule version using pkg_resources * 🐛 Whitelist find in tox in build-dists * 🎨 Enable isolated build in tox * 🔥 Drop Ansible 2.4 factor ref from tox * ⬆️ Bump setuptools req to v41.0.0 * 🎨 Wire up tox build-dists env into Travis CI
1 parent 5aa8405 commit bf60fa0

File tree

10 files changed

+334
-85
lines changed

10 files changed

+334
-85
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ jobs:
429429
name: Publishing current Git tagged version of dist to PyPI
430430
if: repo == "ansible/molecule" AND tag IS present
431431
env:
432-
TOXENV: metadata-validation
432+
TOXENV: metadata-validation,build-dists
433+
before_deploy:
434+
- echo > setup.py
433435
deploy: &deploy-step
434436
provider: pypi
435437
user: ansible-molecule

MANIFEST.in

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

lint-requirements.txt

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

molecule/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) 2019 Red Hat, Inc.
12
# Copyright (c) 2015-2018 Cisco Systems, Inc.
23
#
34
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -17,8 +18,13 @@
1718
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1819
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1920
# DEALINGS IN THE SOFTWARE.
21+
"""Molecule version information."""
2022

21-
import pbr.version
23+
from __future__ import absolute_import, division, print_function
24+
__metaclass__ = type
2225

23-
version_info = pbr.version.VersionInfo('molecule') # noqa
24-
__version__ = version_info.release_string()
26+
try:
27+
import pkg_resources
28+
__version__ = pkg_resources.get_distribution('molecule').version
29+
except Exception:
30+
__version__ = 'unknown'

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 41.0.0",
4+
"setuptools_scm >= 1.15.0",
5+
"setuptools_scm_git_archive >= 1.0",
6+
"wheel",
7+
]
8+
build-backend = "setuptools.build_meta"

requirements.txt

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

setup.cfg

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
[aliases]
22
dists = clean --all sdist bdist_wheel
33

4+
[bdist_wheel]
5+
universal = 1
6+
47
[metadata]
58
name = molecule
6-
author = Ansible by Red Hat
7-
author-email = [email protected]
8-
maintainer = Ansible by Red Hat
9-
maintainer-email = [email protected]
10-
summary = Molecule aids in the development and testing of Ansible roles.
11-
license = MIT
12-
description-file = README.rst
13-
home-page = https://github.com/ansible/molecule
14-
requires-python = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
9+
url = https://github.com/ansible/molecule
1510
project_urls =
1611
Bug Tracker = https://github.com/ansible/molecule/issues
1712
Release Management = https://github.com/ansible/molecule/projects
@@ -20,28 +15,80 @@ project_urls =
2015
Documentation = https://molecule.readthedocs.io
2116
Mailing lists = https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
2217
Source Code = https://github.com/ansible/molecule
23-
classifier =
24-
Development Status :: 4 - Beta
18+
description = Molecule aids in the development and testing of Ansible roles
19+
long_description = file: README.rst
20+
author = Ansible by Red Hat
21+
author_email = [email protected]
22+
maintainer = Ansible by Red Hat
23+
maintainer_email = [email protected]
24+
license = MIT
25+
license_file = LICENSE
26+
classifiers =
27+
Development Status :: 5 - Production/Stable
28+
2529
Environment :: Console
30+
2631
Intended Audience :: Developers
2732
Intended Audience :: Information Technology
2833
Intended Audience :: System Administrators
34+
2935
License :: OSI Approved :: MIT License
36+
3037
Natural Language :: English
38+
3139
Operating System :: OS Independent
40+
3241
Programming Language :: Python :: 2
3342
Programming Language :: Python :: 2.7
3443
Programming Language :: Python :: 3
3544
Programming Language :: Python :: 3.5
3645
Programming Language :: Python :: 3.6
3746
Programming Language :: Python :: 3.7
47+
3848
Topic :: System :: Systems Administration
3949
Topic :: Utilities
50+
keywords =
51+
ansible
52+
roles
53+
testing
54+
molecule
55+
56+
[options]
57+
use_scm_version = True
58+
python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
59+
package_dir =
60+
= .
61+
packages = find:
62+
zip_safe = False
63+
64+
# These are required during `setup.py` run:
65+
setup_requires =
66+
setuptools_scm >= 1.15.0
67+
setuptools_scm_git_archive >= 1.0
68+
69+
# These are required in actual runtime:
70+
install_requires =
71+
ansible >= 2.5
72+
ansible-lint >= 4.0.2, < 5
4073

41-
# setuptools section name:
42-
# [options.extras_require]
43-
# PBR way:
44-
[extras]
74+
anyconfig == 0.9.7
75+
cerberus >= 1.2, < 3
76+
click == 6.7
77+
click-completion == 0.3.1
78+
colorama == 0.3.9
79+
cookiecutter == 1.6.0
80+
python-gilt >= 1.2.1, < 2
81+
Jinja2 == 2.10
82+
pexpect >= 4.6.0, < 5
83+
psutil == 5.4.6; sys_platform!="win32" and sys_platform!="cygwin"
84+
PyYAML == 3.13
85+
sh == 1.12.14
86+
six == 1.11.0
87+
tabulate == 0.8.2
88+
testinfra == 1.19.0
89+
tree-format==0.1.2
90+
91+
[options.extras_require]
4592
docs =
4693
alabaster
4794
Sphinx
@@ -65,19 +112,14 @@ vagrant =
65112
windows =
66113
pywinrm
67114

68-
[pbr]
69-
skip_authors = True
70-
skip_changelog = True
71-
warnerrors = True
72-
73-
[entry_points]
115+
[options.entry_points]
74116
console_scripts =
75-
molecule = molecule.shell:main
117+
molecule = molecule.__main__:main
118+
119+
[options.packages.find]
120+
where = .
76121

77122
[build_sphinx]
78123
all_files = 1
79124
build-dir = doc/build
80125
source-dir = doc/source
81-
82-
[wheel]
83-
universal = 1

0 commit comments

Comments
 (0)