Skip to content

Commit

Permalink
moved from VERSION data file to version.py (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Sulla committed Sep 20, 2022
1 parent de2d7b9 commit cec2f09
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion frozendict/VERSION

This file was deleted.

10 changes: 1 addition & 9 deletions frozendict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .core import *
c_ext = False

from .version import version as __version__
import collections.abc as _abc

if not c_ext:
Expand All @@ -24,14 +25,8 @@ def _my_subclasshook(klass, subclass):

from pathlib import Path

version_filename = "VERSION"

curr_path = Path(__file__)
curr_dir = curr_path.parent
version_path = curr_dir / version_filename

with open(version_path) as f:
__version__ = f.read()

if c_ext:
__all__ = ("frozendict", "__version__", )
Expand All @@ -43,11 +38,8 @@ def _my_subclasshook(klass, subclass):
__all__ += ("FrozenOrderedDict", )

del Path
del version_filename
del curr_path
del curr_dir
del version_path
del f
del _abc

if not c_ext:
Expand Down
1 change: 1 addition & 0 deletions frozendict/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "2.3.4"
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
main_package_name = "frozendict"
test_dir_name = "test"
readme_filename = "README.md"
version_filename = "VERSION"
version_filename = "version.py"
py_typed_filename = "py.typed"
mypy_filename = "frozendict.pyi"
main_url = "https://github.com/Marco-Sulla/python-frozendict"
Expand Down Expand Up @@ -48,11 +48,11 @@

main_package_path = curr_dir / main_package_name

version = ""
version_path = main_package_path / version_filename

with open(version_path) as f:
version = f.read()
# create the version var
exec(f.read())

excluded_packages = (test_dir_name, )
packages = setuptools.find_packages(exclude=excluded_packages)
Expand Down

0 comments on commit cec2f09

Please sign in to comment.