From 0640491d41ddb80bb4520e8e39cc3c1b3f72fe15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Verg=C3=A9?= Date: Fri, 14 Apr 2023 12:08:49 +0200 Subject: [PATCH] WIP --- .flake8 | 4 ++++ .github/workflows/ci.yaml | 16 +++++++++++----- pyproject.toml | 8 ++++++-- setup.py | 20 ++++++++++---------- 4 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..2b7958b8 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +import-order-style = pep8 +application-import-names = yamllint +ignore = W503,W504 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f0b62d7..76f4de5f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,9 +21,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 - run: - python -m pip install flake8 flake8-import-order sphinx - rstcheck[sphinx] doc8 - - run: python -m pip install . + pip install flake8 flake8-import-order sphinx rstcheck[sphinx] doc8 + - run: pip install . - run: flake8 . - run: doc8 $(git ls-files '*.rst') - run: rstcheck --ignore-directives automodule $(git ls-files '*.rst') @@ -53,8 +52,15 @@ 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 + - run: echo -e "[run]\nrelative_files = True" > .coveragerc + - run: pwd + - run: ls /home/runner/work/yamllint/yamllint/rules/truthy.py || true + - run: ls /home/runner/work/yamllint/yamllint/yamllint/rules/truthy.py + - run: coverage run -m unittest discover + - run: cat .coveragerc - name: Coveralls uses: AndreMiras/coveralls-python-action@develop + # with: + # base-path: 'yamllint' diff --git a/pyproject.toml b/pyproject.toml index 623b1f86..da3b1d6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,8 +77,9 @@ requires = [ [tool.setuptools] packages = ["yamllint", "yamllint.conf", "yamllint.rules"] -#[tool.setuptools.package-data] -#yamllint = ["conf/*.yaml"] +# TODO: Obligatoire sinon le RPM n'installe pas ces fichiers +[tool.setuptools.package-data] +yamllint = ["conf/*.yaml"] #TODO Ne marche pas #[tool.setuptools.exclude-package-data] @@ -91,3 +92,6 @@ packages = ["yamllint", "yamllint.conf", "yamllint.rules"] [tool.setuptools.dynamic] version = {attr = "yamllint.__version__"} + +[tool.coverage.run] +relative_files = true diff --git a/setup.py b/setup.py index 8f5e14b3..ddbf95d3 100644 --- a/setup.py +++ b/setup.py @@ -19,15 +19,15 @@ # support new packaging standards (e.g. PEP 517 or PEP 660): setup() -#from yamllint import (__author__, __license__, -# APP_NAME, APP_VERSION, APP_DESCRIPTION) +# from yamllint import (__author__, __license__, +# APP_NAME, APP_VERSION, APP_DESCRIPTION) # # -#setup( -# name=APP_NAME, -# version=APP_VERSION, -# author=__author__, -# description=APP_DESCRIPTION.split('\n')[0], -# long_description=APP_DESCRIPTION, -# license=__license__, -#) +# setup( +# name=APP_NAME, +# version=APP_VERSION, +# author=__author__, +# description=APP_DESCRIPTION.split('\n')[0], +# long_description=APP_DESCRIPTION, +# license=__license__, +# )