Skip to content

Commit

Permalink
Merge pull request #89 from wwakabobik/update_readme_and_ga
Browse files Browse the repository at this point in the history
Update README.md and GitHub actions
  • Loading branch information
wwakabobik authored Nov 28, 2024
2 parents 271cf7e + 6540baf commit 467a548
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 28 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -45,11 +45,10 @@ jobs:
id: mypy
continue-on-error: true
run: |
mkdir -p .mypy_cache
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
mkdir -p .mypy_cache
PYTHONPATH=. mypy $changed_files --install-types --non-interactive --ignore-missing-imports --exclude __main__.py
else
echo "No files changed, passing by"
exit 0
Expand All @@ -59,12 +58,11 @@ jobs:
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
PYTHONPATH=. flake8 $changed_files
else
echo "No files changed, passing by"
exit 0
echo "No files changed, passing by"
exit 0
fi
- name: Check code with Black
id: black
Expand All @@ -80,7 +78,14 @@ jobs:
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"
failed_steps=()
if [[ "${{ steps.pylint.outcome }}" == "failure" ]]; then failed_steps+=("Pylint"); fi
if [[ "${{ steps.black.outcome }}" == "failure" ]]; then failed_steps+=("Black"); fi
if [[ "${{ steps.mypy.outcome }}" == "failure" ]]; then failed_steps+=("Mypy"); fi
if [ ${#failed_steps[@]} -ne 0 ]; then
echo "Failed: ${failed_steps[*]}"
exit 1
fi
else
echo "All passed, well done, bro!"
fi
52 changes: 44 additions & 8 deletions .github/workflows/master_linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -29,24 +29,60 @@ jobs:
- name: Analysing the code with pylint
id: pylint
continue-on-error: true
run: PYTHONPATH=. pylint $(find . -name '*.py')
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: |
mkdir -p .mypy_cache
PYTHONPATH=. mypy $(find . -name '*.py') --install-types --non-interactive --ignore-missing-imports --exclude __main__.py
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
if [ -n "$changed_files" ]; then
mkdir -p .mypy_cache
PYTHONPATH=. mypy $changed_files --install-types --non-interactive --ignore-missing-imports --exclude __main__.py
else
echo "No files changed, passing by"
exit 0
fi
- name: Check code with flake8
id: flake8
continue-on-error: true
run: PYTHONPATH=. flake8 $(find . -name '*.py')
run: |
changed_files=$(git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) HEAD | grep '\.py$') || true
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: PYTHONPATH=. black --diff --check --color $(find . -name '*.py')
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"
failed_steps=()
if [[ "${{ steps.pylint.outcome }}" == "failure" ]]; then failed_steps+=("Pylint"); fi
if [[ "${{ steps.black.outcome }}" == "failure" ]]; then failed_steps+=("Black"); fi
if [[ "${{ steps.mypy.outcome }}" == "failure" ]]; then failed_steps+=("Mypy"); fi
if [ ${#failed_steps[@]} -ne 0 ]; then
echo "Failed: ${failed_steps[*]}"
exit 1
else
echo "All passed, well done, bro!"
fi
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Updated
- Fixed history storage for assistant (i.g. non-stream)

## [0.0.9] - 2024-02-09

### Updated
- README.md, LICENSE and GitHub actions (to check only changed files)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Ilya Vereshchagin
Copyright (c) 2024 Ilya Vereshchagin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

This package provides a Python API for [OpenAI](https://openai.com/), based on the official [API documentation](https://openai.com/blog/openai-api) and wraps-up original [OpenAI API](https://pypi.org/project/openai/).

[![PyPI version](https://badge.fury.io/py/openai-python-api.svg)](https://badge.fury.io/py/openai-python-api) [![Linters](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml)
[![PyPI version](https://badge.fury.io/py/openai-python-api.svg)](https://badge.fury.io/py/openai-python-api)
[![Linters](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml)
![PyPI - License](https://img.shields.io/pypi/l/openai-python-api)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/openai-python-api)
[![Downloads](https://static.pepy.tech/badge/openai-python-api)](https://pepy.tech/project/openai-python-api)
[![Downloads](https://static.pepy.tech/badge/openai-python-api/month)](https://pepy.tech/project/openai-python-api)

## Installation

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "openai_python_api"
version = "0.0.8"
version = "0.0.9"
keywords = ["openai", "chatgpt", "dalle", "dalle2", "ai", "artificial intelligence", "api", "gpt"]
authors = [
{ name="Iliya Vereshchagin", email="i.vereshchagin@gmail.com" },
Expand Down Expand Up @@ -34,6 +34,8 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
Expand Down
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = openai_python_api
version = attr: openai_python_api.0.0.8
version = attr: openai_python_api.0.0.9
author = Iliya Vereshchagin
author_email = i.vereshchagin@gmail.com
maintainer = Iliya Vereshchagin
Expand All @@ -15,8 +15,10 @@ python_requires = >=3.9
classifiers =
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.9,
Programming Language :: Python :: 3.10,
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Operating System :: OS Independent
Intended Audience :: Developers
Intended Audience :: Information Technology
Expand Down
2 changes: 1 addition & 1 deletion src/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Ilya Vereshchagin
Copyright (c) 2024 Ilya Vereshchagin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 6 additions & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

This package provides a Python API for [OpenAI](https://openai.com/), based on the official [API documentation](https://openai.com/blog/openai-api) and wraps-up original [OpenAI API](https://pypi.org/project/openai/).

[![PyPI version](https://badge.fury.io/py/openai-python-api.svg)](https://badge.fury.io/py/openai-python-api) [![Linters](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml)
[![PyPI version](https://badge.fury.io/py/openai-python-api.svg)](https://badge.fury.io/py/openai-python-api)
[![Linters](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml/badge.svg?branch=master)](https://github.com/wwakabobik/openai_api/actions/workflows/master_linters.yml)
![PyPI - License](https://img.shields.io/pypi/l/openai-python-api)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/openai-python-api)
[![Downloads](https://static.pepy.tech/badge/openai-python-api)](https://pepy.tech/project/openai-python-api)
[![Downloads](https://static.pepy.tech/badge/openai-python-api/month)](https://pepy.tech/project/openai-python-api)

## Installation

Expand Down
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiofiles==24.1.0
aiohttp==3.11.7
aiohttp==3.11.8
asyncio==3.4.3
openai==1.55.0
openai==1.55.2
pillow==11.0.0

0 comments on commit 467a548

Please sign in to comment.