-
Notifications
You must be signed in to change notification settings - Fork 0
Add basic infrastructure #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 all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,23 @@ | ||
| version: 2 | ||
| updates: | ||
|
|
||
| # Docker | ||
| - package-ecosystem: docker | ||
| directory: "/" | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 | ||
|
|
||
| # Python | ||
| - package-ecosystem: "pip" # See documentation for possible values | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 | ||
|
|
||
| # GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: ".github/workflows" | ||
| schedule: | ||
| interval: "monthly" | ||
| open-pull-requests-limit: 25 |
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,37 @@ | ||
| name: "CodeQL" | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
| push: | ||
| # run workflow when merging to main or develop | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| jobs: | ||
| CodeQL-Build: | ||
| # CodeQL runs on ubuntu-latest, windows-latest, and macos-latest | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| # required for all workflows | ||
| security-events: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| # Initializes the CodeQL tools for scanning. | ||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| # Override language selection by uncommenting this and choosing your languages | ||
| with: | ||
| languages: python | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 |
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,52 @@ | ||
| name: KBase SDK Base Client Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
| - ready_for_review | ||
| push: | ||
| # run workflow when merging to main or develop | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| jobs: | ||
|
|
||
| base_client_tests: | ||
| runs-on: ubuntu-22.04 | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - python-version: "3.12" | ||
|
|
||
| steps: | ||
|
|
||
| - name: Repo checkout | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| export UV_PROJECT_ENVIRONMENT="${pythonLocation}" | ||
| uv sync --locked | ||
|
|
||
| - name: Run tests | ||
| shell: bash | ||
| run: PYTHONPATH=src pytest --cov=src --cov-report=xml test | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the |
||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| fail_ci_if_error: true | ||
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,28 @@ | ||
| ########################################## | ||
| # READ BEFORE ALTERING THIS FILE | ||
| # | ||
| # Only files specific to this repo or that will be generated as part of using this repo should | ||
| # be ignored here. Files that are specific to particular development environments or users | ||
| # should be ignored in the global gitignore to ignore for all repos, or in .git/info/exclude | ||
| # to ignore for just this repo. | ||
| # | ||
| # Examples of appropriate files for each location: | ||
| # This file: | ||
| # python pyc files | ||
| # python cache files | ||
| # test configuration and output, including coverage data | ||
| # | ||
| # Global gitignore | ||
| # Eclipse .settings, .project, and .pyproject files | ||
| # Mac .DS_store files | ||
| # VSCode .vscode directory | ||
| # | ||
| # .git/info/exclude | ||
| # Temporary code / notes while exploring new repo features | ||
| # Personal data used for manual testing | ||
| # | ||
| ########################################## | ||
|
|
||
| /.pytest_cache/ | ||
| __pycache__ | ||
| /.venv/ |
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 @@ | ||
| 3.12 |
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,41 @@ | ||
| # KBase SDK base client | ||
|
|
||
| This repo contains the base client code that all other SDK clients depend on. It's generally | ||
| expected that users don't directly interact with it, but it can be useful for cases where | ||
| a compiled client isn't available. | ||
|
|
||
| ## Installation | ||
|
|
||
| ``` | ||
| pip install kbase-sdk-baseclient | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| The client is not intended for general use, and power users should be easily able to inspect the | ||
| code and tests to determine proper useage. | ||
|
|
||
| ## Development | ||
|
|
||
| ### Adding and releasing code | ||
|
|
||
| * Adding code | ||
| * All code additions and updates must be made as pull requests directed at the develop branch. | ||
| * All tests must pass and all new code must be covered by tests. | ||
| * All new code must be documented appropriately | ||
| * Pydocs | ||
| * General documentation if appropriate | ||
| * Release notes | ||
| * Releases | ||
| * The main branch is the stable branch. Releases are made from the develop branch to the main | ||
| branch. | ||
| * Update the version in `sdk_baseclient.py` and `pyproject.toml`. | ||
| * Tag the version in git and github. | ||
| * Create a github release. | ||
|
|
||
| ### Testing | ||
|
|
||
| ``` | ||
| uv sync --dev # only required on first run or when the uv.lock file changes | ||
| PYTHONPATH=src uv run pytest test | ||
| ``` |
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,3 @@ | ||
| ## 0.1.0 | ||
|
|
||
| * Initial release |
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,38 @@ | ||
| [project] | ||
| name = "kbase-sdk-baseclient" | ||
| version = "0.1.0" | ||
| description = "Base client for the KBase SDK" | ||
| readme = "README.md" | ||
| authors = [{ name = "KBase Development Team" }] | ||
| requires-python = ">=3.12" | ||
| license = { text = "MIT" } | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Operating System :: OS Independent", | ||
| ] | ||
| dependencies = [ | ||
| "requests>=2.32.5", | ||
| ] | ||
|
|
||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["src/kbase"] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "ipython==9.6.0", | ||
| "pytest==8.4.2", | ||
| "pytest-cov==7.0.0", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/kbase/kb_sdk_baseclient" | ||
| Repository = "https://github.com/kbase/kb_sdk_baseclient" | ||
| Issues = "https://github.com/kbase/kb_sdk_baseclient/issues" | ||
|
|
||
| [tool.uv] | ||
| package = true |
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,10 @@ | ||
| """ | ||
| The base client for all SDK clients. | ||
| """ | ||
|
|
||
|
|
||
| __version__ = "0.1.0" | ||
|
|
||
|
|
||
| class SDKBaseClient: | ||
| """ The base client. """ |
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,8 @@ | ||
| from kbase import sdk_baseclient | ||
|
|
||
|
|
||
| _VERSION = "0.1.0" | ||
|
|
||
|
|
||
| def test_version(): | ||
| assert sdk_baseclient.__version__ == _VERSION |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this set and why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's set by the GHA machinery. It tells uv to install everything to the system vs. a venv.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use it in dockerfiles frequently