Skip to content

Commit 67d659d

Browse files
author
Sam Harrison
committed
fix: update the setup file per codestyle and correct the LICENSE file test
1 parent 9a63d4b commit 67d659d

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

setup.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import io
22
import os
3+
34
from distutils.file_util import copy_file
45
from setuptools import setup
56

6-
77
dir_path = os.path.abspath(os.path.dirname(__file__))
8-
with io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8') as readme_file:
8+
readme_path = os.path.join(dir_path, 'README.rst')
9+
version_path = os.path.join(dir_path, 'VERSION.txt')
10+
11+
with io.open(readme_path, encoding='utf-8') as readme_file:
912
readme = readme_file.read()
10-
with io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8') as version_file:
13+
with io.open(version_path, encoding='utf-8') as version_file:
1114
version = version_file.read().strip()
15+
1216
base_url = 'https://github.com/sendgrid/'
1317

14-
copy_file(os.path.join(dir_path, 'VERSION.txt'),
18+
copy_file(version_path,
1519
os.path.join(dir_path, 'python_http_client', 'VERSION.txt'),
1620
verbose=0)
1721

tests/test_daterange.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,11 @@ def setUp(self):
99
self.openlicensefile = os.path.join(
1010
os.path.dirname(__file__),
1111
'../LICENSE.md')
12-
self.pattern = 'Copyright (c) %s Twilio SendGrid, Inc.' % (
12+
self.pattern = 'Copyright (C) %s, Twilio SendGrid, Inc.' % (
1313
time.strftime("%Y"))
1414
fh = open(self.openlicensefile)
15-
self.licensefile = fh.read()
15+
self.license_file = fh.read()
1616
fh.close()
1717

1818
def test__daterange(self):
19-
try:
20-
self.assertIn(self.pattern, self.licensefile)
21-
except AssertionError:
22-
warnings.warn("License file does not contain a current year!")
19+
self.assertIn(self.pattern, self.license_file)

0 commit comments

Comments
 (0)