diff --git a/austin/format/speedscope.py b/austin/format/speedscope.py index 39d0905..9ffb4ac 100644 --- a/austin/format/speedscope.py +++ b/austin/format/speedscope.py @@ -35,6 +35,8 @@ from austin.stats import MetricType from austin.stats import Sample +__version__ = "0.2.1" + SpeedscopeJson = Dict SpeedscopeWeight = int ProfileName = str @@ -158,7 +160,7 @@ def asdict(self) -> SpeedscopeJson: key=lambda p: p["name"].rsplit(maxsplit=1)[-1], ), "name": self.name, - "exporter": "Austin2Speedscope Converter 0.2.0", + "exporter": f"Austin2Speedscope Converter {__version__}", } def dump(self, stream: TextIO) -> None: @@ -196,7 +198,7 @@ def main() -> None: "--indent", type=int, help="Give a non-null value to prettify the JSON output." ) - arg_parser.add_argument("-V", "--version", action="version", version="0.1.0") + arg_parser.add_argument("-V", "--version", action="version", version=__version__) args = arg_parser.parse_args() diff --git a/austin/stats.py b/austin/stats.py index 3216c57..4bb6559 100644 --- a/austin/stats.py +++ b/austin/stats.py @@ -184,7 +184,7 @@ def parse(frame: str) -> "Frame": raise InvalidFrame(frame) try: - module, function, line = frame.rsplit(":", maxsplit=3) + module, function, line = frame.rsplit(":", maxsplit=2) except ValueError: raise InvalidFrame(frame) from None return Frame(function, module, int(line)) diff --git a/noxfile.py b/noxfile.py index b75a05c..fb7a869 100644 --- a/noxfile.py +++ b/noxfile.py @@ -16,7 +16,7 @@ "3.9", "3.10", ] -REQUESTED_PYTHON_VERSION = os.getenv("PYTHON") or SUPPORTED_PYTHON_VERSIONS +REQUESTED_PYTHON_VERSION = os.getenv("PYTHON") or SUPPORTED_PYTHON_VERSIONS[-1] if sys.platform == "win32": PYTEST_OPTIONS = ["-vvvs"] @@ -83,7 +83,7 @@ def mypy(session): ) -@nox.session(python="3.8") +@nox.session(python="3.9") def coverage(session): """Upload coverage data.""" install_with_constraints(session, "coverage[toml]", "codecov") diff --git a/test/data/austin.json b/test/data/austin.json index 50568c5..a7a6c4a 100644 --- a/test/data/austin.json +++ b/test/data/austin.json @@ -513,5 +513,5 @@ } ], "name": "austin.out", - "exporter": "Austin2Speedscope Converter 0.2.0" + "exporter": "Austin2Speedscope Converter 0.2.1" } \ No newline at end of file diff --git a/test/stats/test_frame.py b/test/stats/test_frame.py index 40316a1..38bcae6 100644 --- a/test/stats/test_frame.py +++ b/test/stats/test_frame.py @@ -45,3 +45,9 @@ def test_frame_parser_invalid(): def test_frame_str(): assert str(Frame("foo", "foo_module", 10)) == "foo_module:foo:10" + + +def test_frame_win_drive(): + assert Frame.parse("C:\\user\\bar.py:foo:42") == Frame( + "foo", "C:\\user\\bar.py", 42 + )