From 0e2b0f241d09c1c1e9a9de51976101b86ed70851 Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:33:58 -0400 Subject: [PATCH 1/7] fix: #17 move version our of VERSION.txt --- MANIFEST.in | 1 - VERSION.txt | 1 - datemath/_version.py | 8 +------- setup.py | 15 ++++++++------- verify.py | 4 ---- 5 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 VERSION.txt diff --git a/MANIFEST.in b/MANIFEST.in index 9dd3e50..c4747a2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ -include VERSION.txt include README.md include CHANGELOG.md include LICENSE diff --git a/VERSION.txt b/VERSION.txt deleted file mode 100644 index d9c62ed..0000000 --- a/VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -3.0.2 \ No newline at end of file diff --git a/datemath/_version.py b/datemath/_version.py index 0708e9a..8d1c862 100644 --- a/datemath/_version.py +++ b/datemath/_version.py @@ -1,7 +1 @@ -import os - -current_dir = os.path.dirname(os.path.abspath(__file__)) -version_file = os.path.join(current_dir, '../VERSION.txt') - -with open(version_file, 'r') as f: - __version__ = f.read().strip() \ No newline at end of file +__version__ = "3.0.3" diff --git a/setup.py b/setup.py index 8feea92..c7995d2 100644 --- a/setup.py +++ b/setup.py @@ -8,16 +8,17 @@ from setuptools import setup, find_packages # To use a consistent encoding from codecs import open +import os from os import path here = path.abspath(path.dirname(__file__)) -# Get the long description from the README file -with open(path.join(here, 'README.md'), encoding='utf-8') as f: - long_description_from_readme = f.read() -with open(path.join(here, 'VERSION.txt'), encoding='utf-8') as fv: - version = fv.read() +version = {} +with open(os.path.join(here, 'datemath', '_version.py')) as f: + exec(f.read(), version) + VERSION = version['__version__'] + setup( name='python-datemath', @@ -25,8 +26,8 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version=version, - download_url = 'https://github.com/nickmaccarthy/python-datemath/tarball/{0}'.format(version), + version=VERSION, + download_url = 'https://github.com/nickmaccarthy/python-datemath/tarball/{0}'.format(VERSION), # The project's main homepage. url='https://github.com/nickmaccarthy/python-datemath', diff --git a/verify.py b/verify.py index 21c23a5..ec1cfdb 100644 --- a/verify.py +++ b/verify.py @@ -3,10 +3,6 @@ print(f'datemath version is {__version__}') -with open('VERSION.txt', 'r') as f: - version = f.read().strip() - -assert __version__ == version print(f'Now is: {datemath("now")}') From d95ce10cf04aac12669b325437238538494d9cb4 Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:34:33 -0400 Subject: [PATCH 2/7] chore: bump module versions --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5b33202..6089176 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ more-itertools==10.4.0 mypy==1.7.1 mypy-extensions==1.0.0 nh3==0.2.18 -packaging==16.8 +packaging==24.1 pkginfo==1.10.0 Pygments==2.15.0 pyparsing==2.2.0 @@ -32,6 +32,7 @@ requests==2.32.2 requests-toolbelt==0.9.1 rfc3986==2.0.0 rich==13.8.0 +setuptools==74.1.2 six==1.16.0 tqdm==4.66.3 traceback2==1.4.0 From 6939ec5d46444bdb1904eff70755dccf5939d06f Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:37:20 -0400 Subject: [PATCH 3/7] chore: update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a844f42..746cd06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.0.3] - 2024-09-12 +### fixed +- Fix: issue where version wasnt getting populated +- Fix: move version out of `VERSION.txt` and into `datemath/_version.py` directly +- Fix: typos in CHANGELOG. Thank you @s00hyun! + ## [3.0.2] - 2024-09-11 ### added - Feat: Complete typing with strict type-checking [#43](https://github.com/nickmaccarthy/python-datemath/pull/43) Thank you @Avasam! From 6c4b9cd487f40cf11e8b114568bda36c7340d8f2 Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:39:00 -0400 Subject: [PATCH 4/7] chore: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 746cd06..770d451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [3.0.3] - 2024-09-12 +Please use 3.0.3 going forward! 3.0.2 has a breaking bug. + ### fixed - Fix: issue where version wasnt getting populated - Fix: move version out of `VERSION.txt` and into `datemath/_version.py` directly From c84062ad20aaf28ecb093c0ee79801fe6d5c3c77 Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:40:31 -0400 Subject: [PATCH 5/7] fix: type set for version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c7995d2..e252cc5 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ version = {} with open(os.path.join(here, 'datemath', '_version.py')) as f: exec(f.read(), version) - VERSION = version['__version__'] + VERSION = str(version['__version__']) setup( From 2e809a8d69bd2d35c7d325701c0e6ce32db615f9 Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:43:58 -0400 Subject: [PATCH 6/7] fix: type set for version --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index e252cc5..36b3376 100644 --- a/setup.py +++ b/setup.py @@ -10,14 +10,14 @@ from codecs import open import os from os import path +from typing import Dict here = path.abspath(path.dirname(__file__)) - -version = {} +version: Dict[str, str] = {} with open(os.path.join(here, 'datemath', '_version.py')) as f: exec(f.read(), version) - VERSION = str(version['__version__']) + VERSION = version['__version__'] setup( From 80205ef1ce5901b3815fb4ff99cd11b505914ded Mon Sep 17 00:00:00 2001 From: Nick MacCarthy Date: Thu, 12 Sep 2024 15:45:37 -0400 Subject: [PATCH 7/7] fix: verify version in tests --- .github/workflows/tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f95128b..5dc195a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,3 +23,5 @@ jobs: run: python3 setup.py install --user - name: verify we can import run: python3 -c "from datemath import datemath; print(datemath('now-1d'))" + - name: verify our version + run: python3 -c "import datemath; print(datemath.__version__)" \ No newline at end of file