From d266f919b844b0926537c3078f980ac5eae8035f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 24 Mar 2022 00:21:52 +0000 Subject: [PATCH] fixed version bump (#11) * fixed version bump, by checking on cloud that the version in the toml corresponds to the release tag; modified the Makefile accordingly and updated the changelog * removed the prefix from the tag as its agains semantic versionsing rules and also disturbs the versioning check in the gha workflow --- .github/workflows/publish-to-pypi.yml | 10 ++++---- CHANGELOG.md | 8 +++++++ Makefile | 34 +++++++++++++++------------ pyproject.toml | 4 +--- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index cc6a9fc..2ee04e3 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -3,7 +3,7 @@ name: Publish Python 🐍 distributions 📦 to Switch PyPI on: push: tags: - - "v[0-9]+.[0-9]+.[0-9]+*" + - "[0-9]+.[0-9]+.[0-9]+*" jobs: build-n-publish: @@ -18,7 +18,6 @@ jobs: - name: Tries to get the tag version or branch name id: context run: | - echo ::set-output name=BRANCH_NAME::${GITHUB_REF#refs/heads/} echo ::set-output name=TAG_VERSION::${GITHUB_REF#refs/tags/} - name: Setup the Python Environment by installing Poetry @@ -28,8 +27,9 @@ jobs: shell: bash run: | # TAG_VERSION can be also obtained with: - # poetry version $(git describe --tags --abbrev=0) - poetry version $TAG_VERSION + # $(git describe --tags --abbrev=0) + proj_version=$(poetry version -s) + if [ $proj_version != $TAG_VERSION ]; then echo "Version $proj_version, defined in pyproject.toml, does not match TAG $TAG_VERSION of this release"; exit 3; fi poetry config repo.pypi-switch https://pypi.switch-ev.com/ poetry config http-basic.pypi-switch $PYPI_USER $PYPI_PASS poetry update @@ -38,4 +38,4 @@ jobs: env: TAG_VERSION: ${{ steps.context.outputs.TAG_VERSION }} PYPI_USER: ${{ secrets.PYPI_USER }} - PYPI_PASS: ${{ secrets.PYPI_PASS }} \ No newline at end of file + PYPI_PASS: ${{ secrets.PYPI_PASS }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fbd141..249902c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Network interface extraction from cs parameters; Update of the code with mqtt version 0.18.1 by @tropxy in https://github.com/SwitchEV/slac/pull/10 + +### Fixed + +- Fix set credentials by @tropxy in https://github.com/SwitchEV/slac/pull/8 + ## [0.4.0] - 2021-12-20 ### Added diff --git a/Makefile b/Makefile index b923ca9..55c2ad6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # all the recipes are phony (no files to check). -.PHONY: .check-env-vars .deps .pip-install docs tests build dev run update install-local run-local deploy help configure-credentials +.PHONY: .check-env-vars .deps .pip-install docs tests build dev run update install-local run-local deploy help release configure-credentials .DEFAULT_GOAL := help IS_LINUX_OS := $(shell uname -s | grep -c Linux) @@ -13,21 +13,24 @@ export PATH := ${HOME}/.local/bin:$(PATH) help: @echo "Please use 'make ' where is one of" @echo "" - @echo " build builds the app in Docker" - @echo " run runs the app in Docker with prod settings" - @echo " dev runs the app in Docker with dev settings" - @echo " run-local runs the app locally with prod settings" - @echo " run-local-sudo runs the app locally using prod settings and root privileges" - @echo " poetry-update updates the dependencies in poetry.lock" - @echo " install-local installs slac into the current environment" - @echo " set-credentials sets the Switch PyPi credentials directly into pyroject.toml. Use this recipe with caution" - @echo " tests run all the tests" - @echo " reformat reformats the code, using Black" - @echo " flake8 flakes8 the code" - @echo " deploy deploys the project using Poetry (not recommended, only use if really needed)" + @echo " build builds the app in Docker" + @echo " run runs the app in Docker with prod settings" + @echo " dev runs the app in Docker with dev settings" + @echo " run-local runs the app locally with prod settings" + @echo " run-local-sudo runs the app locally using prod settings and root privileges" + @echo " poetry-update updates the dependencies in poetry.lock" + @echo " install-local installs slac into the current environment" + @echo " set-credentials sets the Switch PyPi credentials directly into pyroject.toml. Use this recipe with caution" + @echo " tests run all the tests" + @echo " reformat reformats the code, using Black" + @echo " flake8 flakes8 the code" + @echo " release version= bumps the project version to , using poetry;" + @echo " deploy deploys the project using Poetry (not recommended, only use if really needed)" @echo "" @echo "Check the Makefile to know exactly what each target is doing." +.install-poetry: + @if [ -z ${IS_POETRY} ]; then pip install poetry; fi .check-os: # The @ is to surpress the output of the evaluation @@ -98,8 +101,9 @@ flake8: code-quality: reformat mypy black flake8 -bump-version: - poetry version +release: .install-poetry + @echo "Please remember to update the CHANGELOG.md, before tagging the release" + @poetry version ${version} deploy: .check-env-vars .deps build bump-version poetry config repo.pypi-switch https://pypi.switch-ev.com/ diff --git a/pyproject.toml b/pyproject.toml index b80a41e..9c48259 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,6 @@ [tool.poetry] name = "slac" -# This version is a placeholder as the real version is fetched from GitHub -# Tags during releases of the package -version = "0.0.0" +version = "0.4.0" description = "SLAC Protocol implementation, defined in ISO15118-3" authors = ["André Duarte "]