From 4ec0c828494f158c3b5a277dd35a00c55755dc78 Mon Sep 17 00:00:00 2001 From: leo-desbureaux-tellae Date: Thu, 8 Sep 2022 13:24:38 +0200 Subject: [PATCH 1/3] remove commit hash from run summary --- starling_sim/simulation_scenario.py | 5 +---- starling_sim/utils/utils.py | 11 ----------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/starling_sim/simulation_scenario.py b/starling_sim/simulation_scenario.py index 14616b8..c2f4aab 100644 --- a/starling_sim/simulation_scenario.py +++ b/starling_sim/simulation_scenario.py @@ -7,7 +7,7 @@ import json from copy import deepcopy -from starling_sim.utils.utils import json_load, validate_against_schema, get_git_revision_hash +from starling_sim.utils.utils import json_load, validate_against_schema from starling_sim.utils import paths from starling_sim.version import __version__ from starling_sim.utils.config import config @@ -157,9 +157,6 @@ def init_run_summary(self): # get starling version summary["starling_version"] = __version__ - # get current commit - summary["commit"] = get_git_revision_hash() - # copy scenario parameters summary["parameters"] = self.copy_parameters() diff --git a/starling_sim/utils/utils.py b/starling_sim/utils/utils.py index 9c64804..31affe2 100644 --- a/starling_sim/utils/utils.py +++ b/starling_sim/utils/utils.py @@ -1063,17 +1063,6 @@ def create_if_not_exists(folder): else: return False - -# git - - -def get_git_revision_hash() -> str: - """ - Get current git commit hash - """ - return subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii").strip() - - # console log From ab5755bc5e5fc6cdfcec751c9e4a67ec0cb87c27 Mon Sep 17 00:00:00 2001 From: leo-desbureaux-tellae Date: Thu, 8 Sep 2022 13:41:12 +0200 Subject: [PATCH 2/3] moved __version__ variable to starling_sim/__init__.py --- .versionrc.js | 2 +- setup.py | 2 +- starling_sim/__init__.py | 5 ++++- starling_sim/run.py | 2 +- starling_sim/simulation_scenario.py | 2 +- starling_sim/version.py | 3 --- 6 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 starling_sim/version.py diff --git a/.versionrc.js b/.versionrc.js index f8efc19..d0d8ca2 100644 --- a/.versionrc.js +++ b/.versionrc.js @@ -1,5 +1,5 @@ const tracker = { - filename: 'starling_sim/version.py', + filename: 'starling_sim/__init__.py', updater: '.versionrc.python.updater.js' } diff --git a/setup.py b/setup.py index d6c603e..42e4e81 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import setuptools import os -from starling_sim.version import __version__ +from starling_sim import __version__ # short description of the project DESC = "Agent-based framework for mobility simulation" diff --git a/starling_sim/__init__.py b/starling_sim/__init__.py index 7f4799d..ede4807 100644 --- a/starling_sim/__init__.py +++ b/starling_sim/__init__.py @@ -1,3 +1,6 @@ """ -This package contains modules related to the simulation run +This package contains the different modules of Starling. """ + +#: Starling version +__version__ = "0.10.0" diff --git a/starling_sim/run.py b/starling_sim/run.py index aa78518..c6ce8d7 100644 --- a/starling_sim/run.py +++ b/starling_sim/run.py @@ -8,7 +8,7 @@ from starling_sim.utils.simulation_logging import DEFAULT_LOGGER_LEVEL, setup_logging from starling_sim.utils.test_models import launch_tests from starling_sim.utils import paths -from starling_sim.version import __version__ +from starling_sim import __version__ def run_main(): diff --git a/starling_sim/simulation_scenario.py b/starling_sim/simulation_scenario.py index c2f4aab..4ac16c7 100644 --- a/starling_sim/simulation_scenario.py +++ b/starling_sim/simulation_scenario.py @@ -9,8 +9,8 @@ from starling_sim.utils.utils import json_load, validate_against_schema from starling_sim.utils import paths -from starling_sim.version import __version__ from starling_sim.utils.config import config +from starling_sim import __version__ class SimulationScenario: diff --git a/starling_sim/version.py b/starling_sim/version.py deleted file mode 100644 index b67b92c..0000000 --- a/starling_sim/version.py +++ /dev/null @@ -1,3 +0,0 @@ -"""Starling version""" - -__version__ = "0.10.0" From 43af5ab882a42c66f452657d2ea3c8da690c76a9 Mon Sep 17 00:00:00 2001 From: leo-desbureaux-tellae Date: Thu, 8 Sep 2022 13:52:09 +0200 Subject: [PATCH 3/3] black style --- starling_sim/utils/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/starling_sim/utils/utils.py b/starling_sim/utils/utils.py index 31affe2..bc827ff 100644 --- a/starling_sim/utils/utils.py +++ b/starling_sim/utils/utils.py @@ -1063,6 +1063,7 @@ def create_if_not_exists(folder): else: return False + # console log