Skip to content

Commit

Permalink
Allow accessing version variables after initialization (#58)
Browse files Browse the repository at this point in the history
* Allow accessing version variables after initialization

This commit does two things:

1. Version variables are accessable by users after
   package initialization.

   Users can now use my_package.VERSION over exporting
   my_package.version, then accessing the version value,
   which makes things much easier.

2. Adapt changes made to version values to other parts
   of the project

   Version variables were renamed to the following:

        VERSION_SHORT ==> VERSION
        VERSION       ==> RELEASE

    and parts referring to version values were changed
    accordingly, so nothing's broken.

Signed-off-by: TheRealKeto <[email protected]>

* Revert renaming versioning variables

This commit reverts the change made to version
variables, renaming them back to their original
naming

    VERSION_SHORT <== VERSION
    VERSION       <== RELEASE

Signed-off-by: TheRealKeto <[email protected]>

* Correctly use version variable in setup script

Signed-off-by: TheRealKeto <[email protected]>
  • Loading branch information
TheRealKeto authored Jun 23, 2022
1 parent 7583238 commit 588f3e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

sys.path.insert(0, os.path.abspath("../../"))

from my_package.version import VERSION, VERSION_SHORT # noqa: E402
from my_package import VERSION, VERSION_SHORT # noqa: E402

# -- Project information -----------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions my_package/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .version import VERSION, VERSION_SHORT

0 comments on commit 588f3e8

Please sign in to comment.