Skip to content

Commit

Permalink
Merge pull request #1 from unifyai/release
Browse files Browse the repository at this point in the history
Added workflows for publishing to pypi and testpypi
  • Loading branch information
hello-fri-end committed Apr 1, 2024
2 parents a6db421 + 145872b commit f0655fd
Show file tree
Hide file tree
Showing 9 changed files with 92 additions and 24 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Publish to PyPI
on:
release:
types: [published]

jobs:
pypi_release:
name: Builds Using Poetry and Publishes to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- name: Run unit tests
run: poetry run python -m unittest discover
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
- name: Publish package
run: poetry publish --build
23 changes: 23 additions & 0 deletions .github/workflows/testpypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish to Test PyPI
on:
push:
tags:
- '*.*.*'

jobs:
test_pypi_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install deps
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --with dev
- name: Run unit tests
run: poetry run python -m unittest discover
- run: poetry config repositories.testpypi https://test.pypi.org/legacy/
- run: poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_KEY }}
- name: Publish package
run: poetry publish --build -r testpypi
58 changes: 40 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mypy = "^1.1.1"
isort = "^5.11.4"
pre-commit = "^3.0.1"
wemake-python-styleguide = "^0.17.0"
black = "^22.12.0"
black = "^24.3.0"
autoflake = "^1.6.1"

[tool.poetry.group.dev.dependencies]
Expand Down
2 changes: 0 additions & 2 deletions unify/__init__.py

This file was deleted.

3 changes: 3 additions & 0 deletions unifyai/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Unify python module."""

from unifyai.clients import AsyncUnify, Unify # noqa: F403
2 changes: 1 addition & 1 deletion unify/clients.py → unifyai/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import AsyncGenerator, Dict, Generator, List, Optional, Union

import openai
from unify.exceptions import UnifyError, status_error_map
from unifyai.exceptions import UnifyError, status_error_map


def _validate_api_key(api_key: Optional[str]) -> str:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions unify/tests.py → unifyai/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from types import AsyncGeneratorType, GeneratorType
from unittest.mock import MagicMock, patch

from unify.clients import AsyncUnify, Unify
from unify.exceptions import AuthenticationError, InternalServerError
from unifyai.clients import AsyncUnify, Unify
from unifyai.exceptions import AuthenticationError, InternalServerError


class TestUnify(unittest.TestCase):
Expand Down

0 comments on commit f0655fd

Please sign in to comment.