mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
dvc: refactor package versioning logic
- Use `version.py` to compute a dynamic version stored in `__version__`. Version information was scattered across the source code (`VERSION_BASE`, `VERSION`, `__version__`, and `version.py`). - Read `__version__` from `setup.py` and **pin** it using custom `build_py` command class. This way, we can maintain consistancy between the build version and the runtime one. Also, this gives us the ability to run `setup.py` without depending on on `dvc` itself. Close #1824
This commit is contained in:
@@ -42,7 +42,7 @@ command_exists()
|
||||
fpm_build()
|
||||
{
|
||||
print_info "Building $1..."
|
||||
VERSION=$(python -c "import dvc; from dvc import VERSION; print(str(VERSION))")
|
||||
VERSION=$(python -c "import dvc; from dvc import __version__; print(str(__version__))")
|
||||
fpm -s dir \
|
||||
-f \
|
||||
-t $1 \
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# This script generates config.ini for setup.iss script
|
||||
from dvc import VERSION
|
||||
from dvc import __version__
|
||||
from dvc.utils.compat import ConfigParser
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
config.add_section("Version")
|
||||
config.set("Version", "Version", VERSION)
|
||||
config.set("Version", "Version", __version__)
|
||||
|
||||
with open("scripts/innosetup/config.ini", "w") as f:
|
||||
config.write(f)
|
||||
|
||||
Reference in New Issue
Block a user