Skip to content

Commit 39afbb5

Browse files
committed
Move version to __init__.py for flit
1 parent 9b94681 commit 39afbb5

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

dash_bootstrap_components/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
from . import _components
77
from ._components import * # noqa
88
from ._table import _generate_table_from_df
9-
# from ._version import __version__ # noqa
10-
11-
__version__ = "0.0.1"
129

10+
__version__ = "0.10.4-dev"
1311
_current_path = os.path.dirname(os.path.abspath(__file__))
1412

1513
METADATA_PATH = os.path.join(_current_path, "_components", "metadata.json")

dash_bootstrap_components/_version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

tasks.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,15 @@ def release_python_sdist():
182182

183183
def set_pyversion(version):
184184
version = normalize_version(version)
185-
version_path = DASH_BOOTSTRAP_DIR / "_version.py"
186-
with version_path.open("w") as f:
187-
f.write(VERSION_TEMPLATE.format(version_string=version))
185+
init_path = DASH_BOOTSTRAP_DIR / "__init__.py"
186+
with init_path.open("r") as f:
187+
lines = f.readlines()
188+
189+
index = [line.startswith("__version__ = ") for line in lines].index(True)
190+
lines[index] = VERSION_TEMPLATE.format(version_string=version)
191+
192+
with init_path.open("w") as f:
193+
f.writelines(lines)
188194

189195
test_version_path = HERE / "tests" / "test_version.py"
190196
with test_version_path.open("w") as f:

0 commit comments

Comments
 (0)