diff --git a/.gitignore b/.gitignore index 7a17c8e..c4eb95f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ *[~#] .cache .dir-locals.el -.tox +.eggs .vimrc __pycache__ +build dist diff --git a/.travis.yml b/.travis.yml index ea96292..0b1593d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,12 +9,12 @@ python: - "3.7" install: - - pip install coveralls tox-travis -r requirements.txt + - pip install coveralls -r requirements.txt script: - flake8 - black --check ./ - - tox + - coverage run --source full_yaml_metadata -m setup test after_success: - coveralls diff --git a/full_yaml_metadata.py b/full_yaml_metadata.py index 6fa8da8..fd8fa98 100644 --- a/full_yaml_metadata.py +++ b/full_yaml_metadata.py @@ -24,7 +24,7 @@ class FullYamlMetadataPreprocessor(markdown.preprocessors.Preprocessor): def run(self, lines: list) -> list: meta_lines, lines = self.split_by_meta_and_content(lines) - self.md.Meta = yaml.load("\n".join(meta_lines)) + self.md.Meta = yaml.load("\n".join(meta_lines), Loader=yaml.FullLoader) return lines def split_by_meta_and_content(self, lines: list) -> typing.Tuple[list]: diff --git a/requirements.txt b/requirements.txt index 37d1b3b..524e9f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,25 +1,24 @@ appdirs==1.4.3 atomicwrites==1.3.0 attrs==19.1.0 -black==18.9b0 +black==19.3b0 Click==7.0 entrypoints==0.3 flake8==3.7.7 flake8-debugger==3.1.0 -flake8-isort==2.6.0 +flake8-isort==2.7.0 flake8-print==3.1.0 flake8-quotes==1.0.0 -isort==4.3.10 -Markdown==3.0.1 +isort==4.3.16 +Markdown==3.1 mccabe==0.6.1 -more-itertools==6.0.0 +more-itertools==7.0.0 pluggy==0.9.0 -py==1.7.0 +py==1.8.0 pycodestyle==2.5.0 pyflakes==2.1.1 -Pygments==2.2.0 -pytest==4.3.0 -PyYAML==3.13 +pytest==4.4.0 +PyYAML==5.1 six==1.12.0 -testfixtures==6.4.3 +testfixtures==6.6.2 toml==0.10.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..b7e4789 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[aliases] +test=pytest diff --git a/setup.py b/setup.py index 470b009..0ab8372 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(fname): author="Nikita Sivakov", author_email="sivakov512@gmail.com", description="YAML metadata extension for Python-Markdown", - install_requires=["Markdown==3.0.1", "PyYAML>=3.13"], + install_requires=["Markdown~=3.0", "PyYAML~=5.0"], keywords="markdown yaml meta metadata", license="MIT", long_description=read("README.md"), @@ -20,7 +20,8 @@ def read(fname): name="markdown-full-yaml-metadata", py_modules=["full_yaml_metadata"], python_requires=">=3.6", - setup_requires=["setuptools-markdown"], + setup_requires=["pytest-runner"], + tests_require=["pytest"], version="1.0.0", url="https://github.com/sivakov512/python-markdown-full-yaml-metadata", ) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 64de491..0000000 --- a/tox.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py36, py37 - -[testenv] -commands = coverage run --source full_yaml_metadata -m pytest -deps = - coverage - -rrequirements.txt