Skip to content

Commit 0e2b0f2

Browse files
author
Nick MacCarthy
committed
fix: #17 move version our of VERSION.txt
1 parent 701d906 commit 0e2b0f2

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include VERSION.txt
21
include README.md
32
include CHANGELOG.md
43
include LICENSE

VERSION.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

datemath/_version.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
import os
2-
3-
current_dir = os.path.dirname(os.path.abspath(__file__))
4-
version_file = os.path.join(current_dir, '../VERSION.txt')
5-
6-
with open(version_file, 'r') as f:
7-
__version__ = f.read().strip()
1+
__version__ = "3.0.3"

setup.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,26 @@
88
from setuptools import setup, find_packages
99
# To use a consistent encoding
1010
from codecs import open
11+
import os
1112
from os import path
1213

1314
here = path.abspath(path.dirname(__file__))
1415

15-
# Get the long description from the README file
16-
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
17-
long_description_from_readme = f.read()
1816

19-
with open(path.join(here, 'VERSION.txt'), encoding='utf-8') as fv:
20-
version = fv.read()
17+
version = {}
18+
with open(os.path.join(here, 'datemath', '_version.py')) as f:
19+
exec(f.read(), version)
20+
VERSION = version['__version__']
21+
2122

2223
setup(
2324
name='python-datemath',
2425

2526
# Versions should comply with PEP440. For a discussion on single-sourcing
2627
# the version across setup.py and the project code, see
2728
# https://packaging.python.org/en/latest/single_source_version.html
28-
version=version,
29-
download_url = 'https://github.com/nickmaccarthy/python-datemath/tarball/{0}'.format(version),
29+
version=VERSION,
30+
download_url = 'https://github.com/nickmaccarthy/python-datemath/tarball/{0}'.format(VERSION),
3031

3132
# The project's main homepage.
3233
url='https://github.com/nickmaccarthy/python-datemath',

verify.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44

55
print(f'datemath version is {__version__}')
6-
with open('VERSION.txt', 'r') as f:
7-
version = f.read().strip()
8-
9-
assert __version__ == version
106

117

128
print(f'Now is: {datemath("now")}')

0 commit comments

Comments
 (0)