From 77d5e8c7f7e36c6fe9144f562df4fbcec4403760 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 00:55:52 +0000 Subject: [PATCH 1/8] style: apply formatting and structural fixes --- .github/workflows/release.yml | 2 +- LICENSE | 2 +- generate_models.sh | 2 +- src/ucp_sdk/models/__init__.py | 1 - src/ucp_sdk/models/discovery/__init__.py | 1 - src/ucp_sdk/models/handlers/__init__.py | 1 - src/ucp_sdk/models/handlers/tokenization/__init__.py | 1 - src/ucp_sdk/models/schemas/__init__.py | 1 - src/ucp_sdk/models/schemas/shopping/__init__.py | 1 - src/ucp_sdk/models/schemas/shopping/types/__init__.py | 1 - src/ucp_sdk/models/services/__init__.py | 1 - src/ucp_sdk/models/services/shopping/__init__.py | 1 - 12 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 071eac3..85f4f10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest - environment: + environment: name: release url: https://pypi.org/p/ucp-sdk permissions: diff --git a/LICENSE b/LICENSE index 7a4a3ea..d645695 100644 --- a/LICENSE +++ b/LICENSE @@ -199,4 +199,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/generate_models.sh b/generate_models.sh index 7cebf5a..26afb35 100755 --- a/generate_models.sh +++ b/generate_models.sh @@ -2,7 +2,7 @@ # Generate Pydantic models from UCP JSON Schemas # Ensure we are in the script's directory -cd "$(dirname "$0")" +cd "$(dirname "$0")" || exit # Output directory OUTPUT_DIR="src/ucp_sdk/models" diff --git a/src/ucp_sdk/models/__init__.py b/src/ucp_sdk/models/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/__init__.py +++ b/src/ucp_sdk/models/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/discovery/__init__.py b/src/ucp_sdk/models/discovery/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/discovery/__init__.py +++ b/src/ucp_sdk/models/discovery/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/handlers/__init__.py b/src/ucp_sdk/models/handlers/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/handlers/__init__.py +++ b/src/ucp_sdk/models/handlers/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/handlers/tokenization/__init__.py b/src/ucp_sdk/models/handlers/tokenization/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/handlers/tokenization/__init__.py +++ b/src/ucp_sdk/models/handlers/tokenization/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/schemas/__init__.py b/src/ucp_sdk/models/schemas/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/schemas/__init__.py +++ b/src/ucp_sdk/models/schemas/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/schemas/shopping/__init__.py b/src/ucp_sdk/models/schemas/shopping/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/schemas/shopping/__init__.py +++ b/src/ucp_sdk/models/schemas/shopping/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/schemas/shopping/types/__init__.py b/src/ucp_sdk/models/schemas/shopping/types/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/schemas/shopping/types/__init__.py +++ b/src/ucp_sdk/models/schemas/shopping/types/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/services/__init__.py b/src/ucp_sdk/models/services/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/services/__init__.py +++ b/src/ucp_sdk/models/services/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - diff --git a/src/ucp_sdk/models/services/shopping/__init__.py b/src/ucp_sdk/models/services/shopping/__init__.py index 421dc21..1252d6b 100644 --- a/src/ucp_sdk/models/services/shopping/__init__.py +++ b/src/ucp_sdk/models/services/shopping/__init__.py @@ -15,4 +15,3 @@ # generated by datamodel-codegen # pylint: disable=all # pyformat: disable - From 0f002d2806f9c3b347c4d13bf70877ee9b6d69f3 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 00:55:23 +0000 Subject: [PATCH 2/8] chore: add pre-commit configuration and CI --- .github/workflows/linter.yml | 17 +++++++++++++++++ .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/linter.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..317d0c5 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,17 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ef17c89 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' + +repos: +- 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 + args: [--unsafe] + - id: check-json + - id: check-added-large-files + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.13 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + files: \.(md|yaml|yml|json)$ +- repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.10.0 + hooks: + - id: shellcheck +- repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell From 4830ab9ede4ddcfb0753164a7ce4ccc0fe7c9a4b Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 02:14:50 +0000 Subject: [PATCH 3/8] style: apply pre-commit fixes --- .pre-commit-config.yaml | 34 +++++++++---------- ...85e70b53b965796398fcb6383a49f1dd8b6b5.json | 1 + 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef17c89..5ab3614 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,33 +1,33 @@ exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - 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: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml args: [--unsafe] - - id: check-json - - id: check-added-large-files - - id: check-shebang-scripts-are-executable - - id: check-executables-have-shebangs -- repo: https://github.com/astral-sh/ruff-pre-commit + - id: check-json + - id: check-added-large-files + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.13 hooks: - - id: ruff + - id: ruff args: [--fix, --exit-non-zero-on-fix] - - id: ruff-format -- repo: https://github.com/pre-commit/mirrors-prettier + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 hooks: - - id: prettier + - id: prettier files: \.(md|yaml|yml|json)$ -- repo: https://github.com/koalaman/shellcheck-precommit + - repo: https://github.com/koalaman/shellcheck-precommit rev: v0.10.0 hooks: - - id: shellcheck -- repo: https://github.com/codespell-project/codespell + - id: shellcheck + - repo: https://github.com/codespell-project/codespell rev: v2.4.1 hooks: - - id: codespell + - id: codespell diff --git a/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json b/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json new file mode 100644 index 0000000..d4104f6 --- /dev/null +++ b/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json @@ -0,0 +1 @@ +{"1d7b620d4732f62f2827a8097c96a5f75348f423":{"files":{".pre-commit-config.yaml":["nGuAkhWYmLYWMmsK6NelQjbgxJ4=",true],".github/workflows/release.yml":["F/pdf27ZckFDngaoleKvRxk/WdE=",true],"SECURITY.md":["J52i8VInV3D4WipivUwPs2q1B+0=",true],"README.md":["k3XrB4jR3leLbMI4PzEx/bvP47M=",true]},"modified":1770776088782}} \ No newline at end of file From 49118c1b38b58b0cc497e16ab0a634f375311d2f Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 00:55:23 +0000 Subject: [PATCH 4/8] chore: add pre-commit configuration and CI --- .github/workflows/linter.yml | 17 +++++++++++++++++ .pre-commit-config.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/linter.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..317d0c5 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,17 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.x' + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..9fdc00f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,33 @@ +exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' + +repos: +- 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 + args: [--unsafe] + - id: check-json + - id: check-added-large-files + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.13 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix, --ignore, "D,E501"] + - id: ruff-format +- repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + files: \.(md|yaml|yml|json)$ +- repo: https://github.com/koalaman/shellcheck-precommit + rev: v0.10.0 + hooks: + - id: shellcheck +- repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell From 1b1cdec0a61c3b689fd479f71f46cd9f175fbda7 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 02:39:24 +0000 Subject: [PATCH 5/8] chore: remove pre-commit config from style branch --- .github/workflows/linter.yml | 17 ---------- .pre-commit-config.yaml | 66 ------------------------------------ 2 files changed, 83 deletions(-) delete mode 100644 .github/workflows/linter.yml delete mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 317d0c5..0000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Lint - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 7a5f5ab..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,66 +0,0 @@ -exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' - -repos: -<<<<<<< HEAD - - 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 - args: [--unsafe] - - id: check-json - - id: check-added-large-files - - id: check-shebang-scripts-are-executable - - id: check-executables-have-shebangs - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 - hooks: - - id: ruff - args: [--fix, --exit-non-zero-on-fix] - - id: ruff-format - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - files: \.(md|yaml|yml|json)$ - - repo: https://github.com/koalaman/shellcheck-precommit - rev: v0.10.0 - hooks: - - id: shellcheck - - repo: https://github.com/codespell-project/codespell - rev: v2.4.1 - hooks: - - id: codespell -======= -- 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 - args: [--unsafe] - - id: check-json - - id: check-added-large-files - - id: check-shebang-scripts-are-executable - - id: check-executables-have-shebangs -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.13 - hooks: - - id: ruff - args: [--fix, --exit-non-zero-on-fix, --ignore, "D,E501"] - - id: ruff-format -- repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 - hooks: - - id: prettier - files: \.(md|yaml|yml|json)$ -- repo: https://github.com/koalaman/shellcheck-precommit - rev: v0.10.0 - hooks: - - id: shellcheck -- repo: https://github.com/codespell-project/codespell - rev: v2.4.1 - hooks: - - id: codespell ->>>>>>> feat/add-pre-commit From 5a9b9158be64cd73fe12645d7b6fbc070353d1ac Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 02:40:50 +0000 Subject: [PATCH 6/8] chore: remove all config and CI files from style branch --- .github/workflows/release.yml | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 85f4f10..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [published] -permissions: - contents: read - -jobs: - pypi-publish: - name: Upload release to PyPI - runs-on: ubuntu-latest - environment: - name: release - url: https://pypi.org/p/ucp-sdk - permissions: - id-token: write - contents: read - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # Installs uv (and manages Python automatically) - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - enable-cache: true - - # 'uv build' automatically creates the sdist and wheel inz 'dist/' - - name: Build package - run: uv build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 From 38d784f3c62f2cc92fa9085387be376ff137685d Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 02:47:30 +0000 Subject: [PATCH 7/8] chore: remove accidental node_modules tracking --- .../19c85e70b53b965796398fcb6383a49f1dd8b6b5.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json diff --git a/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json b/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json deleted file mode 100644 index d4104f6..0000000 --- a/node_modules/.cache/prettier/.prettier-caches/19c85e70b53b965796398fcb6383a49f1dd8b6b5.json +++ /dev/null @@ -1 +0,0 @@ -{"1d7b620d4732f62f2827a8097c96a5f75348f423":{"files":{".pre-commit-config.yaml":["nGuAkhWYmLYWMmsK6NelQjbgxJ4=",true],".github/workflows/release.yml":["F/pdf27ZckFDngaoleKvRxk/WdE=",true],"SECURITY.md":["J52i8VInV3D4WipivUwPs2q1B+0=",true],"README.md":["k3XrB4jR3leLbMI4PzEx/bvP47M=",true]},"modified":1770776088782}} \ No newline at end of file From cd41fa9ce4d832fc0cbce40c704801362c01a4c3 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 02:50:11 +0000 Subject: [PATCH 8/8] chore: restore existing CI workflows (release, etc) --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..071eac3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Publish to PyPI + +on: + release: + types: [published] +permissions: + contents: read + +jobs: + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/ucp-sdk + permissions: + id-token: write + contents: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # Installs uv (and manages Python automatically) + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + # 'uv build' automatically creates the sdist and wheel inz 'dist/' + - name: Build package + run: uv build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1