Skip to content

Commit

Permalink
setup.py will now skip header from the GitHub markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Mar 5, 2021
1 parent 1d40aa7 commit 9e733a6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# [svet](https://github.com/rtmigo/svet#readme)

[![Generic badge](https://img.shields.io/badge/ready_for_use-maybe-orange.svg)](#)
[![PyPI version shields.io](https://img.shields.io/pypi/v/svet.svg)](https://pypi.python.org/pypi/svet/)
[![Actions Status](https://github.com/rtmigo/svet/workflows/CI/badge.svg?branch=master)](https://github.com/rtmigo/svet/actions)
Expand Down
25 changes: 20 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@

constants = SourceFileLoader('constants', 'svet/constants.py').load_module()


def readDocText():
"""Reads README.md and returns the text after first empty line.
It helps to skip the header with badges intended only for GitHub.
"""
doctext = (Path(__file__).parent / 'README.md').read_text()

# skipping until first empty line
lines = [l.strip() for l in doctext.splitlines()]
firstEmptyLineIndex = lines.index("")
lines = lines[firstEmptyLineIndex + 1:]

return "\n".join(lines)


setup(
name="svet",
version=constants.__version__,
Expand All @@ -18,7 +33,7 @@

description="Command-line shortcuts for Python virtual environments",

long_description=(Path(__file__).parent / 'README.md').read_text(),
long_description=readDocText(),
long_description_content_type='text/markdown',

license='BSD-3-Clause',
Expand All @@ -29,8 +44,8 @@
]},

keywords="""
virtual-environment venv virtualenv python
""".split(),
virtual-environment venv virtualenv python
""".split(),

# https://pypi.org/classifiers/
classifiers=[
Expand All @@ -49,5 +64,5 @@

# test_suite='nose.collector',
# tests_require=['nose'],
#zip_safe=False
)
# zip_safe=False
)

0 comments on commit 9e733a6

Please sign in to comment.