nexusx 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nexusx-2.0.0/.github/workflows/ci.yml +37 -0
- nexusx-2.0.0/.github/workflows/gh-pages.yml +34 -0
- nexusx-2.0.0/.github/workflows/publish.yml +41 -0
- nexusx-2.0.0/.gitignore +51 -0
- nexusx-2.0.0/.python-version +1 -0
- nexusx-2.0.0/.skills/README.md +127 -0
- nexusx-2.0.0/.skills/release.md +73 -0
- nexusx-2.0.0/.skills/release.py +181 -0
- nexusx-2.0.0/.skills/release.sh +112 -0
- nexusx-2.0.0/CHANGELOG.md +534 -0
- nexusx-2.0.0/CLAUDE.md +187 -0
- nexusx-2.0.0/LICENSE +21 -0
- nexusx-2.0.0/PKG-INFO +686 -0
- nexusx-2.0.0/README.md +644 -0
- nexusx-2.0.0/demo/__init__.py +1 -0
- nexusx-2.0.0/demo/auth/__init__.py +1 -0
- nexusx-2.0.0/demo/auth/app.py +143 -0
- nexusx-2.0.0/demo/auth/auth.py +89 -0
- nexusx-2.0.0/demo/auth/mcp_server.py +76 -0
- nexusx-2.0.0/demo/auth/test_auth.sh +245 -0
- nexusx-2.0.0/demo/blog/README.md +117 -0
- nexusx-2.0.0/demo/blog/__init__.py +0 -0
- nexusx-2.0.0/demo/blog/app.py +108 -0
- nexusx-2.0.0/demo/blog/app_paginated.py +152 -0
- nexusx-2.0.0/demo/blog/database.py +155 -0
- nexusx-2.0.0/demo/blog/er_diagram_demo.py +42 -0
- nexusx-2.0.0/demo/blog/mcp_server.py +35 -0
- nexusx-2.0.0/demo/blog/mcp_server_simple.py +125 -0
- nexusx-2.0.0/demo/blog/models.py +360 -0
- nexusx-2.0.0/demo/core_api/__init__.py +0 -0
- nexusx-2.0.0/demo/core_api/app.py +166 -0
- nexusx-2.0.0/demo/core_api/database.py +158 -0
- nexusx-2.0.0/demo/core_api/dtos.py +176 -0
- nexusx-2.0.0/demo/core_api/models.py +196 -0
- nexusx-2.0.0/demo/multi_app/__init__.py +6 -0
- nexusx-2.0.0/demo/multi_app/database.py +142 -0
- nexusx-2.0.0/demo/multi_app/mcp_server.py +87 -0
- nexusx-2.0.0/demo/multi_app/models.py +280 -0
- nexusx-2.0.0/demo/use_case/__init__.py +0 -0
- nexusx-2.0.0/demo/use_case/fastapi.py +142 -0
- nexusx-2.0.0/demo/use_case/fastapi_auto.py +144 -0
- nexusx-2.0.0/demo/use_case/mcp_server.py +182 -0
- nexusx-2.0.0/demo/use_case/voyager_demo.py +120 -0
- nexusx-2.0.0/docs/advanced/mcp_service.md +84 -0
- nexusx-2.0.0/docs/advanced/mcp_service.zh.md +84 -0
- nexusx-2.0.0/docs/advanced/use_case_fastapi.md +89 -0
- nexusx-2.0.0/docs/advanced/use_case_fastapi.zh.md +89 -0
- nexusx-2.0.0/docs/advanced/use_case_service.md +88 -0
- nexusx-2.0.0/docs/advanced/use_case_service.zh.md +88 -0
- nexusx-2.0.0/docs/advanced/voyager.md +126 -0
- nexusx-2.0.0/docs/advanced/voyager.zh.md +126 -0
- nexusx-2.0.0/docs/api/api_core.md +124 -0
- nexusx-2.0.0/docs/api/api_core.zh.md +124 -0
- nexusx-2.0.0/docs/api/api_cross_layer.md +77 -0
- nexusx-2.0.0/docs/api/api_cross_layer.zh.md +77 -0
- nexusx-2.0.0/docs/api/api_graphql_handler.md +91 -0
- nexusx-2.0.0/docs/api/api_graphql_handler.zh.md +91 -0
- nexusx-2.0.0/docs/api/api_mcp.md +76 -0
- nexusx-2.0.0/docs/api/api_mcp.zh.md +76 -0
- nexusx-2.0.0/docs/api/api_relationship.md +78 -0
- nexusx-2.0.0/docs/api/api_relationship.zh.md +78 -0
- nexusx-2.0.0/docs/api/api_use_case.md +145 -0
- nexusx-2.0.0/docs/api/api_use_case.zh.md +145 -0
- nexusx-2.0.0/docs/guide/core_api.md +96 -0
- nexusx-2.0.0/docs/guide/core_api.zh.md +96 -0
- nexusx-2.0.0/docs/guide/core_api_advanced.md +137 -0
- nexusx-2.0.0/docs/guide/core_api_advanced.zh.md +137 -0
- nexusx-2.0.0/docs/guide/custom_relationship.md +92 -0
- nexusx-2.0.0/docs/guide/custom_relationship.zh.md +92 -0
- nexusx-2.0.0/docs/guide/er_diagram.md +105 -0
- nexusx-2.0.0/docs/guide/er_diagram.zh.md +105 -0
- nexusx-2.0.0/docs/guide/er_diagram_visual.md +119 -0
- nexusx-2.0.0/docs/guide/er_diagram_visual.zh.md +119 -0
- nexusx-2.0.0/docs/guide/graphql_auto_query.md +78 -0
- nexusx-2.0.0/docs/guide/graphql_auto_query.zh.md +78 -0
- nexusx-2.0.0/docs/guide/graphql_mode.md +118 -0
- nexusx-2.0.0/docs/guide/graphql_mode.zh.md +118 -0
- nexusx-2.0.0/docs/guide/graphql_pagination.md +102 -0
- nexusx-2.0.0/docs/guide/graphql_pagination.zh.md +102 -0
- nexusx-2.0.0/docs/guide/quick_start.md +103 -0
- nexusx-2.0.0/docs/guide/quick_start.zh.md +103 -0
- nexusx-2.0.0/docs/index.md +75 -0
- nexusx-2.0.0/docs/index.zh.md +75 -0
- nexusx-2.0.0/docs/reference/changelog.md +41 -0
- nexusx-2.0.0/docs/reference/changelog.zh.md +41 -0
- nexusx-2.0.0/docs/reference/migration.md +123 -0
- nexusx-2.0.0/docs/reference/migration.zh.md +105 -0
- nexusx-2.0.0/docs/stylesheets/extra.css +23 -0
- nexusx-2.0.0/docs/superpowers/plans/2026-03-12-simple-mcp-server.md +487 -0
- nexusx-2.0.0/docs/superpowers/specs/2026-03-12-simple-mcp-server-design.md +145 -0
- nexusx-2.0.0/docs/superpowers/specs/2026-04-29-audit.md +192 -0
- nexusx-2.0.0/how_it_works.md +501 -0
- nexusx-2.0.0/llms-full.txt +1229 -0
- nexusx-2.0.0/mkdocs.yml +135 -0
- nexusx-2.0.0/overrides/home.html +868 -0
- nexusx-2.0.0/pyproject.toml +84 -0
- nexusx-2.0.0/skill/SKILL.md +592 -0
- nexusx-2.0.0/skill/template/pyproject.toml +26 -0
- nexusx-2.0.0/skill/template/src/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/database.py +44 -0
- nexusx-2.0.0/skill/template/src/db.py +9 -0
- nexusx-2.0.0/skill/template/src/main.py +144 -0
- nexusx-2.0.0/skill/template/src/models.py +103 -0
- nexusx-2.0.0/skill/template/src/router/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/router/api.py +30 -0
- nexusx-2.0.0/skill/template/src/service/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/service/sprint/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/service/sprint/dtos.py +19 -0
- nexusx-2.0.0/skill/template/src/service/sprint/methods.py +28 -0
- nexusx-2.0.0/skill/template/src/service/sprint/service.py +40 -0
- nexusx-2.0.0/skill/template/src/service/sprint/spec.md +32 -0
- nexusx-2.0.0/skill/template/src/service/sprint/test.py +0 -0
- nexusx-2.0.0/skill/template/src/service/task/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/service/task/dtos.py +14 -0
- nexusx-2.0.0/skill/template/src/service/task/methods.py +31 -0
- nexusx-2.0.0/skill/template/src/service/task/service.py +43 -0
- nexusx-2.0.0/skill/template/src/service/task/spec.md +28 -0
- nexusx-2.0.0/skill/template/src/service/task/test.py +0 -0
- nexusx-2.0.0/skill/template/src/service/user/__init__.py +0 -0
- nexusx-2.0.0/skill/template/src/service/user/methods.py +22 -0
- nexusx-2.0.0/skill/template/src/service/user/spec.md +19 -0
- nexusx-2.0.0/skill/template/uv.lock +1594 -0
- nexusx-2.0.0/src/nexusx/__init__.py +117 -0
- nexusx-2.0.0/src/nexusx/context.py +212 -0
- nexusx-2.0.0/src/nexusx/decorator.py +102 -0
- nexusx-2.0.0/src/nexusx/discovery/__init__.py +5 -0
- nexusx-2.0.0/src/nexusx/discovery/entity_discovery.py +112 -0
- nexusx-2.0.0/src/nexusx/er_diagram.py +222 -0
- nexusx-2.0.0/src/nexusx/execution/__init__.py +6 -0
- nexusx-2.0.0/src/nexusx/execution/argument_builder.py +199 -0
- nexusx-2.0.0/src/nexusx/execution/field_tree_builder.py +37 -0
- nexusx-2.0.0/src/nexusx/execution/query_executor.py +486 -0
- nexusx-2.0.0/src/nexusx/graphiql.py +68 -0
- nexusx-2.0.0/src/nexusx/handler.py +183 -0
- nexusx-2.0.0/src/nexusx/introspection.py +805 -0
- nexusx-2.0.0/src/nexusx/loader/__init__.py +19 -0
- nexusx-2.0.0/src/nexusx/loader/factories.py +570 -0
- nexusx-2.0.0/src/nexusx/loader/pagination.py +107 -0
- nexusx-2.0.0/src/nexusx/loader/query_meta.py +162 -0
- nexusx-2.0.0/src/nexusx/loader/registry.py +513 -0
- nexusx-2.0.0/src/nexusx/mcp/__init__.py +56 -0
- nexusx-2.0.0/src/nexusx/mcp/builders/__init__.py +7 -0
- nexusx-2.0.0/src/nexusx/mcp/builders/schema_formatter.py +264 -0
- nexusx-2.0.0/src/nexusx/mcp/builders/type_tracer.py +163 -0
- nexusx-2.0.0/src/nexusx/mcp/managers/__init__.py +7 -0
- nexusx-2.0.0/src/nexusx/mcp/managers/app_resources.py +46 -0
- nexusx-2.0.0/src/nexusx/mcp/managers/multi_app_manager.py +129 -0
- nexusx-2.0.0/src/nexusx/mcp/managers/single_app_manager.py +82 -0
- nexusx-2.0.0/src/nexusx/mcp/server.py +213 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/__init__.py +15 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/get_operation_schema.py +202 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/graphql_mutation.py +87 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/graphql_query.py +88 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/list_operations.py +89 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/multi_app_tools.py +467 -0
- nexusx-2.0.0/src/nexusx/mcp/tools/simple_tools.py +190 -0
- nexusx-2.0.0/src/nexusx/mcp/types/__init__.py +15 -0
- nexusx-2.0.0/src/nexusx/mcp/types/app_config.py +29 -0
- nexusx-2.0.0/src/nexusx/mcp/types/errors.py +97 -0
- nexusx-2.0.0/src/nexusx/query_parser.py +150 -0
- nexusx-2.0.0/src/nexusx/relationship.py +98 -0
- nexusx-2.0.0/src/nexusx/resolver.py +735 -0
- nexusx-2.0.0/src/nexusx/response_builder.py +350 -0
- nexusx-2.0.0/src/nexusx/scanning/__init__.py +5 -0
- nexusx-2.0.0/src/nexusx/scanning/method_scanner.py +76 -0
- nexusx-2.0.0/src/nexusx/sdl_generator.py +706 -0
- nexusx-2.0.0/src/nexusx/standard_queries.py +237 -0
- nexusx-2.0.0/src/nexusx/subset.py +676 -0
- nexusx-2.0.0/src/nexusx/type_converter.py +163 -0
- nexusx-2.0.0/src/nexusx/use_case/__init__.py +19 -0
- nexusx-2.0.0/src/nexusx/use_case/business.py +129 -0
- nexusx-2.0.0/src/nexusx/use_case/context.py +30 -0
- nexusx-2.0.0/src/nexusx/use_case/introspector.py +566 -0
- nexusx-2.0.0/src/nexusx/use_case/manager.py +149 -0
- nexusx-2.0.0/src/nexusx/use_case/router.py +329 -0
- nexusx-2.0.0/src/nexusx/use_case/server.py +433 -0
- nexusx-2.0.0/src/nexusx/use_case/types.py +35 -0
- nexusx-2.0.0/src/nexusx/utils/__init__.py +5 -0
- nexusx-2.0.0/src/nexusx/utils/naming.py +57 -0
- nexusx-2.0.0/src/nexusx/utils/schema_helpers.py +131 -0
- nexusx-2.0.0/src/nexusx/utils/type_compat.py +112 -0
- nexusx-2.0.0/src/nexusx/utils/type_utils.py +72 -0
- nexusx-2.0.0/src/nexusx/voyager/__init__.py +8 -0
- nexusx-2.0.0/src/nexusx/voyager/create_voyager.py +189 -0
- nexusx-2.0.0/src/nexusx/voyager/er_diagram_dot.py +231 -0
- nexusx-2.0.0/src/nexusx/voyager/filter.py +275 -0
- nexusx-2.0.0/src/nexusx/voyager/module.py +98 -0
- nexusx-2.0.0/src/nexusx/voyager/render.py +581 -0
- nexusx-2.0.0/src/nexusx/voyager/render_style.py +112 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/cluster.j2 +10 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/cluster_container.j2 +9 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/digraph.j2 +25 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/er_diagram.j2 +29 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/link.j2 +1 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/route_node.j2 +5 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/schema_node.j2 +5 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/dot/tag_node.j2 +5 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/html/colored_text.j2 +1 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/html/pydantic_meta.j2 +1 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/html/schema_field_row.j2 +1 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/html/schema_header.j2 +1 -0
- nexusx-2.0.0/src/nexusx/voyager/templates/html/schema_table.j2 +4 -0
- nexusx-2.0.0/src/nexusx/voyager/type.py +107 -0
- nexusx-2.0.0/src/nexusx/voyager/type_helper.py +324 -0
- nexusx-2.0.0/src/nexusx/voyager/use_case_voyager.py +344 -0
- nexusx-2.0.0/src/nexusx/voyager/voyager_context.py +282 -0
- nexusx-2.0.0/src/nexusx/voyager/web/component/demo.js +17 -0
- nexusx-2.0.0/src/nexusx/voyager/web/component/loader-code-display.js +135 -0
- nexusx-2.0.0/src/nexusx/voyager/web/component/render-graph.js +86 -0
- nexusx-2.0.0/src/nexusx/voyager/web/component/route-code-display.js +123 -0
- nexusx-2.0.0/src/nexusx/voyager/web/component/schema-code-display.js +203 -0
- nexusx-2.0.0/src/nexusx/voyager/web/graph-ui.js +467 -0
- nexusx-2.0.0/src/nexusx/voyager/web/graphviz.svg.css +64 -0
- nexusx-2.0.0/src/nexusx/voyager/web/graphviz.svg.js +638 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/android-chrome-192x192.png +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/android-chrome-512x512.png +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/apple-touch-icon.png +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/favicon-16x16.png +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/favicon-32x32.png +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/favicon.ico +0 -0
- nexusx-2.0.0/src/nexusx/voyager/web/icon/site.webmanifest +16 -0
- nexusx-2.0.0/src/nexusx/voyager/web/index.html +708 -0
- nexusx-2.0.0/src/nexusx/voyager/web/magnifying-glass.js +447 -0
- nexusx-2.0.0/src/nexusx/voyager/web/manifest.webmanifest +5 -0
- nexusx-2.0.0/src/nexusx/voyager/web/quasar.min.css +1 -0
- nexusx-2.0.0/src/nexusx/voyager/web/quasar.min.js +127 -0
- nexusx-2.0.0/src/nexusx/voyager/web/store.js +624 -0
- nexusx-2.0.0/src/nexusx/voyager/web/sw.js +142 -0
- nexusx-2.0.0/src/nexusx/voyager/web/vue-main.js +397 -0
- nexusx-2.0.0/start_all.sh +169 -0
- nexusx-2.0.0/tests/__init__.py +0 -0
- nexusx-2.0.0/tests/conftest.py +243 -0
- nexusx-2.0.0/tests/mcp/__init__.py +1 -0
- nexusx-2.0.0/tests/mcp/test_multi_app_manager.py +342 -0
- nexusx-2.0.0/tests/mcp/test_multi_app_tools.py +402 -0
- nexusx-2.0.0/tests/mcp/test_simple_mcp.py +409 -0
- nexusx-2.0.0/tests/test_argument_types.py +183 -0
- nexusx-2.0.0/tests/test_autoload.py +388 -0
- nexusx-2.0.0/tests/test_context.py +304 -0
- nexusx-2.0.0/tests/test_decorator.py +112 -0
- nexusx-2.0.0/tests/test_demo_final.py +27 -0
- nexusx-2.0.0/tests/test_demo_standard_queries.py +75 -0
- nexusx-2.0.0/tests/test_er_diagram.py +122 -0
- nexusx-2.0.0/tests/test_field_tree_builder.py +76 -0
- nexusx-2.0.0/tests/test_fixes.py +446 -0
- nexusx-2.0.0/tests/test_handler.py +461 -0
- nexusx-2.0.0/tests/test_input_types.py +237 -0
- nexusx-2.0.0/tests/test_introspection.py +732 -0
- nexusx-2.0.0/tests/test_loader_factories.py +289 -0
- nexusx-2.0.0/tests/test_loader_registry.py +225 -0
- nexusx-2.0.0/tests/test_mcp.py +560 -0
- nexusx-2.0.0/tests/test_mcp_schema_enhanced.py +154 -0
- nexusx-2.0.0/tests/test_query_executor.py +508 -0
- nexusx-2.0.0/tests/test_query_meta.py +375 -0
- nexusx-2.0.0/tests/test_query_parser.py +130 -0
- nexusx-2.0.0/tests/test_relationship.py +353 -0
- nexusx-2.0.0/tests/test_resolver.py +464 -0
- nexusx-2.0.0/tests/test_response_builder.py +140 -0
- nexusx-2.0.0/tests/test_sdl_generator.py +447 -0
- nexusx-2.0.0/tests/test_standard_queries.py +307 -0
- nexusx-2.0.0/tests/test_subset.py +964 -0
- nexusx-2.0.0/tests/test_type_converter.py +299 -0
- nexusx-2.0.0/tests/test_type_tracer.py +361 -0
- nexusx-2.0.0/tests/test_type_utils.py +167 -0
- nexusx-2.0.0/tests/test_use_case.py +939 -0
- nexusx-2.0.0/tests/test_use_case_router.py +349 -0
- nexusx-2.0.0/tests/test_voyager_selfref.py +45 -0
- nexusx-2.0.0/uv.lock +2081 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths:
|
|
6
|
+
- 'src/nexusx/**'
|
|
7
|
+
- 'tests/**'
|
|
8
|
+
- 'pyproject.toml'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Set up uv
|
|
26
|
+
uses: astral-sh/setup-uv@v7
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: uv sync --all-extras
|
|
32
|
+
|
|
33
|
+
- name: Run linter
|
|
34
|
+
run: uv run ruff check src/
|
|
35
|
+
|
|
36
|
+
- name: Test with pytest
|
|
37
|
+
run: uv run pytest tests/ -v
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: GH Pages Deploy
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
paths:
|
|
8
|
+
- 'docs/**'
|
|
9
|
+
- 'mkdocs.yml'
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
deploy:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- name: Configure Git Credentials
|
|
20
|
+
run: |
|
|
21
|
+
git config user.name github-actions[bot]
|
|
22
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: 3.x
|
|
26
|
+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
|
27
|
+
- uses: actions/cache@v4
|
|
28
|
+
with:
|
|
29
|
+
key: mkdocs-material-${{ env.cache_id }}
|
|
30
|
+
path: .cache
|
|
31
|
+
restore-keys: |
|
|
32
|
+
mkdocs-material-
|
|
33
|
+
- run: pip install mkdocs-material mkdocs-static-i18n
|
|
34
|
+
- run: mkdocs gh-deploy --force
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Publish to PyPI via uv
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- "v*"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Set up uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v6
|
|
25
|
+
with:
|
|
26
|
+
python-version: "3.12"
|
|
27
|
+
|
|
28
|
+
- name: Build the package
|
|
29
|
+
run: uv build
|
|
30
|
+
|
|
31
|
+
- name: Publish to PyPI
|
|
32
|
+
run: uv publish --token ${{ secrets.PYPI_PUBLISHER }}
|
|
33
|
+
|
|
34
|
+
- name: Create GitHub Release
|
|
35
|
+
uses: softprops/action-gh-release@v2
|
|
36
|
+
with:
|
|
37
|
+
body: See [CHANGELOG](https://github.com/allmonday/nexusx/blob/master/CHANGELOG.md) for details.
|
|
38
|
+
generate_release_notes: true
|
|
39
|
+
files: |
|
|
40
|
+
dist/*.tar.gz
|
|
41
|
+
dist/*.whl
|
nexusx-2.0.0/.gitignore
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
*.egg
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv
|
|
12
|
+
venv/
|
|
13
|
+
env/
|
|
14
|
+
ENV/
|
|
15
|
+
|
|
16
|
+
# Database files
|
|
17
|
+
*.db
|
|
18
|
+
*.sqlite
|
|
19
|
+
*.sqlite3
|
|
20
|
+
|
|
21
|
+
# IDE
|
|
22
|
+
.vscode/
|
|
23
|
+
.idea/
|
|
24
|
+
*.swp
|
|
25
|
+
*.swo
|
|
26
|
+
*~
|
|
27
|
+
|
|
28
|
+
# Testing
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.coverage
|
|
31
|
+
htmlcov/
|
|
32
|
+
.tox/
|
|
33
|
+
|
|
34
|
+
# MyPy
|
|
35
|
+
.mypy_cache/
|
|
36
|
+
.dmypy.json
|
|
37
|
+
dmypy.json
|
|
38
|
+
|
|
39
|
+
# Ruff
|
|
40
|
+
.ruff_cache/
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
Thumbs.db
|
|
45
|
+
|
|
46
|
+
# Distribution
|
|
47
|
+
*.manifest
|
|
48
|
+
*.spec
|
|
49
|
+
.claude
|
|
50
|
+
|
|
51
|
+
site
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Skills ็ฎๅฝ
|
|
2
|
+
|
|
3
|
+
่ฟไธช็ฎๅฝๅ
ๅซไบๅฏๅค็จ็่ชๅจๅ่ๆฌ๏ผskills๏ผ๏ผ็จไบ็ฎๅๅธธ่งไปปๅกใ
|
|
4
|
+
|
|
5
|
+
## ๅฏ็จ็ Skills
|
|
6
|
+
|
|
7
|
+
### ๐ฆ release - ็ๆฌๅๅธ
|
|
8
|
+
|
|
9
|
+
่ชๅจๅๆง่ก็ๆฌๅๅธ็ๆ ๅๆต็จใ
|
|
10
|
+
|
|
11
|
+
#### ไฝฟ็จๆนๆณ
|
|
12
|
+
|
|
13
|
+
**Shell ็ๆฌ๏ผๆจ่๏ผ๏ผ**
|
|
14
|
+
```bash
|
|
15
|
+
./.skills/release.sh <version>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Python ็ๆฌ๏ผ**
|
|
19
|
+
```bash
|
|
20
|
+
python .skills/release.py <version>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**็คบไพ๏ผ**
|
|
24
|
+
```bash
|
|
25
|
+
./.skills/release.sh 0.8.2
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### ๆง่กๆญฅ้ชค
|
|
29
|
+
|
|
30
|
+
1. โ
้ช่ฏ็ๆฌๅทๆ ผๅผ๏ผSemVer๏ผ
|
|
31
|
+
2. โ
ๆฃๆฅๅทฅไฝๅบๆฏๅฆๅนฒๅ
|
|
32
|
+
3. โ
ๆดๆฐ `pyproject.toml` ไธญ็็ๆฌๅท
|
|
33
|
+
4. โ
่ฟ่กๅฎๆดๆต่ฏๅฅไปถ
|
|
34
|
+
5. โ
ๅๅปบ commit: "bump ver"
|
|
35
|
+
6. โ
ๅๅปบ tag: `v{version}`
|
|
36
|
+
7. โ
Push tag ๅฐ origin
|
|
37
|
+
|
|
38
|
+
#### ๅ็ฝฎ่ฆๆฑ
|
|
39
|
+
|
|
40
|
+
- Git ๅทฅไฝๅบๅฟ
้กปๅนฒๅ๏ผๆฒกๆๆชๆไบค็ๆดๆน๏ผ
|
|
41
|
+
- ๅทฒๅฎ่ฃ
`uv` ๅทฅๅ
ท
|
|
42
|
+
- ๆ push ๅฐ่ฟ็จไปๅบ็ๆ้
|
|
43
|
+
|
|
44
|
+
#### ้่ฏฏๅค็
|
|
45
|
+
|
|
46
|
+
- ๅฆๆๅทฅไฝๅบไธๅนฒๅ๏ผ่ๆฌไผไธญๆญขๅนถๆ็คบ
|
|
47
|
+
- ๅฆๆๆต่ฏๅคฑ่ดฅ๏ผ่ๆฌไผไธญๆญขๅนถๅๆป็ๆฌๅทๆดๆน
|
|
48
|
+
- ๅฆๆ tag ๅทฒๅญๅจ๏ผ่ๆฌไผๆ็คบไฝฟ็จไธๅ็็ๆฌๅท
|
|
49
|
+
- ๅฆๆ push ๅคฑ่ดฅ๏ผ่ๆฌไผๆไพๆๆฅๅปบ่ฎฎ
|
|
50
|
+
|
|
51
|
+
#### ็คบไพ่พๅบ
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
============================================================
|
|
55
|
+
๐ฆ Release Version: v0.8.2
|
|
56
|
+
============================================================
|
|
57
|
+
|
|
58
|
+
๐ Checking working directory...
|
|
59
|
+
โ
Working directory is clean
|
|
60
|
+
|
|
61
|
+
๐ Updating version to 0.8.2...
|
|
62
|
+
โ
Updated pyproject.toml to version 0.8.2
|
|
63
|
+
|
|
64
|
+
๐งช Running tests...
|
|
65
|
+
โ
All tests passed
|
|
66
|
+
|
|
67
|
+
๐ Creating commit...
|
|
68
|
+
โ
Created commit: abc1234
|
|
69
|
+
|
|
70
|
+
๐ท๏ธ Creating tag...
|
|
71
|
+
โ
Created tag: v0.8.2
|
|
72
|
+
|
|
73
|
+
๐ Pushing tag v0.8.2 to origin...
|
|
74
|
+
โ
Tag v0.8.2 pushed to origin
|
|
75
|
+
|
|
76
|
+
============================================================
|
|
77
|
+
โ
Release completed successfully!
|
|
78
|
+
============================================================
|
|
79
|
+
|
|
80
|
+
๐ฆ Version: v0.8.2
|
|
81
|
+
๐ Commit: abc1234
|
|
82
|
+
๐ท๏ธ Tag: v0.8.2
|
|
83
|
+
๐ Pushed to: origin/v0.8.2
|
|
84
|
+
|
|
85
|
+
๐ Recent commits included in this release:
|
|
86
|
+
abc1234 feat: add new feature
|
|
87
|
+
def5678 fix: correct bug
|
|
88
|
+
ghi9012 docs: update documentation
|
|
89
|
+
|
|
90
|
+
๐ Done!
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## ๆทปๅ ๆฐ็ Skill
|
|
94
|
+
|
|
95
|
+
่ฆๆทปๅ ๆฐ็ skill๏ผ่ฏท้ตๅพชไปฅไธ็ปๆ๏ผ
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
.skills/
|
|
99
|
+
โโโ README.md # ่ฟไธชๆไปถ
|
|
100
|
+
โโโ skill-name.md # Skill ๆๆกฃ
|
|
101
|
+
โโโ skill-name.sh # Shell ๅฎ็ฐ
|
|
102
|
+
โโโ skill-name.py # Python ๅฎ็ฐ๏ผๅฏ้๏ผ
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Skill ๅฝๅ่ง่
|
|
106
|
+
|
|
107
|
+
- ไฝฟ็จๅฐๅๅญๆฏๅ่ฟๅญ็ฌฆ
|
|
108
|
+
- ไฝฟ็จๅจ่ฏๆๅจไฝๅ็งฐ๏ผๅฆ `release`, `deploy`, `test`๏ผ
|
|
109
|
+
- ้ฟๅ
ไฝฟ็จ็ฉบๆ ผๅ็นๆฎๅญ็ฌฆ
|
|
110
|
+
|
|
111
|
+
### ๆไฝณๅฎ่ทต
|
|
112
|
+
|
|
113
|
+
1. **ๆไพๆธ
ๆฐ็ๆๆกฃ**๏ผๅจ `.md` ๆไปถไธญ่ฏดๆ็จๆณๅๅๆฐ
|
|
114
|
+
2. **้่ฏฏๅค็**๏ผ้ช่ฏ่พๅ
ฅๅนถๆไพๆ็จ็้่ฏฏๆถๆฏ
|
|
115
|
+
3. **ๅๆปๆบๅถ**๏ผๅฆๆๆไฝๅคฑ่ดฅ๏ผๅฐ่ฏๅๆปๆดๆน
|
|
116
|
+
4. **ๅฝฉ่ฒ่พๅบ**๏ผไฝฟ็จ้ข่ฒๆ้ซๅฏ่ฏปๆง
|
|
117
|
+
5. **่ฏฆ็ปๆฅๅฟ**๏ผๆพ็คบๆญฃๅจๆง่ก็ๆญฅ้ชค
|
|
118
|
+
|
|
119
|
+
## ๅจ Claude Code ไธญไฝฟ็จ
|
|
120
|
+
|
|
121
|
+
ไฝ ๅฏไปฅ่ฆๆฑ Claude Code ๆง่ก่ฟไบ skills๏ผ
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
่ฏทๆง่ก็ๆฌๅๅธ๏ผ็ๆฌๅทไธบ 0.8.3
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Claude Code ไผ่ชๅจ่ฏๅซๅนถๆง่ก็ธๅบ็ skill ่ๆฌใ
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Release Version Skill
|
|
2
|
+
|
|
3
|
+
ๅๅธๆฐ็ๆฌ็ๆ ๅๅๆต็จใ
|
|
4
|
+
|
|
5
|
+
## ไฝฟ็จๆนๆณ
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# ๅๅธๆฐ็ๆฌ
|
|
9
|
+
/skill release <version>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
ไพๅฆ๏ผ
|
|
13
|
+
```bash
|
|
14
|
+
/skill release 0.8.2
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## ๆง่กๆญฅ้ชค
|
|
18
|
+
|
|
19
|
+
ๅฝ็จๆท่ฏทๆฑๅๅธๆฐ็ๆฌๆถ๏ผๆง่กไปฅไธๆญฅ้ชค๏ผ
|
|
20
|
+
|
|
21
|
+
### 1. ้ช่ฏ็ๆฌๅท
|
|
22
|
+
- ็กฎ่ฎค็ๆฌๅทๆ ผๅผๆญฃ็กฎ๏ผๅฆ 0.8.2, 1.0.0๏ผ
|
|
23
|
+
- ๆฃๆฅๆฏๅฆๅคงไบๅฝๅ็ๆฌ
|
|
24
|
+
|
|
25
|
+
### 2. ๆดๆฐ็ๆฌๅท
|
|
26
|
+
- ไฟฎๆน `pyproject.toml` ไธญ็ `version` ๅญๆฎต
|
|
27
|
+
- ไฝฟ็จ Edit tool ๆดๆฐๆไปถ
|
|
28
|
+
|
|
29
|
+
### 3. ่ฟ่กๆต่ฏ
|
|
30
|
+
```bash
|
|
31
|
+
uv run pytest
|
|
32
|
+
```
|
|
33
|
+
- ็กฎไฟๆๆๆต่ฏ้่ฟ
|
|
34
|
+
- ๅฆๆๆต่ฏๅคฑ่ดฅ๏ผๅๆญขๅๅธๆต็จๅนถๆฅๅ้่ฏฏ
|
|
35
|
+
|
|
36
|
+
### 4. ๅๅปบ Git Commit
|
|
37
|
+
```bash
|
|
38
|
+
git add pyproject.toml
|
|
39
|
+
git commit -m "bump ver"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 5. ๅๅปบๅนถๆจ้ Tag
|
|
43
|
+
```bash
|
|
44
|
+
git tag v<version>
|
|
45
|
+
git push origin v<version>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 6. ็กฎ่ฎคๅๅธ
|
|
49
|
+
- ๆพ็คบๅๅธๆๅ็ๆถๆฏ
|
|
50
|
+
- ๅๅบๆฌๆฌกๅๅธๅ
ๅซ็ไธป่ฆๅๆด๏ผไปๆ่ฟ็ commits๏ผ
|
|
51
|
+
|
|
52
|
+
## ๆณจๆไบ้กน
|
|
53
|
+
|
|
54
|
+
- ็กฎไฟๅทฅไฝๅบๅนฒๅ๏ผๆฒกๆๆชๆไบค็ๆดๆน๏ผ
|
|
55
|
+
- ็กฎไฟ pyproject.toml ๆไปถๅญๅจ
|
|
56
|
+
- ็ๆฌๅทๅบ่ฏฅ้ตๅพช่ฏญไนๅ็ๆฌ่ง่๏ผSemVer๏ผ
|
|
57
|
+
- ๅฆๆ push ๅคฑ่ดฅ๏ผๆฃๆฅๆฏๅฆๆๆ้ๆ็ฝ็ป้ฎ้ข
|
|
58
|
+
|
|
59
|
+
## ็คบไพ่พๅบ
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
โ
็ๆฌๆดๆฐๆๅ
|
|
63
|
+
|
|
64
|
+
๐ฆ ็ๆฌ: v0.8.2
|
|
65
|
+
๐ Commit: abc1234
|
|
66
|
+
๐ท๏ธ Tag: v0.8.2
|
|
67
|
+
๐ ๅทฒๆจ้ๅฐ่ฟ็จไปๅบ
|
|
68
|
+
|
|
69
|
+
๐ ๆฌๆฌกๅๅธๅ
ๅซ:
|
|
70
|
+
- feat: add new feature
|
|
71
|
+
- fix: correct bug
|
|
72
|
+
- docs: update documentation
|
|
73
|
+
```
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Release version skill implementation."""
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def run_command(cmd, check=True, capture_output=True):
|
|
11
|
+
"""Run a shell command and return the result."""
|
|
12
|
+
result = subprocess.run(
|
|
13
|
+
cmd,
|
|
14
|
+
shell=True,
|
|
15
|
+
capture_output=capture_output,
|
|
16
|
+
text=True
|
|
17
|
+
)
|
|
18
|
+
if check and result.returncode != 0:
|
|
19
|
+
print(f"โ Error executing: {cmd}")
|
|
20
|
+
print(f" {result.stderr}")
|
|
21
|
+
sys.exit(1)
|
|
22
|
+
return result
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def validate_version(version):
|
|
26
|
+
"""Validate semantic version format."""
|
|
27
|
+
pattern = r'^\d+\.\d+\.\d+$'
|
|
28
|
+
if not re.match(pattern, version):
|
|
29
|
+
print(f"โ Invalid version format: {version}")
|
|
30
|
+
print(" Version must follow SemVer (e.g., 0.8.2, 1.0.0)")
|
|
31
|
+
sys.exit(1)
|
|
32
|
+
return True
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def check_working_directory():
|
|
36
|
+
"""Check if working directory is clean."""
|
|
37
|
+
result = run_command("git status --porcelain")
|
|
38
|
+
if result.stdout.strip():
|
|
39
|
+
print("โ Working directory is not clean")
|
|
40
|
+
print(" Please commit or stash your changes first")
|
|
41
|
+
print("\nUncommitted changes:")
|
|
42
|
+
print(result.stdout)
|
|
43
|
+
sys.exit(1)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def update_pyproject_version(new_version):
|
|
47
|
+
"""Update version in pyproject.toml."""
|
|
48
|
+
pyproject_path = Path("pyproject.toml")
|
|
49
|
+
if not pyproject_path.exists():
|
|
50
|
+
print("โ pyproject.toml not found")
|
|
51
|
+
sys.exit(1)
|
|
52
|
+
|
|
53
|
+
content = pyproject_path.read_text()
|
|
54
|
+
|
|
55
|
+
# Update version line
|
|
56
|
+
updated = re.sub(
|
|
57
|
+
r'version\s*=\s*["\']([^"\']+)["\']',
|
|
58
|
+
f'version = "{new_version}"',
|
|
59
|
+
content
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if updated == content:
|
|
63
|
+
print("โ Failed to update version in pyproject.toml")
|
|
64
|
+
sys.exit(1)
|
|
65
|
+
|
|
66
|
+
pyproject_path.write_text(updated)
|
|
67
|
+
print(f"โ
Updated pyproject.toml to version {new_version}")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def run_tests():
|
|
71
|
+
"""Run the full test suite."""
|
|
72
|
+
print("\n๐งช Running tests...")
|
|
73
|
+
result = run_command("uv run pytest", check=False)
|
|
74
|
+
if result.returncode != 0:
|
|
75
|
+
print("โ Tests failed")
|
|
76
|
+
print(result.stdout)
|
|
77
|
+
sys.exit(1)
|
|
78
|
+
print("โ
All tests passed")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def create_commit(version):
|
|
82
|
+
"""Create a commit for version bump."""
|
|
83
|
+
run_command("git add pyproject.toml uv.lock")
|
|
84
|
+
run_command('git commit -m "bump ver"')
|
|
85
|
+
result = run_command("git rev-parse --short HEAD")
|
|
86
|
+
commit_hash = result.stdout.strip()
|
|
87
|
+
print(f"โ
Created commit: {commit_hash}")
|
|
88
|
+
return commit_hash
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def create_tag(version):
|
|
92
|
+
"""Create a git tag."""
|
|
93
|
+
tag_name = f"v{version}"
|
|
94
|
+
result = run_command(f"git tag {tag_name}", check=False)
|
|
95
|
+
if result.returncode != 0:
|
|
96
|
+
if "already exists" in result.stderr:
|
|
97
|
+
print(f"โ Tag {tag_name} already exists")
|
|
98
|
+
sys.exit(1)
|
|
99
|
+
print(f"โ Failed to create tag: {result.stderr}")
|
|
100
|
+
sys.exit(1)
|
|
101
|
+
print(f"โ
Created tag: {tag_name}")
|
|
102
|
+
return tag_name
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def push_tag(tag_name):
|
|
106
|
+
"""Push tag to origin."""
|
|
107
|
+
print(f"\n๐ Pushing tag {tag_name} to origin...")
|
|
108
|
+
result = run_command(f"git push origin {tag_name}", check=False)
|
|
109
|
+
if result.returncode != 0:
|
|
110
|
+
print("โ Failed to push tag")
|
|
111
|
+
print(f" {result.stderr}")
|
|
112
|
+
print("\n๐ก Tips:")
|
|
113
|
+
print(" - Check your network connection")
|
|
114
|
+
print(" - Verify you have push permissions")
|
|
115
|
+
print(f" - Try: git push origin {tag_name}")
|
|
116
|
+
sys.exit(1)
|
|
117
|
+
print(f"โ
Tag {tag_name} pushed to origin")
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def get_recent_commits(count=5):
|
|
121
|
+
"""Get recent commit messages."""
|
|
122
|
+
result = run_command(f"git log --oneline -{count}")
|
|
123
|
+
return result.stdout.strip().split('\n')
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def main():
|
|
127
|
+
if len(sys.argv) < 2:
|
|
128
|
+
print("Usage: release <version>")
|
|
129
|
+
print("Example: release 0.8.2")
|
|
130
|
+
sys.exit(1)
|
|
131
|
+
|
|
132
|
+
version = sys.argv[1]
|
|
133
|
+
|
|
134
|
+
print(f"\n{'='*60}")
|
|
135
|
+
print(f"๐ฆ Release Version: v{version}")
|
|
136
|
+
print(f"{'='*60}\n")
|
|
137
|
+
|
|
138
|
+
# Step 1: Validate version
|
|
139
|
+
validate_version(version)
|
|
140
|
+
|
|
141
|
+
# Step 2: Check working directory
|
|
142
|
+
print("๐ Checking working directory...")
|
|
143
|
+
check_working_directory()
|
|
144
|
+
print("โ
Working directory is clean\n")
|
|
145
|
+
|
|
146
|
+
# Step 3: Update version in pyproject.toml
|
|
147
|
+
print(f"๐ Updating version to {version}...")
|
|
148
|
+
update_pyproject_version(version)
|
|
149
|
+
|
|
150
|
+
# Step 4: Run tests
|
|
151
|
+
run_tests()
|
|
152
|
+
|
|
153
|
+
# Step 5: Create commit
|
|
154
|
+
print("\n๐ Creating commit...")
|
|
155
|
+
commit_hash = create_commit(version)
|
|
156
|
+
|
|
157
|
+
# Step 6: Create tag
|
|
158
|
+
print("\n๐ท๏ธ Creating tag...")
|
|
159
|
+
tag_name = create_tag(version)
|
|
160
|
+
|
|
161
|
+
# Step 7: Push tag
|
|
162
|
+
push_tag(tag_name)
|
|
163
|
+
|
|
164
|
+
# Step 8: Show summary
|
|
165
|
+
print(f"\n{'='*60}")
|
|
166
|
+
print("โ
Release completed successfully!")
|
|
167
|
+
print(f"{'='*60}")
|
|
168
|
+
print(f"\n๐ฆ Version: {tag_name}")
|
|
169
|
+
print(f"๐ Commit: {commit_hash}")
|
|
170
|
+
print(f"๐ท๏ธ Tag: {tag_name}")
|
|
171
|
+
print(f"๐ Pushed to: origin/{tag_name}")
|
|
172
|
+
|
|
173
|
+
print("\n๐ Recent commits included in this release:")
|
|
174
|
+
for commit in get_recent_commits(3):
|
|
175
|
+
print(f" {commit}")
|
|
176
|
+
|
|
177
|
+
print("\n๐ Done!")
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
if __name__ == "__main__":
|
|
181
|
+
main()
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Release version skill - Shell implementation
|
|
3
|
+
|
|
4
|
+
set -e
|
|
5
|
+
|
|
6
|
+
# Colors
|
|
7
|
+
GREEN='\033[0;32m'
|
|
8
|
+
RED='\033[0;31m'
|
|
9
|
+
BLUE='\033[0;34m'
|
|
10
|
+
NC='\033[0m' # No Color
|
|
11
|
+
|
|
12
|
+
# Check if version is provided
|
|
13
|
+
if [ -z "$1" ]; then
|
|
14
|
+
echo -e "${RED}Usage: ./release.sh <version>${NC}"
|
|
15
|
+
echo "Example: ./release.sh 0.8.2"
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
VERSION=$1
|
|
20
|
+
TAG="v$VERSION"
|
|
21
|
+
|
|
22
|
+
# Validate version format
|
|
23
|
+
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
24
|
+
echo -e "${RED}โ Invalid version format: $VERSION${NC}"
|
|
25
|
+
echo " Version must follow SemVer (e.g., 0.8.2, 1.0.0)"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
echo ""
|
|
30
|
+
echo "============================================================"
|
|
31
|
+
echo -e "${BLUE}๐ฆ Release Version: ${TAG}${NC}"
|
|
32
|
+
echo "============================================================"
|
|
33
|
+
echo ""
|
|
34
|
+
|
|
35
|
+
# Check working directory
|
|
36
|
+
echo "๐ Checking working directory..."
|
|
37
|
+
if ! git diff-index --quiet HEAD --; then
|
|
38
|
+
echo -e "${RED}โ Working directory is not clean${NC}"
|
|
39
|
+
echo " Please commit or stash your changes first"
|
|
40
|
+
git status --short
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
echo -e "${GREEN}โ
Working directory is clean${NC}"
|
|
44
|
+
echo ""
|
|
45
|
+
|
|
46
|
+
# Update version in pyproject.toml
|
|
47
|
+
echo "๐ Updating version to $VERSION..."
|
|
48
|
+
if [ ! -f "pyproject.toml" ]; then
|
|
49
|
+
echo -e "${RED}โ pyproject.toml not found${NC}"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
sed -i.bak "s/^version = .*/version = \"$VERSION\"/" pyproject.toml
|
|
54
|
+
rm -f pyproject.toml.bak
|
|
55
|
+
echo -e "${GREEN}โ
Updated pyproject.toml to version $VERSION${NC}"
|
|
56
|
+
echo ""
|
|
57
|
+
|
|
58
|
+
# Run tests
|
|
59
|
+
echo "๐งช Running tests..."
|
|
60
|
+
if ! uv run pytest; then
|
|
61
|
+
echo -e "${RED}โ Tests failed${NC}"
|
|
62
|
+
git checkout pyproject.toml
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
echo -e "${GREEN}โ
All tests passed${NC}"
|
|
66
|
+
echo ""
|
|
67
|
+
|
|
68
|
+
# Create commit
|
|
69
|
+
echo "๐ Creating commit..."
|
|
70
|
+
git add pyproject.toml uv.lock
|
|
71
|
+
git commit -m "bump ver"
|
|
72
|
+
COMMIT=$(git rev-parse --short HEAD)
|
|
73
|
+
echo -e "${GREEN}โ
Created commit: $COMMIT${NC}"
|
|
74
|
+
echo ""
|
|
75
|
+
|
|
76
|
+
# Create tag
|
|
77
|
+
echo "๐ท๏ธ Creating tag..."
|
|
78
|
+
if git tag $TAG 2>&1 | grep -q "already exists"; then
|
|
79
|
+
echo -e "${RED}โ Tag $TAG already exists${NC}"
|
|
80
|
+
exit 1
|
|
81
|
+
fi
|
|
82
|
+
echo -e "${GREEN}โ
Created tag: $TAG${NC}"
|
|
83
|
+
echo ""
|
|
84
|
+
|
|
85
|
+
# Push tag
|
|
86
|
+
echo "๐ Pushing tag $TAG to origin..."
|
|
87
|
+
if ! git push origin $TAG; then
|
|
88
|
+
echo -e "${RED}โ Failed to push tag${NC}"
|
|
89
|
+
echo ""
|
|
90
|
+
echo "๐ก Tips:"
|
|
91
|
+
echo " - Check your network connection"
|
|
92
|
+
echo " - Verify you have push permissions"
|
|
93
|
+
echo " - Try: git push origin $TAG"
|
|
94
|
+
exit 1
|
|
95
|
+
fi
|
|
96
|
+
echo -e "${GREEN}โ
Tag $TAG pushed to origin${NC}"
|
|
97
|
+
echo ""
|
|
98
|
+
|
|
99
|
+
# Show summary
|
|
100
|
+
echo "============================================================"
|
|
101
|
+
echo -e "${GREEN}โ
Release completed successfully!${NC}"
|
|
102
|
+
echo "============================================================"
|
|
103
|
+
echo ""
|
|
104
|
+
echo "๐ฆ Version: $TAG"
|
|
105
|
+
echo "๐ Commit: $COMMIT"
|
|
106
|
+
echo "๐ท๏ธ Tag: $TAG"
|
|
107
|
+
echo "๐ Pushed to: origin/$TAG"
|
|
108
|
+
echo ""
|
|
109
|
+
echo "๐ Recent commits included in this release:"
|
|
110
|
+
git log --oneline -3 | sed 's/^/ /'
|
|
111
|
+
echo ""
|
|
112
|
+
echo -e "${GREEN}๐ Done!${NC}"
|