Compare commits
36 Commits
feature/to
...
0.11.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f047753ae | ||
|
|
50b3b73a8f | ||
|
|
0310216877 | ||
|
|
194c646a20 | ||
|
|
9914474828 | ||
|
|
6263f0e5f0 | ||
|
|
2c533339cf | ||
|
|
2b8cf444f1 | ||
|
|
d375116807 | ||
|
|
eb0330bfc6 | ||
|
|
28793ac0b3 | ||
|
|
9231704988 | ||
|
|
1613c302bc | ||
|
|
55c9e84f38 | ||
|
|
99875683ac | ||
|
|
eaeb0603eb | ||
|
|
cb73590623 | ||
|
|
59417ab115 | ||
|
|
917b01e548 | ||
|
|
652714859d | ||
|
|
ea5b22824b | ||
|
|
ec5858e42f | ||
|
|
02bb914ef3 | ||
|
|
21c0d034d0 | ||
|
|
e3ddc789a2 | ||
|
|
2d0cd97323 | ||
|
|
ec185e2e9c | ||
|
|
079d1721aa | ||
|
|
bf24df3e2e | ||
|
|
15329588b1 | ||
|
|
34ad8485fa | ||
|
|
f0ce934bf8 | ||
|
|
99cd237f27 | ||
|
|
2bde8d3e8e | ||
|
|
8c9b029756 | ||
|
|
ae50065872 |
10
.github/workflows/python-app.yml
vendored
10
.github/workflows/python-app.yml
vendored
@@ -23,11 +23,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8==3.8.4 pytest
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
pip install tox
|
||||
- name: Lint and test
|
||||
run: |
|
||||
python setup.py lint
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
python setup.py test
|
||||
tox
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@
|
||||
/venv
|
||||
build/
|
||||
.vscode/settings.json
|
||||
.tox/
|
||||
|
||||
10
README.rst
10
README.rst
@@ -175,7 +175,7 @@ change:
|
||||
|
||||
|
||||
Command Line Interface
|
||||
=====================
|
||||
======================
|
||||
|
||||
Use ``markdownify example.html > example.md`` or pipe input from stdin
|
||||
(``cat example.html | markdownify > example.md``).
|
||||
@@ -186,10 +186,4 @@ They are the same as listed above and take the same arguments.
|
||||
Development
|
||||
===========
|
||||
|
||||
To run tests:
|
||||
|
||||
``python setup.py test``
|
||||
|
||||
To lint:
|
||||
|
||||
``python setup.py lint``
|
||||
To run tests and the linter run ``pip install tox`` once, then ``tox``.
|
||||
|
||||
60
setup.py
60
setup.py
@@ -2,7 +2,6 @@
|
||||
import codecs
|
||||
import os
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.test import test as TestCommand, Command
|
||||
|
||||
|
||||
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
||||
@@ -10,52 +9,10 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
||||
pkgmeta = {
|
||||
'__title__': 'markdownify',
|
||||
'__author__': 'Matthew Tretter',
|
||||
'__version__': '0.11.2',
|
||||
'__version__': '0.11.4',
|
||||
}
|
||||
|
||||
|
||||
class PyTest(TestCommand):
|
||||
def finalize_options(self):
|
||||
TestCommand.finalize_options(self)
|
||||
self.test_args = ['tests', '-s']
|
||||
self.test_suite = True
|
||||
|
||||
def run_tests(self):
|
||||
import pytest
|
||||
errno = pytest.main(self.test_args)
|
||||
raise SystemExit(errno)
|
||||
|
||||
|
||||
class LintCommand(Command):
|
||||
"""
|
||||
A copy of flake8's Flake8Command
|
||||
|
||||
"""
|
||||
description = "Run flake8 on modules registered in setuptools"
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def distribution_files(self):
|
||||
if self.distribution.packages:
|
||||
for package in self.distribution.packages:
|
||||
yield package.replace(".", os.path.sep)
|
||||
|
||||
if self.distribution.py_modules:
|
||||
for filename in self.distribution.py_modules:
|
||||
yield "%s.py" % filename
|
||||
|
||||
def run(self):
|
||||
from flake8.api.legacy import get_style_guide
|
||||
flake8_style = get_style_guide(config_file='setup.cfg')
|
||||
paths = self.distribution_files()
|
||||
report = flake8_style.check_files(paths)
|
||||
raise SystemExit(report.total_errors > 0)
|
||||
|
||||
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
||||
|
||||
setup(
|
||||
name='markdownify',
|
||||
@@ -69,14 +26,9 @@ setup(
|
||||
packages=find_packages(),
|
||||
zip_safe=False,
|
||||
include_package_data=True,
|
||||
setup_requires=[
|
||||
'flake8>=3.8,<5',
|
||||
],
|
||||
tests_require=[
|
||||
'pytest>=6.2,<7',
|
||||
],
|
||||
install_requires=[
|
||||
'beautifulsoup4>=4.9,<5', 'six>=1.15,<2'
|
||||
'beautifulsoup4>=4.9,<5',
|
||||
'six>=1.15,<2',
|
||||
],
|
||||
classifiers=[
|
||||
'Environment :: Web Environment',
|
||||
@@ -92,10 +44,6 @@ setup(
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Topic :: Utilities'
|
||||
],
|
||||
cmdclass={
|
||||
'test': PyTest,
|
||||
'lint': LintCommand,
|
||||
},
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'markdownify = markdownify.main:main'
|
||||
|
||||
Reference in New Issue
Block a user