-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds pyproject.toml * Migrates setup.py to setup.cfg * Drops support for EOL Python versions * Moves code under `src/suitable`, tests to top-level directory `tests` * Revamps tox configuration (wip) * Adds basic github actions to run tests * Removes obsolete travis badge from docs. * Adds bugbear and bandit
- Loading branch information
Showing
24 changed files
with
201 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: tests (pull_request) | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
- name: Test with tox without uploading coverage | ||
run: tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get branch name (merge) | ||
if: github.event_name != 'pull_request' | ||
shell: bash | ||
run: | | ||
echo "CODECOV_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" \ | ||
>> $GITHUB_ENV | ||
- name: Get branch name (pull request) | ||
if: github.event_name == 'pull_request' | ||
shell: bash | ||
run: | | ||
echo "CODECOV_BRANCH=$(echo ${GITHUB_HEAD_REF} | tr / -)" \ | ||
>> $GITHUB_ENV | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install tox tox-gh-actions | ||
- name: Test with tox and upload coverage results | ||
run: tox -- --codecov --codecov-token=${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
recursive-include suitable * | ||
recursive-include src * | ||
include *.rst | ||
include LICENSE | ||
global-exclude *.pyc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pytest.ini_options] | ||
log_level = "INFO" | ||
testpaths = ["tests"] | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
source = ["src"] | ||
|
||
[tool.bandit] | ||
exclude_dirs = ["tests"] | ||
skips = ["B101"] | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
envlist = py38,py39,py310,flake8,bandit,report | ||
[testenv] | ||
usedevelop = true | ||
setenv = | ||
py{38,39,310}: COVERAGE_FILE = .coverage.{envname} | ||
deps = | ||
-e{toxinidir}[tests] | ||
commands = pytest --cov --cov-report= {posargs} | ||
passenv = * | ||
[testenv:flake8] | ||
basepython = python3.10 | ||
skip_install = true | ||
deps = | ||
flake8 | ||
flake8-bugbear | ||
commands = flake8 src/ tests/ | ||
[testenv:bandit] | ||
basepython = python3.10 | ||
skip_install = true | ||
deps = | ||
bandit[toml] | ||
commands = bandit -q -c pyproject.toml -r src | ||
[testenv:report] | ||
deps = | ||
coverage | ||
skip_install = true | ||
commands = | ||
coverage combine | ||
coverage report -m | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,55 @@ | ||
[metadata] | ||
name = suitable | ||
version = 0.17.3 | ||
url = http://github.com/seantis/suitable/ | ||
author = Denis Krienbühl | ||
author_email = denis@href.ch | ||
maintainer = Seantis GmbH | ||
maintainer_email = info@seantis.ch | ||
description = Suitable is a thin wrapper around the Ansible API. | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
license = GPLv3 | ||
license_files = LICENSE | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: GNU General Public License v3 (GPLv3) | ||
Operating System :: OS Independent | ||
Programming Language :: Python | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
|
||
|
||
[options] | ||
zip_safe = False | ||
include_package_data = True | ||
package_dir = | ||
= src | ||
packages = | ||
suitable | ||
python_requires = >= 3.6 | ||
platforms = any | ||
install_requires = | ||
ansible>=2.8.0.0 | ||
ansible-core<2.14 | ||
|
||
[options.extras_require] | ||
dev = | ||
bandit[toml] | ||
flake8 | ||
flake8-bugbear | ||
pre-commit | ||
tox | ||
tests = | ||
mitogen>=0.2.8 | ||
paramiko | ||
port-for | ||
pytest | ||
pytest-codecov[git] | ||
|
||
[flake8] | ||
extend-select = B901,B903,B904,B908 | ||
exclude=.venv,.git,.tox,dist,docs,*lib/python*,*egg,build | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
universal = 1 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.