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 diff --git a/CHANGELOG.md b/CHANGELOG.md index a844f42..770d451 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ 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 +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 +- 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! 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/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 diff --git a/setup.py b/setup.py index 8feea92..36b3376 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 +from typing import Dict 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() +version: Dict[str, str] = {} +with open(os.path.join(here, 'datemath', '_version.py')) as f: + exec(f.read(), version) + VERSION = version['__version__'] -with open(path.join(here, 'VERSION.txt'), encoding='utf-8') as fv: - version = fv.read() 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")}')