Skip to content

Commit 0357674

Browse files
author
Sven Kreiss
authored
GitHub Actions and Python>=3.6 (#80)
1 parent e6ed086 commit 0357674

File tree

5 files changed

+127
-42
lines changed

5 files changed

+127
-42
lines changed

.github/workflows/pypi-deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build and upload to PyPI
2+
3+
# Build on every branch push, tag push, and pull request change:
4+
# on: [push, pull_request]
5+
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
branches:
12+
- main
13+
release:
14+
types:
15+
- published
16+
17+
jobs:
18+
build_sdist:
19+
name: Build source distribution
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-python@v2
24+
name: Install Python
25+
with:
26+
python-version: '3.7'
27+
- run: pip install -e .
28+
- run: python -c "import html5validator; print(html5validator.__version__)"
29+
- run: git status
30+
- run: git diff
31+
- run: python -c "import html5validator; assert 'dirty' not in html5validator.__version__"
32+
- name: Build sdist
33+
run: python setup.py sdist
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
path: dist/*.tar.gz
37+
38+
upload_pypi:
39+
needs: [build_sdist]
40+
runs-on: ubuntu-latest
41+
# upload to PyPI on every tag starting with 'v'
42+
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
43+
# alternatively, to publish when a GitHub Release is created, use the following rule:
44+
if: github.event_name == 'release' && github.event.action == 'published'
45+
steps:
46+
- uses: actions/download-artifact@v2
47+
with:
48+
name: artifact
49+
path: dist
50+
51+
- uses: pypa/gh-action-pypi-publish@master
52+
with:
53+
user: __token__
54+
password: ${{ secrets.pypi_password }}
55+
# To test: repository_url: https://test.pypi.org/legacy/

.github/workflows/tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
include:
12+
- os: ubuntu-latest
13+
python: 3.6
14+
- os: ubuntu-latest
15+
python: 3.7
16+
- os: ubuntu-latest
17+
python: 3.8
18+
- os: ubuntu-latest
19+
python: 3.9
20+
- os: macos-latest
21+
python: 3.7
22+
- os: macos-latest
23+
python: 3.8
24+
conda: True
25+
- os: macos-latest
26+
python: 3.9
27+
- os: windows-latest
28+
python: 3.7
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Set up Python ${{ matrix.python }}
33+
if: ${{ !matrix.conda }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python }}
37+
- name: Set up Conda
38+
if: matrix.conda
39+
uses: s-weigand/setup-conda@v1
40+
with:
41+
update-conda: true
42+
python-version: ${{ matrix.python }}
43+
conda-channels: anaconda, conda-forge
44+
- run: conda --version
45+
if: matrix.conda
46+
- run: which python
47+
if: matrix.conda
48+
- run: python --version
49+
- name: Install
50+
run: python -m pip install -e ".[tests]"
51+
- name: Print environment
52+
run: |
53+
python -m pip freeze
54+
python --version
55+
python -c "import html5validator; print(html5validator.__version__)"
56+
- name: Lint html5validator
57+
# run: pylint html5validator --disable=fixme
58+
run: flake8
59+
# - name: pycodestyle html5validator
60+
# run: python -m pycodestyle html5validator
61+
- name: Test
62+
env:
63+
PYTHONDEVMODE: 1
64+
# run: pytest -vv
65+
run: nosetests -vv

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ HTML5 Validator
99
(e.g. with `localcrawl <https://github.com/svenkreiss/localcrawl>`_)
1010
and then validated.
1111

12-
.. image:: https://travis-ci.org/svenkreiss/html5validator.svg?branch=master
13-
:target: https://travis-ci.org/svenkreiss/html5validator
12+
.. image:: https://github.com/svenkreiss/html5validator/actions/workflows/tests.yml/badge.svg?branch=main
13+
:target: https://github.com/svenkreiss/html5validator/actions/workflows/tests.yml
1414
.. image:: https://badge.fury.io/py/html5validator.svg
1515
:target: https://pypi.python.org/pypi/html5validator/
1616

1717

1818
Install
1919
-------
2020

21-
This module requires Python 2.7, 3.5, 3.6, 3.7 or 3.8 and Java 8 (``openjdk8`` or ``oraclejdk8``).
21+
This module requires Python 3.6, 3.7, 3.8 or 3.9 and Java 8 (``openjdk8`` or ``oraclejdk8``).
2222
Install with ``pip install html5validator`` and run with
2323

2424
.. code-block:: bash

setup.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
from setuptools import setup
22

3-
import sys
4-
53
from html5validator import __version__
64

7-
INSTALL_REQUIRES = [
8-
"PyYAML"
9-
]
10-
11-
12-
# add argparse dependency for python < 2.7
13-
major, minor1, minor2, release, serial = sys.version_info
14-
if major <= 2 and minor1 < 7:
15-
INSTALL_REQUIRES.append('argparse==1.2.1')
16-
175

186
setup(
197
name='html5validator',
@@ -28,8 +16,10 @@
2816

2917
include_package_data=True,
3018
zip_safe=False,
31-
python_reqires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
32-
install_requires=INSTALL_REQUIRES,
19+
python_reqires=">=3.6",
20+
install_requires=[
21+
'PyYAML',
22+
],
3323
extras_require={
3424
'tests': [
3525
'hacking',
@@ -53,8 +43,6 @@
5343
'License :: OSI Approved :: MIT License',
5444
'Operating System :: OS Independent',
5545
'Programming Language :: Python',
56-
'Programming Language :: Python :: 2.7',
57-
'Programming Language :: Python :: 3.5',
5846
'Programming Language :: Python :: 3.6',
5947
"Programming Language :: Python :: 3.7",
6048
"Programming Language :: Python :: 3.8",

0 commit comments

Comments
 (0)