diff --git a/.github/release_process.md b/.github/release_process.md new file mode 100644 index 0000000..250aea4 --- /dev/null +++ b/.github/release_process.md @@ -0,0 +1,70 @@ +# Notes + +Notes regarding how to release + +## Bumping version + +In a branch specific for this, use the `bumpver` tool. +It is configured to update: +* pyproject.toml +* j2lint/__init__.py +* tests/test_cli.py (where a test verifies the version output) + +For instance to bump a patch version: +``` +bumpver update --patch +``` + +and for a minor version + +``` +bumpver update --minor +``` + +Tip: It is possible to check what the changes would be using `--dry` + +``` +bumpver update --minor --dry +``` + +## Creating release on Github + +Create the release on Github with the appropriate tag `vx.x.x` + +## Release version `x.x.x` + +TODO - make this a workflow + +`x.x.x` is the version to be released + +This is to be executed at the top of the repo + +1. Checkout the latest version of devel with the correct tag for the release +2. [Optional] Clean dist if required +3. Build the package locally + ``` + python -m build + ``` +4. Check the package with `twine` (replace with your vesion) + ``` + twine check dist/j2lint-x.x.x-py3-none-any.whl + ``` +5. Upload the package to test.pypi + ``` + twine upload -r testpypi dist/j2lint-x.x.x.* + ``` +6. Verify the package by installing it in a local venv and checking it installs + and run correctly (run the tests) + ``` + # In a brand new venv + pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --no-cache j2lint + ``` +7. Upload the package to pypi + ``` + twine upload dist/j2lint-x.x.x.* + ``` +8. Like 5 but for normal pypi + ``` + # In a brand new venv + pip install j2lint + ``` diff --git a/j2lint/__init__.py b/j2lint/__init__.py index bb7e94a..b3de867 100644 --- a/j2lint/__init__.py +++ b/j2lint/__init__.py @@ -1,7 +1,7 @@ """__init__.py - A command-line utility that checks for best practices in Jinja2. """ NAME = "j2lint" -VERSION = "v1.0.0" +VERSION = "v1.0.1" DESCRIPTION = __doc__ __author__ = "Arista Networks" diff --git a/pyproject.toml b/pyproject.toml index 9335029..a064fe9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "j2lint" -version = "v1.0.0" +version = "v1.0.1" description = "Command-line utility that validates jinja2 syntax according to Arista's AVD style guide." readme = "README.md" authors = [{ name = "Arista Ansible Team", email = "ansible@arista.com" }] @@ -55,16 +55,18 @@ Homepage = "https://github.com/aristanetworks/j2lint.git" j2lint = "j2lint.cli:run" [tool.bumpver] -current_version = "v1.0.0" -version_pattern = "MAJOR.MINOR.PATCH" -commit_message = "Chore: version {old_version} -> {new_version}" +current_version = "v1.0.1" +version_pattern = "vMAJOR.MINOR.PATCH" +commit_message = "Chore: Version {old_version} -> {new_version}" commit = true -tag = true +# No Tag +tag = false push = false [tool.bumpver.file_patterns] "pyproject.toml" = ['current_version = "{version}"', 'version = "{version}"'] "j2lint/__init__.py" = ["{version}"] +"tests/test_cli.py" = ["{version}"] [tool.pylint.'MESSAGES CONTROL'] max-line-length = 160 diff --git a/tests/test_cli.py b/tests/test_cli.py index 6237f8d..d8f3962 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -267,7 +267,7 @@ def test_print_json_output( pytest.param(["-h"], "HELP", "", 0, pytest.raises(SystemExit), 0, 0, id="help"), pytest.param( ["--version"], - "Jinja2-Linter Version v1.0.0\n", + "Jinja2-Linter Version v1.0.1\n", "", 0, does_not_raise(),