-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5efcc7b
commit cfa0860
Showing
7 changed files
with
280 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Linters | ||
name: Linters-pR | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters