Skip to content

Commit

Permalink
Merge branch 'stephenfin/tox-integration'
Browse files Browse the repository at this point in the history
Closes #790
  • Loading branch information
akrabat committed Jun 8, 2020
2 parents 0f13381 + d3bb61b commit 5d74831
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 69 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -9,5 +9,6 @@ rst2pdf/tests/output/*.log
.vscode/
.python-version
.venv/
.tox/
dist/
snap/.snapcraft
21 changes: 11 additions & 10 deletions .travis.yml
@@ -1,24 +1,25 @@
---
filter_secrets: false
os: linux
dist: xenial

addons:
apt:
packages:
- inkscape
- texlive-latex-base
- dvipng
- plantuml
- inkscape
- texlive-latex-base
- dvipng
- plantuml

language: python
python:
- 3.6
- 3.7
- 3.6
- 3.7

before_install:
- pip install --upgrade setuptools
- pip install pytest
- pip install -c requirements.txt -e .[tests,sphinx,images,svgsupport,aafiguresupport,mathsupport,rawhtmlsupport]
- pip install --upgrade setuptools
- pip install pytest
- pip install -c requirements.txt -e .[tests,sphinx,images,svgsupport,aafiguresupport,mathsupport,rawhtmlsupport]

script:
- pytest
- pytest
4 changes: 2 additions & 2 deletions doc/manual.rst
Expand Up @@ -1871,8 +1871,8 @@ Inkscape (``-e inkscape``)
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ../rst2pdf/extensions/inkscape_r2p.py
:start-after: '''
:end-before: '''
:start-after: """
:end-before: """

Dotted_TOC (``-e dotted_toc``)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
98 changes: 41 additions & 57 deletions setup.py
@@ -1,18 +1,33 @@
# -*- coding: utf-8 -*-

import os
import sys

from setuptools import find_packages, setup
from setuptools import find_packages
from setuptools import setup

version = '0.98'

def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
with open(os.path.join(os.path.dirname(__file__), *rnames)) as fh:
return fh.read()

long_description = read('README.rst')

install_requires = [
setup(
name='rst2pdf',
version='0.98',
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
package_dir={'': '.'},
package_data={
'rst2pdf': [
'styles/*.json',
'styles/*.style',
'images/*png',
'images/*jpg',
'templates/*tmpl',
],
},
dependency_links=[],
install_requires=[
'docutils',
'jinja2',
'pdfrw',
Expand All @@ -21,46 +36,16 @@ def read(*rnames):
'setuptools',
'six',
'smartypants',
]

try:
import json
except ImportError:
install_requires.append('simplejson')

tests_require = ['pyPdf2', 'pymupdf']
sphinx_require = ['sphinx']
hyphenation_require = ['wordaxe>=1.0']
svgsupport_require = ['svglib']
aafiguresupport_require = ['aafigure>=0.4']
mathsupport_require = ['matplotlib']
rawhtmlsupport_require = ['xhtml2pdf']

setup(
name="rst2pdf",
version=version,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*',
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
package_dir={'': '.'},
package_data=dict(rst2pdf=['styles/*.json',
'styles/*.style',
'images/*png',
'images/*jpg',
'templates/*tmpl'
]),
dependency_links=[
],
install_requires=install_requires,
tests_require=tests_require,
extras_require=dict(
tests=tests_require,
sphinx=sphinx_require,
hyphenation=hyphenation_require,
svgsupport=svgsupport_require,
aafiguresupport=aafiguresupport_require,
mathsupport=mathsupport_require,
rawhtmlsupport=rawhtmlsupport_require,
),
extras_require={
'tests': ['pyPdf2', 'pymupdf'],
'sphinx': ['sphinx'],
'hyphenation': ['wordaxe>=1.0'],
'svgsupport': ['svglib'],
'aafiguresupport': ['aafigure>=0.4'],
'mathsupport': ['matplotlib'],
'rawhtmlsupport': ['xhtml2pdf'],
},
# metadata for upload to PyPI
# Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
Expand All @@ -70,28 +55,27 @@ def read(*rnames):
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Documentation',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing',
'Topic :: Utilities',
],
author="rst2pdf maintainers",
author_email="maintainers@rstpdf.org",
description="Convert reStructured Text to PDF via ReportLab.",
long_description=long_description,
long_description_content_type="text/x-rst",
license="MIT",
keywords="restructured convert rst pdf docutils pygments reportlab",
url="https://rst2pdf.org",
author='rst2pdf maintainers',
author_email='maintainers@rstpdf.org',
description='Convert reStructured Text to PDF via ReportLab.',
long_description=read('README.rst'),
long_description_content_type='text/x-rst',
license='MIT',
keywords='restructured convert rst pdf docutils pygments reportlab',
url='https://rst2pdf.org',
project_urls={
'Bug Reports': 'https://github.com/rst2pdf/rst2pdf/issues',
'Source': 'https://github.com/rst2pdf/rst2pdf',
},
download_url="https://github.com/rst2pdf/rst2pdf/releases",
download_url='https://github.com/rst2pdf/rst2pdf/releases',
entry_points={'console_scripts': ['rst2pdf = rst2pdf.createpdf:main']},
test_suite='rst2pdf.tests.test_rst2pdf.test_suite', # TODO: this needs to be updated
)
41 changes: 41 additions & 0 deletions tox.ini
@@ -0,0 +1,41 @@
[tox]
minversion = 3.1
envlist = py37,docs,style
ignore_basepython_conflict = true

[testenv]
basepython = python3
usedevelop = true
description =
Run unit tests against {envname}.
deps =
-r requirements.txt
pytest
pytest-xdist
pymupdf
coverage
commands=
pytest -n auto {posargs}

[testenv:docs]
description =
Build documentation.
changedir =
{toxinidir}/doc
whitelist_externals =
cp
deps =
-r requirements.txt
commands =
rst2pdf manual.rst --custom-cover=assets/cover.tmpl -o output/manual.pdf -s assets/manual.style -b1
rst2man.py rst2pdf.rst output/rst2pdf.1
python rst2html-manual.py --stylesheet=assets/manual.css manual.rst output/manual.html
cp assets/biohazard.png output/html/assets/

[testenv:style]
description =
Run style checks.
deps =
flake8
commands =
flake8 rst2pdf setup.py

0 comments on commit 5d74831

Please sign in to comment.