From b23f67361a128c139e988876d0a67ea3477898f6 Mon Sep 17 00:00:00 2001 From: staticdev Date: Thu, 13 Apr 2023 21:56:01 +0200 Subject: [PATCH] Add toml to coveralls and fix version on CLI --- .github/workflows/ci.yaml | 4 +++- docs/quickstart.rst | 2 +- yamllint/cli.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f0b62d..e4244c5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,8 +53,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Append GitHub Actions system path run: echo "$HOME/.local/bin" >> $GITHUB_PATH - - run: pip install coveralls + - run: pip install coverage[toml] - run: pip install . - run: coverage run --source=yamllint -m unittest discover + # https://github.com/AndreMiras/coveralls-python-action/issues/18 + - run: echo -e "[run]\nrelative_files = True" > .coveragerc - name: Coveralls uses: AndreMiras/coveralls-python-action@develop diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 1502084..47b4740 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -45,7 +45,7 @@ If you prefer installing from source, you can run, from the source directory: .. code:: bash - python setup.py sdist + poetry build pip install --user dist/yamllint-*.tar.gz Running yamllint diff --git a/yamllint/cli.py b/yamllint/cli.py index 5574f1b..af85278 100644 --- a/yamllint/cli.py +++ b/yamllint/cli.py @@ -19,7 +19,7 @@ import os import platform import sys -from yamllint import APP_DESCRIPTION, APP_NAME, APP_VERSION +from yamllint import APP_DESCRIPTION, APP_NAME, __version__ from yamllint import linter from yamllint.config import YamlLintConfig, YamlLintConfigError from yamllint.linter import PROBLEM_LEVELS @@ -171,7 +171,7 @@ def run(argv=None): action='store_true', help='output only error level problems') parser.add_argument('-v', '--version', action='version', - version='{} {}'.format(APP_NAME, APP_VERSION)) + version='{} {}'.format(APP_NAME, __version__)) args = parser.parse_args(argv)