Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

removed old changelog parsing; updated files in MANIFEST.in #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include changelog
include CHANGELOG.md
include LICENSE
include README.rst
include README.md
include requirements.txt
include rfctools_common/parser.py
include rfctools_common/log.py
Expand Down
46 changes: 1 addition & 45 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# Copyright The IETF Trust 2018-2019, All Rights Reserved
# --------------------------------------------------

import re
from setuptools import setup, find_packages
from codecs import open
from os import path
Expand All @@ -12,7 +11,7 @@
here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as file:
with open(path.join(here, 'README.md'), encoding='utf-8') as file:
long_description = file.read()
long_description = long_description.replace('\r', '')

Expand All @@ -25,49 +24,7 @@
extra_files = [l.split()[1] for l in file.read().splitlines() if l]


def parse(changelog):
ver_line = "^([a-z0-9+-]+) \(([^)]+)\)(.*?) *$"
sig_line = "^ ?-- ([^<]+) <([^>]+)> (.*?) *$"

entries = []
if isinstance(changelog, type('')):
changelog = open(changelog, mode='rU', encoding='utf-8')
for line in changelog:
if re.match(ver_line, line):
package, version, rest = re.match(ver_line, line).groups()
entry = {}
entry["package"] = package
entry["version"] = version
entry["logentry"] = ""
elif re.match(sig_line, line):
author, email, date = re.match(sig_line, line).groups()
entry["author"] = author
entry["email"] = email
entry["datetime"] = date
entry["date"] = " ".join(date.split()[:3])

entries += [entry]
else:
entry["logentry"] += line.rstrip() + '\n'
changelog.close()
return entries


changelog_entry_template = """
Version %(version)s (%(date)s)
------------------------------------------------

%(logentry)s

"""

long_description += """
Changelog
=========

""" + "\n".join([changelog_entry_template % entry for entry in parse("changelog")[:3]])

long_description = long_description.replace('\r', '')

setup(
name='rfctools_common',
Expand Down Expand Up @@ -117,7 +74,6 @@ def parse(changelog):
package_data={
'rfctools-common': ['templates/*']
},
include_package_data=True,

zip_safe=False
)