Skip to content

Commit

Permalink
Using Github Actions instead of Travis CI (#358)
Browse files Browse the repository at this point in the history
* Using Github Actions instead of Travis.

* Deprecated support for Python 3.5 (DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.). Removed travis.yml.


* Revert "Merge pull request #373 from mborsetti/br_in_a"

This reverts commit a3ed67b, reversing
changes made to 2ee4495.

---------

Co-authored-by: mborsetti <mike@borsetti.com>
  • Loading branch information
Alir3z4 and mborsetti authored Dec 22, 2023
1 parent a3ed67b commit 8c4f446
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 47 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
code-quality:
runs-on: ubuntu-latest
strategy:
matrix:
toxenv:
- black
- flake8
- mypy
- isort
env:
TOXENV: ${{ matrix.toxenv }}

name: "Tox ${{ matrix.toxenv }}"
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Install Requirements [${{ matrix.toxenv }}]
run: pip install tox

- name: Tox-${{ matrix.toxenv }}
run: tox
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
toxenv:
- py38
- py39
- py310
include:
- toxenv: py38
python-version: '3.8'
- toxenv: py39
python-version: '3.9'
- toxenv: py310
python-version: '3.10'
- toxenv: py311
python-version: '3.11'
- toxenv: py312
python-version: '3.12'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TOXENV: ${{ matrix.toxenv }}
name: "Python ${{ matrix.python-version }} | Tox ${{ matrix.toxenv }}"

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Requirements [Python-${{ matrix.python-version }}]
run: pip install tox

- name: Tox-${{ matrix.toxenv }}
run: tox

- name: Upload coverage to Codecov
# see https://github.com/codecov/codecov-action/blob/master/README.md
uses: codecov/codecov-action@v2
with:
flags: unittests-${{ matrix.python-version }}
fail_ci_if_error: true # default = false
os: toxenv
verbose: true # default = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dist
.idea
.coverage
.coverage.*
coverage.xml
env/
.c9/
.vscode
Expand Down
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ UNRELEASED
* Fix #344: indent ``<ul>`` inside ``<ol>`` three spaces instead of two to comply with CommonMark, GFM, etc.
* Fix #324: unnecessary spaces around ``<b>``, ``<em>``, and ``strike`` tags.
* Don't wrap tables by default and add a ``--wrap-tables`` config option
* Remove support for Python ≤ 3.5. Now requires Python 3.6+.
* Support for Python 3.10.
* Fix #320 padding empty tables and tables with no </tr> tags.
* Add ``ignore_mailto_links`` config option to ignore ``mailto:`` style links.



2020.1.16
=========
----
Expand Down
4 changes: 1 addition & 3 deletions html2text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ def handle_tag(
self.p()

if tag == "br" and start:
if self.astack:
self.space = True
elif self.blockquote > 0:
if self.blockquote > 0:
self.o(" \n> ")
else:
self.o(" \n")
Expand Down
7 changes: 3 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Expand All @@ -30,7 +29,7 @@ platform = OS Independent
[options]
zip_safe = False
packages = html2text
python_requires = >=3.5
python_requires = >=3.7

[options.entry_points]
console_scripts =
Expand All @@ -48,4 +47,4 @@ combine_as_imports = True
profile = black

[mypy]
python_version = 3.5
python_version = 3.7
1 change: 0 additions & 1 deletion test/br_inside_a.html

This file was deleted.

1 change: 0 additions & 1 deletion test/br_inside_a.md

This file was deleted.

10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ envlist =
flake8
isort
mypy
py{35,36,37,38,py3}
minversion = 1.9
py{38,39,310,311,312}
minversion = 3.24

[testenv]
commands =
pytest --cov=html2text {posargs}
pytest --cov=./ --cov-report=xml {posargs}
deps =
pytest
pytest-cov

[testenv:black]
basepython = python3
commands =
black --target-version py35 --check --diff .
black --target-version py311 --check --diff .
deps =
black
skip_install = true
Expand All @@ -35,7 +35,7 @@ basepython = python3
commands =
isort --check-only --diff .
deps =
isort >= 5.0.1
isort >= 5.10.1
skip_install = true

[testenv:mypy]
Expand Down

0 comments on commit 8c4f446

Please sign in to comment.