Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 7b3597d

Browse files
committed
setup.py: handle missing readme/changelog files
This is the case when running tests under tox.
1 parent c15b110 commit 7b3597d

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22

3+
import os
34
import pypandoc
45

56
try:
@@ -9,14 +10,17 @@
910
use_setuptools()
1011
from setuptools import setup
1112

12-
readme = pypandoc.convert_file('README.md', 'rst')
13-
changelog = pypandoc.convert_file('CHANGELOG.md', 'rst')
13+
long_description = 'This library provides the python client for the Packet API.'
14+
if os.path.isfile('README.md') and os.path.isfile('CHANGELOG.md'):
15+
readme = pypandoc.convert_file('README.md', 'rst')
16+
changelog = pypandoc.convert_file('CHANGELOG.md', 'rst')
17+
long_description = readme + '\n' + changelog
1418

1519
setup(
1620
name='packet-python',
1721
version='1.36.0',
1822
description='Packet API client',
19-
long_description=readme + '\n' + changelog,
23+
long_description=long_description,
2024
url='https://github.com/packethost/packet-python',
2125
author='Packet Developers',
2226
license='LGPL v3',

0 commit comments

Comments
 (0)