Skip to content

fix: #17 version issue #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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__)"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include VERSION.txt
include README.md
include CHANGELOG.md
include LICENSE
Expand Down
1 change: 0 additions & 1 deletion VERSION.txt

This file was deleted.

8 changes: 1 addition & 7 deletions datemath/_version.py
Original file line number Diff line number Diff line change
@@ -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()
__version__ = "3.0.3"
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
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',

# 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',
Expand Down
4 changes: 0 additions & 4 deletions verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")}')
Expand Down
Loading