diff --git a/.drone.yml b/.drone.yml index 20f3f2b30f..2049d30a49 100644 --- a/.drone.yml +++ b/.drone.yml @@ -23,6 +23,12 @@ pipeline: - tox -e "${TOXENV}-${DATABASE}" volumes: - cache:/root/.cache + check_dist: + image: ${IMAGE} + commands: + - pip install twine + - python setup.py sdist + - twine check dist/* services: postgresql: diff --git a/setup.py b/setup.py index cf612da0bf..c81d065c27 100755 --- a/setup.py +++ b/setup.py @@ -9,12 +9,12 @@ from configparser import ConfigParser from setuptools import setup, find_packages -def read(fname, slice=None): +def read(fname): content = io.open( os.path.join(os.path.dirname(__file__), fname), 'r', encoding='utf-8').read() - if slice: - content = '\n'.join(content.splitlines()[slice]) + content = re.sub( + r'(?m)^\.\. toctree::\r?\n((^$|^\s.*$)\r?\n)*', '', content) return content