Skip to content

Commit

Permalink
Merge from develop to master (#121)
Browse files Browse the repository at this point in the history
Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com>
Co-authored-by: Ralph Bean <rbean@redhat.com>
Co-authored-by: aalekseyev <aalekseyev@janestreet.com>
Co-authored-by: Paolo Stivanin <paolostivanin@users.noreply.github.com>
Co-authored-by: Mubashshir <ahmubashshir@gmail.com>
  • Loading branch information
5 people authored Oct 14, 2020
1 parent 70c3b1d commit 362961d
Show file tree
Hide file tree
Showing 20 changed files with 1,899 additions and 1,402 deletions.
27 changes: 27 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Format and labels used aim to match those used by Ansible project
categories:
- title: 'Major Changes'
labels:
- 'major' # c6476b
- title: 'Minor Changes'
labels:
- 'feature' # 006b75
- 'enhancement' # ededed
- 'performance' # 555555
- title: 'Bugfixes'
labels:
- 'fix'
- 'bugfix'
- 'bug' # fbca04
- 'docs' # 4071a5
- 'packaging' # 4071a5
- 'test' # #0e8a16
- title: 'Deprecations'
labels:
- 'deprecated' # fef2c0
exclude-labels:
- 'skip-changelog'
template: |
## Changes
$CHANGES
18 changes: 18 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master
- 'releases/**'
- 'stable/**'

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124 changes: 124 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: tox

on:
create: # is used for publishing to PyPI and TestPyPI
tags: # any tag regardless of its name, no branches
push: # only publishes pushes to the main branch to TestPyPI
branches: # any integration branch but not tag
- "master"
- "main"
- "develop"
tags-ignore:
- "**"
pull_request:
schedule:
- cron: 1 0 * * * # Run daily at 0:01 UTC

jobs:
build:
name: ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- tox_env: lint
- tox_env: py36
- tox_env: py37
- tox_env: py38
- tox_env: py39
- tox_env: packaging
steps:
- uses: actions/checkout@v1
- name: Find python version
id: py_ver
shell: python
if: ${{ contains(matrix.tox_env, 'py') }}
run: |
v = '${{ matrix.tox_env }}'.split('-')[0].lstrip('py')
print('::set-output name=version::{0}.{1}'.format(v[0],v[1:]))
# Even our lint and other envs need access to tox
- name: Install a default Python
uses: actions/setup-python@v2
if: ${{ ! contains(matrix.tox_env, 'py') }}
# Be sure to install the version of python needed by a specific test, if necessary
- name: Set up Python version
uses: actions/setup-python@v2
if: ${{ contains(matrix.tox_env, 'py') }}
with:
python-version: ${{ steps.py_ver.outputs.version }}
- name: Install dependencies
run: |
python -m pip install -U pip
pip install tox
- name: Run tox -e ${{ matrix.tox_env }}
run: |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}"
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}
publish:
name: Publish to PyPI registry
needs:
- build
runs-on: ubuntu-latest

env:
PY_COLORS: 1
TOXENV: packaging

steps:
- name: Switch to using Python 3.6 by default
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install tox
run: python -m pip install --user tox
- name: Check out src from Git
uses: actions/checkout@v2
with:
# Get shallow Git history (default) for tag creation events
# but have a complete clone for any other workflows.
# Both options fetch tags but since we're going to remove
# one from HEAD in non-create-tag workflows, we need full
# history for them.
fetch-depth: >-
${{
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
) &&
1 || 0
}}
- name: Drop Git tags from HEAD for non-tag-create events
if: >-
github.event_name != 'create' ||
github.event.ref_type != 'tag'
run: >-
git tag --points-at HEAD
|
xargs git tag --delete
- name: Build dists
run: python -m tox
- name: Publish to test.pypi.org
if: >-
(
github.event_name == 'push' &&
github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
) ||
(
github.event_name == 'create' &&
github.event.ref_type == 'tag'
)
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"
github.event_name == 'create' &&
github.event.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.6.4
hooks:
- id: isort
- repo: https://github.com/python/black.git
rev: 20.8b1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v3.2.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
language_version: python3
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies:
- pydocstyle>=5.1.1
- flake8-absolute-import
- flake8-black>=0.1.1
- flake8-docstrings>=1.5.0
language_version: python3
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.6.0
hooks:
- id: pylint
additional_dependencies:
- ansible-base
- testinfra
29 changes: 29 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[MESSAGES CONTROL]

disable =
# TODO(ssbarnea): remove temporary skips adding during initial adoption:
attribute-defined-outside-init,
consider-using-dict-comprehension,
consider-using-enumerate,
deprecated-module,
import-error,
invalid-name,
line-too-long,
missing-class-docstring,
missing-function-docstring,
missing-module-docstring,
no-self-use,
redefined-builtin,
redefined-outer-name,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-locals,
too-many-public-methods,
too-many-statements,
unused-argument,
unused-variable,

[REPORTS]
output-format = colorized
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Inspired by and developed off of the work of `pixelbeat`_ and `blackjack`_.
Build Status
------------

.. |master| image:: https://secure.travis-ci.org/ralphbean/ansi2html.png?branch=master
.. |master| image:: https://github.com/pycontribs/ansi2html/workflows/tox/badge.svg?branch=master
:alt: Build Status - master branch
:target: http://travis-ci.org/#!/ralphbean/ansi2html
:target: https://github.com/pycontribs/ansi2html/actions?query=workflow%3Atox+branch%3Amaster

.. |develop| image:: https://secure.travis-ci.org/ralphbean/ansi2html.png?branch=develop
.. |develop| image:: https://github.com/pycontribs/ansi2html/workflows/tox/badge.svg?branch=develop
:alt: Build Status - develop branch
:target: http://travis-ci.org/#!/ralphbean/ansi2html
:target: https://github.com/pycontribs/ansi2html/actions?query=workflow%3Atox+branch%3Adevelop

+----------+-----------+
| Branch | Status |
Expand Down
3 changes: 2 additions & 1 deletion ansi2html/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from ansi2html.converter import Ansi2HTMLConverter
__all__ = ['Ansi2HTMLConverter']

__all__ = ["Ansi2HTMLConverter"]
4 changes: 4 additions & 0 deletions ansi2html/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ansi2html.converter import main

if __name__ == "__main__":
main()
Loading

0 comments on commit 362961d

Please sign in to comment.