Skip to content

Commit d96e8fa

Browse files
Merge pull request #56 from nickmaccarthy/fix/VERSION-issue
fix: #17 version issue
2 parents 50fa45b + 80205ef commit d96e8fa

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

.github/workflows/tests.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ jobs:
2323
run: python3 setup.py install --user
2424
- name: verify we can import
2525
run: python3 -c "from datemath import datemath; print(datemath('now-1d'))"
26+
- name: verify our version
27+
run: python3 -c "import datemath; print(datemath.__version__)"

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.0.3] - 2024-09-12
9+
Please use 3.0.3 going forward! 3.0.2 has a breaking bug.
10+
11+
### fixed
12+
- Fix: issue where version wasnt getting populated
13+
- Fix: move version out of `VERSION.txt` and into `datemath/_version.py` directly
14+
- Fix: typos in CHANGELOG. Thank you @s00hyun!
15+
816
## [3.0.2] - 2024-09-11
917
### added
1018
- Feat: Complete typing with strict type-checking [#43](https://github.com/nickmaccarthy/python-datemath/pull/43) Thank you @Avasam!

MANIFEST.in

-1
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

-1
This file was deleted.

datemath/_version.py

+1-7
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"

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ more-itertools==10.4.0
2121
mypy==1.7.1
2222
mypy-extensions==1.0.0
2323
nh3==0.2.18
24-
packaging==16.8
24+
packaging==24.1
2525
pkginfo==1.10.0
2626
Pygments==2.15.0
2727
pyparsing==2.2.0
@@ -32,6 +32,7 @@ requests==2.32.2
3232
requests-toolbelt==0.9.1
3333
rfc3986==2.0.0
3434
rich==13.8.0
35+
setuptools==74.1.2
3536
six==1.16.0
3637
tqdm==4.66.3
3738
traceback2==1.4.0

setup.py

+8-7
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
13+
from typing import Dict
1214

1315
here = path.abspath(path.dirname(__file__))
1416

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()
17+
version: Dict[str, str] = {}
18+
with open(os.path.join(here, 'datemath', '_version.py')) as f:
19+
exec(f.read(), version)
20+
VERSION = version['__version__']
1821

19-
with open(path.join(here, 'VERSION.txt'), encoding='utf-8') as fv:
20-
version = fv.read()
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

-4
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)