Merge branch 'master' into many_repeated_spaces_timeout

pull/105/head
Yuri Baburov 6 years ago committed by GitHub
commit 494b19ed4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,15 @@ language: python
python:
- "3.6"
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- name: "Python: 3.7"
python: "3.7"
dist: xenial
sudo: true
env: TOX_ENV=py37
env:
- TOX_ENV=py27
- TOX_ENV=py34

@ -1 +1,3 @@
__version__ = "0.7"
from .readability import Document

@ -1,6 +1,10 @@
#!/usr/bin/env python
from __future__ import print_function
from setuptools import setup, find_packages
import codecs
import os
import re
from setuptools import setup
import sys
lxml_requirement = "lxml"
@ -16,13 +20,32 @@ test_deps = [
# Test timeouts
"timeout_decorator",
]
extras = {
'test': test_deps,
}
# Adapted from https://github.com/pypa/pip/blob/master/setup.py
def find_version(*file_paths):
here = os.path.abspath(os.path.dirname(__file__))
# Intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
with codecs.open(os.path.join(here, *file_paths), 'r') as fp:
version_file = fp.read()
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file,
re.M,
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name="readability-lxml",
version="0.7",
version=find_version("readability", "__init__.py"),
author="Yuri Baburov",
author_email="burchik@gmail.com",
description="fast html to text parser (article readability tool) with python3 support",
@ -53,5 +76,6 @@ setup(
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)

@ -10,7 +10,9 @@ SAMPLES = os.path.join(os.path.dirname(__file__), 'samples')
def load_sample(filename):
"""Helper to get the content out of the sample files"""
return open(os.path.join(SAMPLES, filename)).read()
with open(os.path.join(SAMPLES, filename)) as f:
html = f.read()
return html
class TestArticleOnly(unittest.TestCase):

@ -4,7 +4,7 @@
# and then run "tox" from this directory.
[tox]
envlist = py27, py35, py36
envlist = py27, py35, py36, py37
[testenv]
deps=pytest

Loading…
Cancel
Save