diff --git a/Makefile b/Makefile index e919443..2472d1b 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ NOSE := bin/nosetests # ########### .PHONY: test test: venv $(NOSE) - $(NOSE) --with-id -s tests + $(NOSE) --with-id -s src/tests $(NOSE): $(PY) setup.py test @@ -28,7 +28,7 @@ bin/python: .PHONY: clean_venv clean_venv: - rm -rf bin include lib local man + rm -rf bin include lib local man share .PHONY: develop develop: lib/python*/site-packages/readability_lxml.egg-link diff --git a/setup.py b/setup.py index fd68a81..178f92a 100755 --- a/setup.py +++ b/setup.py @@ -21,17 +21,23 @@ setup( keywords='readable read parse html document readability', long_description=open("README").read(), license="Apache License 2.0", - url="http://github.com/buriy/python-readability", - package_dir={'': 'readability'}, - packages=find_packages('readability', exclude=["*.tests", "*.tests.*"]), - install_requires=install_requires, - extras_require={'test': tests_require}, - test_suite = "nose.collector", - # test_suite="tests.test_article_only", classifiers=[ "Environment :: Web Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", - ], + ], + url="http://github.com/buriy/python-readability", + packages=find_packages('src'), + package_dir = {'': 'src'}, + include_package_data=True, + zip_safe=False, + install_requires=install_requires, + extras_require={'test': tests_require}, + test_suite = "nose.collector", + entry_points={ + 'console_scripts': + ['readability=readability_lxml:client.main'] + }, + ) diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/samples/si-game.sample.html b/tests/samples/si-game.sample.html deleted file mode 100644 index fab4f4f..0000000 --- a/tests/samples/si-game.sample.html +++ /dev/null @@ -1,762 +0,0 @@ - - - - - - Detroit Tigers vs. Kansas City Royals - Preview - April 16, 2012 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - -
-
    -
  • - - - -
    Get the Wildcats Championship Package
    -
    Get the Wildcats Championship Package
    - - - - - -
  • -
  • -
  • -
  • - - - - -
    Get MLB 2K 12 FREE
    -
    Get MLB 2K 12 FREE
    - - - -
  • -
-
-
-
- - - -
-
SI.com Home -
- -
-
- - - -
- -
- - - - -
-
- -
-
- - - -
- - -
- -
- - -
-
- -
- - - - - -
-
-
-
  - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 123456789RHE
TIGERS            
ROYALS            
-
- -
-
- - - -
- - - - - - -
PREVIEWMATCHUPFAN COMMENTS
-
- - - -
-
-
- - -

Tigers-Royals Preview

-

- - Justin Verlander - has pitched well in each of his first two starts, though he doesn't have a win to show for those efforts. - -

-

- He hasn't had much trouble earning victories against the - Kansas City Royals - . - -

-

- Verlander looks to continue his mastery of the Royals when the - Detroit Tigers - visit Kauffman Stadium in the opener of a three-game series Monday night. - -

-

- The reigning AL - Cy Young - winner and MVP had a 2-0 lead through eight innings in both of his outings, but the Tigers weren't able to hold the lead. - -

-

Verlander (0-1, 2.20 ERA) allowed two hits before running into trouble in the ninth against Tampa Bay on Wednesday, getting - charged with four runs in 8 1-3 innings of a 4-2 defeat. -

"Once a couple guys got on, really the first time I've cranked it up like that - and lost a little bit of my consistency that - I'd had all day," Verlander said. "It's inexcusable. This loss rests solely on my shoulders." -

The right-hander did his part in his opening-day start against Boston on April 5, allowing two hits before the bullpen faltered. - Detroit ended up winning 3-2 with a run in the bottom of the ninth, though Verlander didn't earn a decision. -

-

That hasn't been the case in his last four starts against the Royals, winning each with a 1.82 ERA. Verlander is 13-2 with - a 2.40 ERA in 19 career starts versus Kansas City, and another win will give him more victories than he has against any other - team. He's also beaten Cleveland 13 times. -

-

Verlander is 8-2 with a 1.82 ERA lifetime at Kauffman Stadium, where the Royals (3-6) were swept in a three-game series against - the Indians with Sunday's 13-7 loss. -

-

- - Billy Butler - , who is 14 for 39 (.359) with two homers off Verlander, had an RBI single and is hitting .364 with four doubles and a homer - during a five-game hitting streak. - -

-

- Royals pitchers allowed seven home runs, 17 extra-base hits and 32 runs in the series, and manager - Ned Yost - turned to outfielder - Mitch Maier - in the ninth to pitched a scoreless inning Sunday. - -

"Let's hope it doesn't happen again," Maier said. "I don't like to be put in that situation, but we needed an inning." -

- Kansas City will look to bounce back with the help of another solid outing from - Danny Duffy - (1-0, 0.00), who allowed one hit and struck out eight in six innings of a 3-0 win over Oakland on Tuesday. - -

-

The left-hander will be seeking his first win against Detroit after going 0-2 with a 5.63 ERA in three starts versus the Tigers - as a rookie. -

-

- - Gerald Laird - was a triple short of the cycle and helped the Tigers (6-3) salvage the finale of a three-game series with a 5-2 victory over - Chicago on Sunday. - -

-

- - Rick Porcello - allowed one run in 7 2-3 innings to give Detroit's starting rotation its first victory. - -

"All the other starters have pitched well," Porcello said. "It's just the way it's happened so far." -

Verlander allowed three runs in seven innings of a 4-3 win over the Royals on Aug. 6, beating Duffy, who gave up three runs - over five. -

- -

- © 2011 STATS LLC STATS, Inc - -

-
-
- -
-
-
-
- -
-
-
- -
-
-
-
- - - -
- -
-
-
-
-
SI.com
-
Hot Topics: Peter King: MMQB NHL Playoffs Bobby Petrino Bobby Valentine Roger Clemens MLB Power Rankings Jackie Robinson
-
-
- -
-
- - Turner - SI Digital - -
Terms under which this service is provided to you. Read our privacy guidelines, your California privacy rights, and ad choices. -
-
-
SI CoverRead All ArticlesBuy Cover Reprint -
-
-
- - - - -
-
-
- - - - - - - -
-
- - - - - - - - - - -
- -
-
-
- - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/test_article_only.py b/tests/test_article_only.py deleted file mode 100644 index a45cba5..0000000 --- a/tests/test_article_only.py +++ /dev/null @@ -1,39 +0,0 @@ -import os -import unittest - -from readability import Document - - -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() - - -class TestArticleOnly(unittest.TestCase): - """The option to not get back a full html doc should work - - Given a full html document, the call can request just divs of processed - content. In this way the developer can then wrap the article however they - want in their own view or application. - - """ - - def test_si_sample(self): - """Using the si sample, load article with only opening body element""" - sample = load_sample('si-game.sample.html') - doc = Document( - sample, - url='http://sportsillustrated.cnn.com/baseball/mlb/gameflash/2012/04/16/40630_preview.html') - res = doc.summary() - self.assertEqual('