Skip to content

Commit

Permalink
Update GA and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wwakabobik committed Aug 19, 2024
1 parent 5efcc7b commit cfa0860
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linters
name: Linters-pR

on:
push:
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/master_linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Linters
on:
push:
branches:
- 'master'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
pip install mypy
pip install wemake-python-styleguide
pip install black
pip install types-xmltodict
pip install types-requests
- name: Analysing the code with pylint
id: pylint
continue-on-error: true
run: |
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
echo $changed_files
if [ -n "$changed_files" ]; then
PYTHONPATH=. pylint $changed_files
else
echo "No files changed, passing by"
exit 0
fi
- name: Analysing the code with mypy
id: mypy
continue-on-error: true
run: |
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
echo $changed_files
if [ -n "$changed_files" ]; then
PYTHONPATH=. mypy $changed_files --install-types --non-interactive --ignore-missing-imports
else
echo "No files changed, passing by"
exit 0
fi
- name: Check code with flake8
id: flake8
continue-on-error: true
run: |
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
echo $changed_files
if [ -n "$changed_files" ]; then
PYTHONPATH=. flake8 $changed_files
else
echo "No files changed, passing by"
exit 0
fi
- name: Check code with Black
id: black
continue-on-error: true
run: |
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
echo $changed_files
if [ -n "$changed_files" ]; then
PYTHONPATH=. black --diff --check --color $changed_files
else
echo "No files changed, passing by"
exit 0
fi
- name: Check runner state
run: |
if [[ "${{ steps.pylint.outcome }}" == "failure" || "${{ steps.black.outcome }}" == "failure" || "${{ steps.mypy.outcome }}" == "failure" ]]; then
echo "Linters failed, refer to related sections for info"
exit 1
fi
45 changes: 45 additions & 0 deletions .github/workflows/master_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests
on:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest-xdist
pip install pytest-ordering
pip install pytest-order
pip install pytest-cov
- name: Add 'src' to PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)/src:." >> $GITHUB_ENV
- name: Execute tests
id: tests
run: pytest tests -n=auto --dist=loadfile --order-scope=module --cov=testrail_api_reporter --cov-report=term --cov-report=xml:coverage.xml --cov-report=html
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: wwakabobik/testrail_api_reporter
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests-PR
on:
push:
branches-ignore:
- 'master'
pull_request:
branches-ignore:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest-xdist
pip install pytest-cov
- name: Add 'src' to PYTHONPATH
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)/src:." >> $GITHUB_ENV
- name: Execute tests
id: tests
run: pytest tests -n=auto --dist=loadfile --order-scope=module --cov=testrail_api_reporter --cov-report=term --cov-report=xml:coverage.xml --cov-fail-under=95
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# TestRail reporter

pypi package can be found [here](https://pypi.org/project/testrail-api-reporter/).
[![PyPI version](https://badge.fury.io/py/testrail-api-reporter.svg)](https://badge.fury.io/py/testrail-api-reporter)
[![Linters](https://github.com/wwakabobik/pytest-rerunclassfailures/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/testrail-api-reporter/actions/workflows/master_linters.yml)
[![Tests](https://github.com/wwakabobik/pytest-rerunclassfailures/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/pytest-rerunclassfailures/actions/workflows/master_tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/wwakabobik/pytest-rerunclassfailures/badge.svg?branch=master)](https://coveralls.io/github/wwakabobik/testrail-api-reporter?branch=master)
[![codecov](https://codecov.io/gh/wwakabobik/testrail-api-reporter/graph/badge.svg?token=F1I7TBGE5U)](https://codecov.io/gh/wwakabobik/pytest-rerunclassfailures)
![PyPI - License](https://img.shields.io/pypi/l/testrail-api-reporter)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/testrail-api-reporter)
[![Downloads](https://static.pepy.tech/badge/testrail_api_reporter)](https://pepy.tech/project/testrail_api_reporter)
[![Downloads](https://static.pepy.tech/badge/testrail_api_reporter/month)](https://pepy.tech/project/testrail_api_reporter)

## This is Testrail API reporter tools.

Expand Down
106 changes: 106 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,109 @@ min-public-methods = 1
[[tool.mypy.overrides]]
module = "testrail_api.*"
ignore_missing_imports = true




[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "leonardo_api"
version = "0.0.10"
authors = [
{ name="Iliya Vereshchagin", email="[email protected]" },
]
maintainers = [
{ name="Iliya Vereshchagin", email="[email protected]" },
]
keywords = ["leonardo", "ai", "image generation", "artificial intelligence", "api", "llm", "leonardo.ai", "stablediffusion"]
description = "Leonardo.ai Python API"
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.8"
dependencies = [
'requests',
'aiohttp',
'aiofiles',
'asyncio',
'requests',
'urllib3',
'async-timeout',
'certifi',
'charset-normalizer',
'frozenlist'
]
classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Processing",
"Topic :: Scientific/Engineering :: Visualization",
]

install_requires = [
'requests',
'aiohttp',
'aiofiles',
'asyncio',
'requests',
'urllib3',
'async-timeout',
'certifi',
'charset-normalizer',
'frozenlist'
]

[project.urls]
"Homepage" = "https://github.com/wwakabobik/leonardo_api"
"Bug Tracker" = "https://github.com/wwakabobik/leonardo_api/issues"

[tool.black]
line-length = 120

[tool.flake8]
max-line-length = 120
extend-ignore = """
Q000,
WPS306,
I001,
I005,
WPS229,
D400,
WPS317,
S101,
WPS507,
DAR101,
DAR201,
WPS112,
F401,
WPS300,
WPS412,
DAR301,
D401,
D205,
WPS615,
I004,
WPS110,
WPS420,
C812,
W1203,
R0801,
WPS305,
WPS226,
DAR401,
WPS237
"""

[tool.pylint]
max-line-length = 120
11 changes: 0 additions & 11 deletions testrail_api_reporter/utils/reporter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def delete_file(filename, debug=True, logger=None):
if debug:
if logger:
logger.debug(f"Removed {filename}")
else:
print(f"Removed {filename}")


def zip_file(filename, suffix=None, debug=True, logger=None):
Expand All @@ -75,8 +73,6 @@ def zip_file(filename, suffix=None, debug=True, logger=None):
if debug:
if logger:
logger.debug(f"ZIPped {filename} to {zipped_file}")
else:
print(f"ZIPped {filename} to {zipped_file}")
return zipped_file


Expand All @@ -95,8 +91,6 @@ def check_captions_and_files(captions, files, debug, logger=None):
if debug:
if logger:
logger.debug("Captions are not a list, thus no legend will be displayed")
else:
print("Caption list is empty, no legend will be displayed")
return_value = None
elif len(captions) != len(files):
if debug:
Expand All @@ -106,11 +100,6 @@ def check_captions_and_files(captions, files, debug, logger=None):
len(captions),
len(files),
)
else:
print(
f"Caption and file lists are not the same length {len(captions)} != {len(files)} thus "
f"no legend will be displayed"
)
return_value = None
return return_value

Expand Down

0 comments on commit cfa0860

Please sign in to comment.