-
Notifications
You must be signed in to change notification settings - Fork 2
[Feature] Adding support for oci-genai-auth-python. #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
df566eb
[Feature] Adding support for oci-genai-auth-python.
shenoyvvarun e743ee9
Addressing review comments and bug.
shenoyvvarun 13f62cf
Adding agenthub examples, removing anthropic and google support.
shenoyvvarun a2468ab
Addressing Jing's feedback on the PR.
shenoyvvarun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,46 @@ | ||
| name: Publish Python Package | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release-build: | ||
| runs-on: ubuntu-latest | ||
| # PyPI use trusted publisher | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python 3 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install uv | ||
| uv venv | ||
| make dev | ||
| - name: Build | ||
| run: | | ||
| make build | ||
| - name: Validate | ||
| run: | | ||
| WHEEL=$(ls dist/*.whl | head -n 1) | ||
| python -m pip install "${WHEEL}[openai,google,anthropic]" | ||
| python -c "from oci_genai_auth.openai import OciOpenAI; from oci_genai_auth.google import OciGoogleGenAI; from oci_genai_auth.anthropic import OciAnthropic; import oci_genai_auth;" | ||
|
shenoyvvarun marked this conversation as resolved.
Outdated
|
||
| # - name: Publish to Test PyPI | ||
| # run: | | ||
| # python -m pip install twine | ||
| # twine check dist/* | ||
| # twine upload --verbose -r testpypi dist/* | ||
| - name: Publish to PyPI | ||
| run: | | ||
| python -m pip install twine | ||
| twine check dist/* | ||
| twine upload --verbose dist/* | ||
This file contains hidden or 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,39 @@ | ||
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
|
||
| name: Unit test, format and lint check | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v3 | ||
|
shenoyvvarun marked this conversation as resolved.
Outdated
|
||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install uv | ||
| uv venv | ||
| make dev | ||
| - name: Format and Lint | ||
| run: | | ||
| make check | ||
| - name: Test with pytest | ||
| run: | | ||
| make test | ||
| - name: Build | ||
| run: | | ||
| make build | ||
This file contains hidden or 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,87 @@ | ||
| # Mac | ||
| .DS_Store | ||
|
|
||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[codz] | ||
| *$py.class | ||
|
|
||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py.cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
| cover/ | ||
|
|
||
| # Environments | ||
| .env | ||
| .envrc | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
|
|
||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # pytype static type analyzer | ||
| .pytype/ | ||
|
|
||
| # Cython debug symbols | ||
| cython_debug/ | ||
|
|
||
| # PyCharm | ||
| .idea/ | ||
| *.iml | ||
|
|
||
| # Visual Studio Code | ||
| .vscode/ | ||
|
|
||
| # Ruff stuff: | ||
| .ruff_cache/ | ||
|
|
||
| # PyPI configuration file | ||
| .pypirc | ||
|
|
||
| # Demo folder | ||
| .demo |
This file contains hidden or 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 hidden or 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 hidden or 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,69 @@ | ||
| # Define the directory containing the source code | ||
| SRC_DIR := ./src | ||
| TEST_DIR := ./tests | ||
| EXAMPLE_DIR := ./examples | ||
|
|
||
| # Optional install extras via `make install <extra>` or `make build <extra>` | ||
| ifneq (,$(filter install build,$(MAKECMDGOALS))) | ||
| EXTRAS := $(filter-out install build,$(MAKECMDGOALS)) | ||
| comma := , | ||
| empty := | ||
| space := $(empty) $(empty) | ||
| EXTRA_LIST := $(subst $(space),$(comma),$(strip $(EXTRAS))) | ||
| endif | ||
|
|
||
| .PHONY: all | ||
| all: test lint build | ||
|
|
||
| ##@ General | ||
|
|
||
| .PHONY: help | ||
| help: ## Display this help. | ||
| @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-24s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) | ||
|
|
||
| ##@ Development | ||
|
|
||
| .PHONY: install | ||
| install: ## Install project dependencies. Example: `make install openai` | ||
| ifneq ($(strip $(EXTRA_LIST)),) | ||
| uv pip install --editable ".[${EXTRA_LIST}]" | ||
| else | ||
| uv pip install --editable . | ||
| endif | ||
|
|
||
| ifneq ($(strip $(EXTRAS)),) | ||
| .PHONY: $(EXTRAS) | ||
| $(EXTRAS): | ||
| @: | ||
| endif | ||
|
|
||
| .PHONY: dev | ||
| dev: ## Install development dependencies. | ||
| uv pip install ".[dev]" | ||
|
|
||
| .PHONY: test | ||
| test: ## Run tests. | ||
| uv run --no-project --no-reinstall pytest $(TEST_DIR) --cov --cov-config=.coveragerc -vv -s | ||
|
|
||
| .PHONY: clean | ||
| clean: ## Remove build artifacts. | ||
| rm -rf build dist *.egg-info .pytest_cache .coverage | ||
|
|
||
| .PHONY: format | ||
| format: ## Format code using ruff. | ||
| uv run --no-project --no-reinstall isort $(SRC_DIR) $(TEST_DIR) $(EXAMPLE_DIR) | ||
| uv run --no-project --no-reinstall ruff format $(SRC_DIR) $(TEST_DIR) $(EXAMPLE_DIR); uv run --no-project --no-reinstall ruff check --fix $(SRC_DIR) $(TEST_DIR) $(EXAMPLE_DIR) | ||
|
|
||
| .PHONY: lint | ||
| lint: ## Run linters using ruff. | ||
| uv run --no-project --no-reinstall ruff format --diff $(SRC_DIR) $(TEST_DIR) | ||
| uv run --no-project --no-reinstall mypy $(SRC_DIR) $(TEST_DIR) | ||
|
|
||
| .PHONY: check | ||
| check: format lint ## Run format and lint. | ||
|
|
||
| ##@ Build | ||
|
|
||
| .PHONY: build | ||
| build: ## Build the application. | ||
| uv build |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.