Skip to content

Commit

Permalink
Fixes from PR#1 (#3)
Browse files Browse the repository at this point in the history
* Fixes from PR#1

* Update tox.ini

Co-authored-by: Sviatoslav Sydorenko <[email protected]>

Co-authored-by: Sviatoslav Sydorenko <[email protected]>
  • Loading branch information
ssbarnea and webknjaz authored Jun 24, 2021
1 parent 04dee8d commit fb51303
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 73 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @ssbarnea
* @webknjaz
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
- name: Build dists
run: python -m tox
- name: Publish to test.pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
if: >-
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
if: >-
github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,22 @@ jobs:
--skip-missing-interpreters false
-vv
env:
TOXENV: ${{ matrix.tox_env }}-core,${{ matrix.tox_env }}-ansible29,${{ matrix.tox_env }}-devel
TOXENV: ${{ matrix.tox_env }},${{ matrix.tox_env }}-ansible29,${{ matrix.tox_env }}-ansible210,${{ matrix.tox_env }}-devel
# sequential run improves browsing experience (almost no speed impact)
- name: "Test with tox: ${{ matrix.tox_env }}-core"
run: |
python3 -m tox
- name: "Test with tox: ${{ matrix.tox_env }}"
run: python3 -m tox
env:
TOXENV: ${{ matrix.tox_env }}-core
TOXENV: ${{ matrix.tox_env }}
- name: "Test with tox: ${{ matrix.tox_env }}-ansible29"
run: |
python3 -m tox
run: python3 -m tox
env:
TOXENV: ${{ matrix.tox_env }}-ansible29
- name: "Test with tox: ${{ matrix.tox_env }}-ansible210"
run: python3 -m tox
env:
TOXENV: ${{ matrix.tox_env }}-ansible210
- name: "Test with tox: ${{ matrix.tox_env }}-devel"
run: |
python3 -m tox
run: python3 -m tox
env:
TOXENV: ${{ matrix.tox_env }}-devel
- name: Archive logs
Expand Down
7 changes: 1 addition & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,11 @@ repos:
rev: v1.26.1
hooks:
- id: yamllint
exclude: >
(?x)^(
examples/playbooks/templates/.*|
examples/other/some.j2.yaml
)$
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.8.0
rev: v5.9.1
hooks:
- id: isort
args:
Expand Down
23 changes: 0 additions & 23 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,3 @@ preferred-modules =
disable =
# On purpose disabled as we rely on black
line-too-long,
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
bad-continuation,
broad-except,
dangerous-default-value,
duplicate-code,
fixme,
inconsistent-return-statements,
invalid-name,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
no-member,
no-self-use,
not-callable,
protected-access,
raise-missing-from,
redefined-outer-name,
too-few-public-methods,
too-many-branches,
too-many-instance-attributes,
too-many-return-statements,
unused-argument,
unused-variable,
1 change: 0 additions & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ rules:
indent-sequences: consistent
ignore: |
.tox
examples/playbooks/example.yml
# ignore added because this file includes on-purpose errors
9 changes: 0 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,5 @@ disallow_any_generics = True
; warn_unused_configs = True
exclude = test/local-content

[mypy-pytest]
ignore_missing_imports = True

[mypy-packaging.version]
ignore_missing_imports = True

[mypy-importlib_metadata]
ignore_missing_imports = True

[mypy-setuptools]
ignore_missing_imports = True
9 changes: 2 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[aliases]
dists = clean --all sdist bdist_wheel

[metadata]
name = ansible-compat
url = https://github.com/ansible-community/ansible-compat
Expand All @@ -14,8 +11,6 @@ long_description = file: README.rst
long_description_content_type = text/x-rst
author = Sorin Sbarnea
author_email = [email protected]
maintainer = Sorin Sbarnea
maintainer_email = [email protected]
license = MIT
license_file = LICENSE
classifiers =
Expand All @@ -37,6 +32,7 @@ classifiers =
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: Jython
Expand All @@ -49,7 +45,6 @@ classifiers =
Topic :: Utilities
keywords =
ansible
lint

[options]
use_scm_version = True
Expand All @@ -76,7 +71,7 @@ test =
where = src

[options.package_data]
ansiblelint = py.typed
ansible_compat = py.typed

[codespell]
skip = .tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata
1 change: 1 addition & 0 deletions src/ansible_compat/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""ansible_compat package."""
1 change: 0 additions & 1 deletion src/ansiblecompat/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for ansiblecompat package."""
"""Tests for ansible_compat package."""


def test_placeholder() -> None:
Expand Down
27 changes: 13 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 3.16.1
envlist = lint,packaging,py{39,38,37,36}-{core,ansible29,devel}
envlist = lint,packaging,py{39,38,37,36},py{39,38,37,36}-{ansible29,ansible210,devel}
isolated_build = true
requires =
setuptools >= 41.4.0
Expand All @@ -11,30 +11,31 @@ usedevelop = false

[testenv]
description =
Run the tests under {basepython} and
Run the tests with {basepython}
devel: ansible devel branch
ansible29: ansible 2.9
core: ansible-base 2.10
py: ansible-core 2.11
ansible210: ansible-base 2.10
extras =
test
deps =
ansible29: ansible>=2.9,<2.10
ansible210: ansible-base>=2.10,<2.11
py: ansible-core>=2.11
devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+
commands =
# safety measure to assure we do not accidentally run tests with broken dependencies
{envpython} -m pip check
# We add coverage options but not making them mandatory as we do not want to force
# pytest users to run coverage when they just want to run a single test with `pytest -k test`
{envpython} -m pytest \
--junitxml "{toxworkdir}/junit.{envname}.xml" \
{posargs:\
--cov ansiblecompat \
--cov "{envsitepackagesdir}/ansiblecompat" \
--cov ansible_compat \
--cov "{envsitepackagesdir}/ansible_compat" \
--cov-report term-missing:skip-covered \
--cov-report xml:.test-results/pytest/cov.xml \
--no-cov-on-fail}
commands_pre =
# safety measure to assure we do not accidentally run tests with broken dependencies
{envpython} -m pip check
passenv =
CURL_CA_BUNDLE # https proxies, https://github.com/tox-dev/tox/issues/1437
FORCE_COLOR
Expand Down Expand Up @@ -89,8 +90,8 @@ basepython = python3
description =
Build package, verify metadata, install package and assert behavior when ansible is missing.
deps =
pep517 >= 0.7.0
twine
build >= 0.5.0
twine >= 3.4.1
skip_install = true
# Ref: https://twitter.com/di_codes/status/1044358639081975813
commands =
Expand All @@ -100,10 +101,8 @@ commands =
os.path.isdir(dist_dir) or sys.exit(0); \
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
shutil.rmtree(dist_dir)'
{envpython} -m pep517.build \
--source \
--binary \
--out-dir {toxinidir}/dist/ \
{envpython} -m build \
--outdir {toxinidir}/dist/ \
{toxinidir}
# Validate metadata using twine
twine check {toxinidir}/dist/*
Expand Down

0 comments on commit fb51303

Please sign in to comment.