From 10743a61b319ff35b4a25be90308d2a2d72129a6 Mon Sep 17 00:00:00 2001 From: Aleksandr Shpak Date: Sat, 12 Nov 2022 13:06:55 +0300 Subject: [PATCH] update package version from pypi pipeline (#17) --- .github/workflows/pypi.yml | 33 ++++++++++++++++----------------- .pre-commit-config.yaml | 3 ++- makeqr/cli_app.py | 5 ++++- pyproject.toml | 2 +- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 809bf2d..6b3fd52 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -10,23 +10,22 @@ jobs: build: runs-on: ubuntu-latest steps: - - - name: Set up Python 3.9 - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: "3.9" - - - name: Checkout - uses: actions/checkout@v2 - - - name: dependencies + - uses: actions/checkout@v3 + - name: Extract branch name + shell: bash run: | - python -m pip install poetry==1.1.7 - - - name: build - run: poetry build - - - name: publish - run: | - poetry config http-basic.pypi ${{ secrets.PYPI_LOGIN }} ${{ secrets.PYPI_PASS }} - poetry publish + echo "##[set-output name=name;]$(echo ${GITHUB_REPOSITORY#*/})" + echo "##[set-output name=ver;]$(echo ${GITHUB_REF#refs/*/})" + echo "##[set-output name=minor_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*})" + echo "##[set-output name=major_ver;]$(TMP_VAR=${GITHUB_REF#refs/*/}; echo ${TMP_VAR%.*.*})" + echo "##[set-output name=sha;]$(git rev-parse --short "$GITHUB_SHA")" + id: extract_name_and_version + - run: sed -i 's/0.1.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' pyproject.toml + - run: head -n 3 pyproject.toml + - run: python -m pip install poetry==1.2.2 + - run: poetry build + - run: poetry config http-basic.pypi ${{ secrets.PYPI_LOGIN }} ${{ secrets.PYPI_PASS }} + - run: poetry publish diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e0bb53..0da673b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,9 +39,10 @@ repos: - id: check-added-large-files - id: check-json - id: check-merge-conflict - - id: check-yaml +# - id: check-yaml - id: detect-private-key - id: end-of-file-fixer - id: requirements-txt-fixer - id: forbid-new-submodules - id: trailing-whitespace + exclude: ^.+(\.md)$ diff --git a/makeqr/cli_app.py b/makeqr/cli_app.py index c63cba7..1c2159e 100644 --- a/makeqr/cli_app.py +++ b/makeqr/cli_app.py @@ -99,7 +99,10 @@ def func( try: qr.save(group_params["output"]) - except (ValueError, OSError) as err: + except ValueError as err: + click.echo(str(err), color=True, err=True) + qr.save(f"{group_params['output']}.png") + except OSError as err: click.echo(str(err), color=True, err=True) sys.exit(1) diff --git a/pyproject.toml b/pyproject.toml index caf1233..0d58212 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "makeqr" -version = "4.0.0rc1" +version = "0.1.0" description = "Generate QR cards for any occasion" authors = ["Aleksandr Shpak "] classifiers=[