Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch pre-commit
- name: Run pre-commit
run: pre-commit run --all-files

ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install and run Ruff
uses: astral-sh/ruff-action@v3
with:
src: "./ibutsu_client"
args: "check --output-format=github"
- name: Run Ruff formatter
uses: astral-sh/ruff-action@v3
with:
src: "./ibutsu_client"
args: "format --check"
55 changes: 31 additions & 24 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package
name: publish to pypi

on:
release:
types: [created]
push:
tags:
- '*'

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v4
with:
# Fetch full history for proper version detection
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: pip install hatch
- name: Build artifacts
run: hatch build
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
with:
password: ${{ secrets.PYPI_TOKEN }}
print-hash: true
skip-existing: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 23 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
name: Ibutsu Client Unit Tests
name: ibutsu-client-python tests

on:
push:
branches:
- master
- main
pull_request:
types: ["opened", "synchronize", "reopened"]
create:

jobs:
tests:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with Python ${{ matrix.python-version }}
run: |
pip install -U -r requirements.txt
pip install -U -r test-requirements.txt
- name: Run tests
run: pytest --cov=ibutsu_client
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Install project with test dependencies
run: hatch env create
- name: Test with pytest and coverage
run: hatch run test:pytest test/ --cov=ibutsu_client --cov-report=term-missing --cov-report=xml --cov-report=html --cov-branch
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
24 changes: 0 additions & 24 deletions .gitlab-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.1
6.0.1
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
exclude: "docs"
repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements

- repo: https://github.com/asottile/pyupgrade
rev: v3.20.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.1
hooks:
- id: mypy
language_version: python3
exclude: ^ibutsu_client/
additional_dependencies:
- python-dateutil
- urllib3
- types-python-dateutil

ci:
skip: ["ruff-check", "ruff-format"]
autofix_prs: true
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- Use `hatch` for interacting with the project's building and environment configuration
- Use `pre-commit run` to include all lint checks and auto fixes
- Automatically work to resolve failures in the pre-commit output
- Do not include excessive emoji in readme, contributing, and other documentation files
- Use pytest parametrization over subtests

## Testing instructions
- Find the CI plan in the .github/workflows folder.
- From the package root you can just call `hatch test` or `pytest -x`. The commit should pass all tests before proceeding
- Add or update tests for the code you change, even if nobody asked.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ Class | Method | HTTP request | Description
*HealthApi* | [**get_health_info**](docs/HealthApi.md#get_health_info) | **GET** /health/info | Get information about the server
*ImportApi* | [**add_import**](docs/ImportApi.md#add_import) | **POST** /import | Import a file into Ibutsu. This can be either a JUnit XML file, or an Ibutsu archive
*ImportApi* | [**get_import**](docs/ImportApi.md#get_import) | **GET** /import/{id} | Get the status of an import
*LoginApi* | [**activate**](docs/LoginApi.md#activate) | **GET** /login/activate/{activation_code} |
*LoginApi* | [**auth**](docs/LoginApi.md#auth) | **GET** /login/auth/{provider} |
*LoginApi* | [**config**](docs/LoginApi.md#config) | **GET** /login/config/{provider} |
*LoginApi* | [**login**](docs/LoginApi.md#login) | **POST** /login |
*LoginApi* | [**recover**](docs/LoginApi.md#recover) | **POST** /login/recover |
*LoginApi* | [**register**](docs/LoginApi.md#register) | **POST** /login/register |
*LoginApi* | [**reset_password**](docs/LoginApi.md#reset_password) | **POST** /login/reset-password |
*LoginApi* | [**support**](docs/LoginApi.md#support) | **GET** /login/support |
*LoginApi* | [**activate**](docs/LoginApi.md#activate) | **GET** /login/activate/{activation_code} |
*LoginApi* | [**auth**](docs/LoginApi.md#auth) | **GET** /login/auth/{provider} |
*LoginApi* | [**config**](docs/LoginApi.md#config) | **GET** /login/config/{provider} |
*LoginApi* | [**login**](docs/LoginApi.md#login) | **POST** /login |
*LoginApi* | [**recover**](docs/LoginApi.md#recover) | **POST** /login/recover |
*LoginApi* | [**register**](docs/LoginApi.md#register) | **POST** /login/register |
*LoginApi* | [**reset_password**](docs/LoginApi.md#reset_password) | **POST** /login/reset-password |
*LoginApi* | [**support**](docs/LoginApi.md#support) | **GET** /login/support |
*ProjectApi* | [**add_project**](docs/ProjectApi.md#add_project) | **POST** /project | Create a project
*ProjectApi* | [**get_project**](docs/ProjectApi.md#get_project) | **GET** /project/{id} | Get a single project by ID
*ProjectApi* | [**get_project_list**](docs/ProjectApi.md#get_project_list) | **GET** /project | Get a list of projects
Expand Down Expand Up @@ -243,4 +243,3 @@ import ibutsu_client
from ibutsu_client.apis import *
from ibutsu_client.models import *
```

34 changes: 22 additions & 12 deletions ibutsu_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
# flake8: noqa

"""
Ibutsu API

A system to store and query test results # noqa: E501
A system to store and query test results

The version of the OpenAPI document: 2.3.0
Generated by: https://openapi-generator.tech
The version of the OpenAPI document: 2.3.0
Generated by: https://openapi-generator.tech
"""


__version__ = "2.3.0"

__all__ = [
"ApiAttributeError",
"ApiClient",
"ApiException",
"ApiKeyError",
"ApiTypeError",
"ApiValueError",
"Configuration",
"OpenApiException",
]

# import ApiClient
from ibutsu_client.api_client import ApiClient

# import Configuration
from ibutsu_client.configuration import Configuration

# import exceptions
from ibutsu_client.exceptions import OpenApiException
from ibutsu_client.exceptions import ApiAttributeError
from ibutsu_client.exceptions import ApiTypeError
from ibutsu_client.exceptions import ApiValueError
from ibutsu_client.exceptions import ApiKeyError
from ibutsu_client.exceptions import ApiException
from ibutsu_client.exceptions import (
ApiAttributeError,
ApiException,
ApiKeyError,
ApiTypeError,
ApiValueError,
OpenApiException,
)
Loading
Loading