File tree Expand file tree Collapse file tree 5 files changed +9
-20
lines changed
Expand file tree Collapse file tree 5 files changed +9
-20
lines changed Original file line number Diff line number Diff line change 1- include VERSION.txt
21include README.md
32include CHANGELOG.md
43include LICENSE
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 88from setuptools import setup , find_packages
99# To use a consistent encoding
1010from codecs import open
11+ import os
1112from os import path
1213
1314here = 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
2223setup (
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' ,
Original file line number Diff line number Diff line change 33
44
55print (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
128print (f'Now is: { datemath ("now" )} ' )
You can’t perform that action at this time.
0 commit comments