Skip to content

Commit

Permalink
feat: improve version and commit trace (#68)
Browse files Browse the repository at this point in the history
* remove commit hash from run summary
* moved __version__ variable to starling_sim/__init__.py
  • Loading branch information
leo-desbureaux-tellae authored Sep 8, 2022
1 parent 39d9fd8 commit a679c68
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .versionrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const tracker = {
filename: 'starling_sim/version.py',
filename: 'starling_sim/__init__.py',
updater: '.versionrc.python.updater.js'
}

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion starling_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion starling_sim/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
7 changes: 2 additions & 5 deletions starling_sim/simulation_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
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
from starling_sim import __version__


class SimulationScenario:
Expand Down Expand Up @@ -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()

Expand Down
10 changes: 0 additions & 10 deletions starling_sim/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,16 +1064,6 @@ def create_if_not_exists(folder):
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


Expand Down
3 changes: 0 additions & 3 deletions starling_sim/version.py

This file was deleted.

0 comments on commit a679c68

Please sign in to comment.