Skip to content

Commit

Permalink
Merge pull request #47 from zalando-incubator/header-info
Browse files Browse the repository at this point in the history
Update header info: add version and change the repository URL
  • Loading branch information
tortila committed Mar 11, 2019
2 parents c265efe + fa9fee3 commit b0fda74
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 14 deletions.
16 changes: 16 additions & 0 deletions docs/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ The format is based on `Keep a Changelog`_, and this project adheres to
:local:
:depth: 1

.. _v1.1.1:

v1.1.1
======

- Release date: 2019-03-11 16:03

- Diff__.

__ https://github.com/zalando-incubator/transformer/compare/v1.1.0...v1.1.1

Changed
-------

A header in all generated HAR files now contains the version of Transformer and its new repository's URL.

.. _v1.1.0:

v1.1.0
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# The short X.Y version
version = "1.1"
# The full version, including alpha/beta/rc tags
release = "1.1.0"
release = "1.1.1"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "har-transformer"
version = "1.1.0"
version = "1.1.1"
description = "A tool to convert HAR files into a locustfile."
authors = [
"Serhii Cherniavskyi <serhii.cherniavskyi@zalando.de>",
Expand Down
4 changes: 2 additions & 2 deletions transformer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
This module exports the functions that should cover most use-cases of any
Transformer user.
"""
import pkg_resources
from .transform import dumps, dump
from ._version import __version__ as package_version

__version__ = pkg_resources.get_distribution("har-transformer").version
__version__ = package_version

__all__ = ["dumps", "dump"]
3 changes: 3 additions & 0 deletions transformer/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pkg_resources

__version__ = pkg_resources.get_distribution("har-transformer").version
3 changes: 2 additions & 1 deletion transformer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
import ecological
from docopt import docopt

from transformer import __version__, dump
from transformer import dump
from ._version import __version__


class Config(ecological.AutoConfig, prefix="transformer"):
Expand Down
7 changes: 4 additions & 3 deletions transformer/locust.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
from transformer.plugins.contracts import Plugin
from transformer.scenario import Scenario
from transformer.task import Task, Task2
from ._version import __version__

LOCUST_MAX_WAIT_DELAY = 10

LOCUST_MIN_WAIT_DELAY = 0

LOCUSTFILE_COMMENT = """
File automatically generated by Transformer:
https://github.bus.zalan.do/TIP/transformer
LOCUSTFILE_COMMENT = f"""
File automatically generated by Transformer v{__version__}:
https://github.com/zalando-incubator/Transformer
""".strip()


Expand Down
13 changes: 7 additions & 6 deletions transformer/test_locust.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from transformer.task import Task, TIMEOUT
from transformer.plugins import plugin, Contract
from transformer.task import Task2
from ._version import __version__


class TestLocustfile:
Expand All @@ -31,9 +32,9 @@ def test_it_renders_a_locustfile_template(self):
)
script = locustfile([scenario_group])
expected = string.Template(
"""
# File automatically generated by Transformer:
# https://github.bus.zalan.do/TIP/transformer
f"""
# File automatically generated by Transformer v{__version__}:
# https://github.com/zalando-incubator/Transformer
import re
from locust import HttpLocust
from locust import TaskSequence
Expand Down Expand Up @@ -77,9 +78,9 @@ def plugin_change_task_name(t: Task2) -> Task2:
)
script = locustfile([scenario_group])
expected = string.Template(
"""
# File automatically generated by Transformer:
# https://github.bus.zalan.do/TIP/transformer
f"""
# File automatically generated by Transformer v{__version__}:
# https://github.com/zalando-incubator/Transformer
import re
from locust import HttpLocust
from locust import TaskSequence
Expand Down

0 comments on commit b0fda74

Please sign in to comment.