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

Commit 5ceedd3

Browse files
committed
Bootstrapping
Initial commit.
0 parents  commit 5ceedd3

17 files changed

+600
-0
lines changed

Diff for: .flake8

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
# do not add excludes for files in repo
3+
exclude = .venv/,.tox/,dist/,build/,.eggs/
4+
format = pylint
5+
# E203: https://github.com/python/black/issues/315
6+
ignore = E741,W503,W504,H,E501,E203
7+
# 88 is official black default:
8+
max-line-length = 88

Diff for: .gitignore

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

Diff for: .pre-commit-config.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
repos:
3+
- repo: https://github.com/PyCQA/doc8.git
4+
rev: 0.8.1rc1
5+
hooks:
6+
- id: doc8
7+
- repo: https://github.com/python/black.git
8+
rev: 19.10b0
9+
hooks:
10+
- id: black
11+
language_version: python3
12+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
13+
rev: v2.4.0
14+
hooks:
15+
- id: end-of-file-fixer
16+
- id: trailing-whitespace
17+
- id: mixed-line-ending
18+
- id: check-byte-order-marker
19+
- id: check-executables-have-shebangs
20+
- id: check-merge-conflict
21+
- id: debug-statements
22+
language_version: python3
23+
- repo: https://gitlab.com/pycqa/flake8.git
24+
rev: 3.7.9
25+
hooks:
26+
- id: flake8
27+
additional_dependencies:
28+
- flake8-absolute-import
29+
- flake8-black>=0.1.1
30+
- flake8-docstrings>=1.5.0
31+
- flake8-mypy
32+
language_version: python3
33+
- repo: https://github.com/adrienverge/yamllint.git
34+
rev: v1.20.0
35+
hooks:
36+
- id: yamllint
37+
files: \.(yaml|yml)$
38+
types: [file, yaml]
39+
entry: yamllint --strict
40+
- repo: https://github.com/codespell-project/codespell.git
41+
rev: v1.15.0
42+
hooks:
43+
- id: codespell
44+
name: codespell
45+
description: Checks for common misspellings in text files.
46+
entry: codespell
47+
language: python
48+
types: [text]
49+
args: []
50+
require_serial: false
51+
additional_dependencies: []

Diff for: .yamllint

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extends: default
2+
ignore: |
3+
*/cookiecutter/
4+
.github/workflows/
5+
.tox
6+
7+
rules:
8+
braces:
9+
max-spaces-inside: 1
10+
level: error
11+
brackets:
12+
max-spaces-inside: 1
13+
level: error
14+
document-start: disable
15+
line-length: disable

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Sorin Sbarnea
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.rst

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
**************************
2+
Molecule Containers Plugin
3+
**************************
4+
5+
.. image:: https://img.shields.io/pypi/v/molecule-containers.svg
6+
:target: https://pypi.org/project/molecule-containers
7+
:alt: PyPI Package
8+
9+
.. image:: https://zuul-ci.org/gated.svg
10+
:target: https://dashboard.zuul.ansible.com/t/ansible/builds?project=ansible-community/molecule-containers
11+
12+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
13+
:target: https://github.com/python/black
14+
:alt: Python Black Code Style
15+
16+
.. image:: https://img.shields.io/badge/Code%20of%20Conduct-silver.svg
17+
:target: https://docs.ansible.com/ansible/latest/community/code_of_conduct.html
18+
:alt: Ansible Code of Conduct
19+
20+
.. image:: https://img.shields.io/badge/Mailing%20lists-silver.svg
21+
:target: https://docs.ansible.com/ansible/latest/community/communication.html#mailing-list-information
22+
:alt: Ansible mailing lists
23+
24+
.. image:: https://img.shields.io/badge/license-MIT-brightgreen.svg
25+
:target: LICENSE
26+
:alt: Repository License
27+
28+
Molecule Containers is designed to be a drop-in replacement for the existing
29+
Docker and Podman drivers, one that can transparently pick whichever backend
30+
if found.
31+
32+
Please note that this driver is currently in its early stage of development,
33+
do not even try to install or use it until this message is removed.
34+
35+
.. _get-involved:
36+
37+
Get Involved
38+
============
39+
40+
* Join us in the ``#ansible-molecule`` channel on `Freenode`_.
41+
* Join the discussion in `molecule-users Forum`_.
42+
* Join the community working group by checking the `wiki`_.
43+
* Want to know about releases, subscribe to `ansible-announce list`_.
44+
* For the full list of Ansible email Lists, IRC channels see the
45+
`communication page`_.
46+
47+
.. _`Freenode`: https://freenode.net
48+
.. _`molecule-users Forum`: https://groups.google.com/forum/#!forum/molecule-users
49+
.. _`wiki`: https://github.com/ansible/community/wiki/Molecule
50+
.. _`ansible-announce list`: https://groups.google.com/group/ansible-announce
51+
.. _`communication page`: https://docs.ansible.com/ansible/latest/community/communication.html
52+
53+
.. _authors:
54+
55+
Authors
56+
=======
57+
58+
* Sorin Sbarnea
59+
60+
.. _license:
61+
62+
License
63+
=======
64+
65+
The `MIT`_ License.
66+
67+
.. _`MIT`: https://github.com/ansible-community/molecule/blob/master/LICENSE
68+
69+
The logo is licensed under the `Creative Commons NoDerivatives 4.0 License`_.
70+
71+
If you have some other use in mind, contact us.
72+
73+
.. _`Creative Commons NoDerivatives 4.0 License`: https://creativecommons.org/licenses/by-nd/4.0/

Diff for: bindep.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This is a cross-platform list tracking distribution packages needed by tests;
2+
# see https://docs.openstack.org/infra/bindep/ for additional information.
3+
4+
bzip2 [platform:rpm]
5+
gcc [test platform:rpm]
6+
gcc-c++ [test platform:rpm]
7+
libselinux-python [platform:centos-7]
8+
python3 [test platform:rpm !platform:centos-7]
9+
python3-devel [test platform:rpm !platform:centos-7]
10+
python3-libselinux [test platform:rpm !platform:centos-7]
11+
python3-netifaces [test !platform:centos-7 platform:rpm]
12+
13+
openssl-devel [test platform:rpm]
14+
15+
podman [platform:rpm]
16+
conmon [platform:centos-8]

Diff for: conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""PyTest Config."""

Diff for: molecule_containers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Molecule Containers Drivers."""

Diff for: molecule_containers/driver.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""Containers Driver Module."""
2+
3+
from __future__ import absolute_import
4+
5+
6+
from molecule import logger
7+
try:
8+
from molecule.driver.docker import Docker as DriverBackend
9+
except ImportError:
10+
from molecule.driver.podman import Podman as DriverBackend
11+
12+
log = logger.get_logger(__name__)
13+
14+
15+
class Container(DriverBackend):
16+
"""
17+
Container Driver Class
18+
19+
This class aims to provide an agnostic container enginer implementation,
20+
which should allow users to consume whichever enginer they have available.
21+
""" # noqa
22+
23+
def __init__(self, config=None):
24+
"""Construct Container."""
25+
super(DriverBackend, self).__init__(config)
26+
self._name = "container"

Diff for: pyproject.toml

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

Diff for: pytest.ini

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[pytest]
2+
addopts = -v -rxXs --doctest-modules --durations 10 --cov=molecule_* --cov-report term-missing:skip-covered --cov-report xml
3+
doctest_optionflags = ALLOW_UNICODE ELLIPSIS
4+
junit_suite_name = molecule_test_suite
5+
norecursedirs = dist doc build .tox .eggs test/scenarios test/resources

0 commit comments

Comments
 (0)