strapi-kit 0.0.1__tar.gz → 0.0.2__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.
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/workflows/ci.yml +10 -3
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/workflows/dev-release.yml +1 -1
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/workflows/release.yml +1 -1
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.gitignore +5 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/PKG-INFO +12 -12
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/README.md +10 -11
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/pyproject.toml +1 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/_version.py +2 -2
- strapi_kit-0.0.1/.github/workflows/publish-testpypi.yml +0 -208
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.coderabbit.yaml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.env.example +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/dependabot.yml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/pull_request_template.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/workflows/document.yml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.github/workflows/guard-main-origin.yml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.pre-commit-config.yaml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/.secrets.baseline +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/CLAUDE.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/LICENSE +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/Makefile +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/codecov.yml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/changelog.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/configuration.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/development/architecture.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/development/contributing.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/development/release-process.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/development/testing.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/export-import.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/index.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/installation.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/media.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/models.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/quickstart.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/docs/stylesheets/extra.css +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/MIGRATION_GUIDE.md +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/async_operations.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/basic_crud.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/config_di_demo.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/export_import_with_media.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/export_import_with_schemas.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/full_migration_v5.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/simple_migration.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/examples/verify_installation.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/mkdocs.yml +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/__version__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/auth/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/auth/api_token.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/cache/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/cache/schema_cache.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/client/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/client/async_client.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/client/base.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/client/sync_client.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/config_provider.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/exceptions/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/exceptions/errors.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/export/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/export/exporter.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/export/importer.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/export/media_handler.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/export/relation_resolver.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/bulk.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/config.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/enums.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/export_format.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/import_options.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/fields.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/filters.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/pagination.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/populate.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/query.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/request/sort.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/base.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/component.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/media.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/meta.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/normalized.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/relation.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/v4.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/response/v5.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/models/schema.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/operations/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/operations/media.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/operations/streaming.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/parsers/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/parsers/version_detecting.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/protocols.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/utils/__init__.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/utils/rate_limiter.py +0 -0
- {strapi_kit-0.0.1 → strapi_kit-0.0.2}/src/strapi_kit/utils/uid.py +0 -0
|
@@ -80,17 +80,24 @@ jobs:
|
|
|
80
80
|
# Install project with dev dependencies
|
|
81
81
|
uv pip install --system -e ".[dev]"
|
|
82
82
|
|
|
83
|
-
# Run tests with coverage
|
|
84
|
-
pytest --cov=strapi_kit --cov-report=xml --cov-report=term -v
|
|
83
|
+
# Run tests with coverage and JUnit XML for test analytics
|
|
84
|
+
pytest --cov=strapi_kit --cov-report=xml --cov-report=term --junitxml=junit.xml -o junit_family=legacy -v
|
|
85
85
|
|
|
86
|
-
- name: 📈
|
|
86
|
+
- name: 📈 Upload coverage to Codecov
|
|
87
87
|
uses: codecov/codecov-action@v5
|
|
88
88
|
with:
|
|
89
89
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
90
|
+
slug: MehdiZare/strapi-kit
|
|
90
91
|
files: coverage.xml
|
|
91
92
|
flags: unittests
|
|
92
93
|
fail_ci_if_error: false
|
|
93
94
|
|
|
95
|
+
- name: 📊 Upload test results to Codecov
|
|
96
|
+
if: ${{ !cancelled() }}
|
|
97
|
+
uses: codecov/test-results-action@v1
|
|
98
|
+
with:
|
|
99
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
100
|
+
|
|
94
101
|
test-matrix-expected:
|
|
95
102
|
name: Test-MatrixExpected
|
|
96
103
|
runs-on: ubuntu-latest
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: strapi-kit
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: A modern Python client for Strapi CMS with import/export capabilities
|
|
5
5
|
Project-URL: Homepage, https://github.com/mehdizare/strapi-kit
|
|
6
6
|
Project-URL: Documentation, https://mehdizare.github.io/strapi-kit/
|
|
@@ -16,6 +16,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
20
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
21
|
Requires-Python: >=3.12
|
|
21
22
|
Requires-Dist: httpx>=0.28.1
|
|
@@ -45,7 +46,11 @@ Description-Content-Type: text/markdown
|
|
|
45
46
|
|
|
46
47
|
# strapi-kit
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
[](https://github.com/MehdiZare/strapi-kit/actions/workflows/ci.yml)
|
|
50
|
+
[](https://codecov.io/gh/MehdiZare/strapi-kit)
|
|
51
|
+
[](https://pypi.org/project/strapi-kit/)
|
|
52
|
+
[](https://pypi.org/project/strapi-kit/)
|
|
53
|
+
[](https://github.com/MehdiZare/strapi-kit/blob/main/LICENSE)
|
|
49
54
|
|
|
50
55
|
A modern Python client for Strapi CMS with comprehensive import/export capabilities.
|
|
51
56
|
|
|
@@ -954,33 +959,28 @@ cd strapi-kit
|
|
|
954
959
|
python -m venv .venv
|
|
955
960
|
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
956
961
|
|
|
957
|
-
# Install dependencies (uv
|
|
962
|
+
# Install dependencies including pre-commit (uv recommended)
|
|
958
963
|
uv pip install -e ".[dev]"
|
|
959
964
|
# Or with pip
|
|
960
965
|
pip install -e ".[dev]"
|
|
961
966
|
|
|
962
967
|
# Install pre-commit hooks (one-time setup)
|
|
963
|
-
make install-hooks
|
|
964
|
-
# Or manually:
|
|
965
968
|
pre-commit install
|
|
966
969
|
```
|
|
967
970
|
|
|
968
971
|
### Pre-commit Hooks
|
|
969
972
|
|
|
970
|
-
This project uses pre-commit hooks to ensure code quality
|
|
973
|
+
This project uses pre-commit hooks to ensure code quality. The `pre-commit` package is included in `[dev]` dependencies.
|
|
971
974
|
|
|
972
975
|
```bash
|
|
973
|
-
# Install
|
|
974
|
-
make install-hooks
|
|
975
|
-
|
|
976
|
-
# Or manually:
|
|
976
|
+
# Install hooks (one-time setup, after installing dev dependencies)
|
|
977
977
|
pre-commit install
|
|
978
978
|
|
|
979
979
|
# Run hooks manually on all files
|
|
980
|
-
|
|
980
|
+
pre-commit run --all-files
|
|
981
981
|
|
|
982
982
|
# Update hooks to latest versions
|
|
983
|
-
|
|
983
|
+
pre-commit autoupdate
|
|
984
984
|
```
|
|
985
985
|
|
|
986
986
|
**What the hooks check:**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# strapi-kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/MehdiZare/strapi-kit/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/MehdiZare/strapi-kit)
|
|
5
|
+
[](https://pypi.org/project/strapi-kit/)
|
|
6
|
+
[](https://pypi.org/project/strapi-kit/)
|
|
7
|
+
[](https://github.com/MehdiZare/strapi-kit/blob/main/LICENSE)
|
|
4
8
|
|
|
5
9
|
A modern Python client for Strapi CMS with comprehensive import/export capabilities.
|
|
6
10
|
|
|
@@ -909,33 +913,28 @@ cd strapi-kit
|
|
|
909
913
|
python -m venv .venv
|
|
910
914
|
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
911
915
|
|
|
912
|
-
# Install dependencies (uv
|
|
916
|
+
# Install dependencies including pre-commit (uv recommended)
|
|
913
917
|
uv pip install -e ".[dev]"
|
|
914
918
|
# Or with pip
|
|
915
919
|
pip install -e ".[dev]"
|
|
916
920
|
|
|
917
921
|
# Install pre-commit hooks (one-time setup)
|
|
918
|
-
make install-hooks
|
|
919
|
-
# Or manually:
|
|
920
922
|
pre-commit install
|
|
921
923
|
```
|
|
922
924
|
|
|
923
925
|
### Pre-commit Hooks
|
|
924
926
|
|
|
925
|
-
This project uses pre-commit hooks to ensure code quality
|
|
927
|
+
This project uses pre-commit hooks to ensure code quality. The `pre-commit` package is included in `[dev]` dependencies.
|
|
926
928
|
|
|
927
929
|
```bash
|
|
928
|
-
# Install
|
|
929
|
-
make install-hooks
|
|
930
|
-
|
|
931
|
-
# Or manually:
|
|
930
|
+
# Install hooks (one-time setup, after installing dev dependencies)
|
|
932
931
|
pre-commit install
|
|
933
932
|
|
|
934
933
|
# Run hooks manually on all files
|
|
935
|
-
|
|
934
|
+
pre-commit run --all-files
|
|
936
935
|
|
|
937
936
|
# Update hooks to latest versions
|
|
938
|
-
|
|
937
|
+
pre-commit autoupdate
|
|
939
938
|
```
|
|
940
939
|
|
|
941
940
|
**What the hooks check:**
|
|
@@ -16,6 +16,7 @@ classifiers = [
|
|
|
16
16
|
"Programming Language :: Python :: 3",
|
|
17
17
|
"Programming Language :: Python :: 3.12",
|
|
18
18
|
"Programming Language :: Python :: 3.13",
|
|
19
|
+
"Programming Language :: Python :: 3.14",
|
|
19
20
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
20
21
|
]
|
|
21
22
|
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.0.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
31
|
+
__version__ = version = '0.0.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 0, 2)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
name: Publish-to-TestPyPI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
# Trigger on PRs from dev to main with release labels
|
|
5
|
-
pull_request:
|
|
6
|
-
types: [opened, synchronize, labeled]
|
|
7
|
-
branches:
|
|
8
|
-
- main
|
|
9
|
-
# Also trigger on pre-release tags
|
|
10
|
-
push:
|
|
11
|
-
tags:
|
|
12
|
-
- 'v*.*.*rc*' # Release candidates (v1.2.3rc1)
|
|
13
|
-
- 'v*.*.*a*' # Alpha releases (v1.2.3a1)
|
|
14
|
-
- 'v*.*.*b*' # Beta releases (v1.2.3b1)
|
|
15
|
-
- 'v*.*.*dev*' # Dev releases (v1.2.3dev1)
|
|
16
|
-
|
|
17
|
-
permissions:
|
|
18
|
-
id-token: write # OIDC → Trusted Publishing
|
|
19
|
-
pull-requests: write # Comment on PRs
|
|
20
|
-
contents: read # Read repository contents
|
|
21
|
-
issues: write # Use Issues API for PR comments
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
test-release-build:
|
|
25
|
-
# Only run for PRs from dev with release labels
|
|
26
|
-
if: |
|
|
27
|
-
github.event_name == 'pull_request' &&
|
|
28
|
-
github.event.pull_request.head.ref == 'dev' &&
|
|
29
|
-
(contains(github.event.pull_request.labels.*.name, 'release:major') ||
|
|
30
|
-
contains(github.event.pull_request.labels.*.name, 'release:minor') ||
|
|
31
|
-
contains(github.event.pull_request.labels.*.name, 'release:patch'))
|
|
32
|
-
|
|
33
|
-
runs-on: ubuntu-latest
|
|
34
|
-
environment: testpypi
|
|
35
|
-
env:
|
|
36
|
-
PYTHON_VERSION: "3.12"
|
|
37
|
-
|
|
38
|
-
steps:
|
|
39
|
-
- name: 🛎️ Checkout repository
|
|
40
|
-
uses: actions/checkout@v6
|
|
41
|
-
with:
|
|
42
|
-
fetch-depth: 0 # Needed for version calculation
|
|
43
|
-
ref: ${{ github.event.pull_request.head.sha }}
|
|
44
|
-
|
|
45
|
-
- name: 🐍 Set up Python
|
|
46
|
-
uses: actions/setup-python@v6
|
|
47
|
-
with:
|
|
48
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
49
|
-
|
|
50
|
-
- name: ⚡ Install uv (with cache)
|
|
51
|
-
uses: astral-sh/setup-uv@v7
|
|
52
|
-
with:
|
|
53
|
-
enable-cache: true
|
|
54
|
-
|
|
55
|
-
- name: 📦 Install build tools
|
|
56
|
-
run: |
|
|
57
|
-
uv pip install --system build hatch
|
|
58
|
-
|
|
59
|
-
- name: 🏷️ Calculate and create test version tag
|
|
60
|
-
id: version
|
|
61
|
-
run: |
|
|
62
|
-
# Get the latest tag
|
|
63
|
-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
|
64
|
-
CURRENT_VERSION=${LATEST_TAG#v}
|
|
65
|
-
|
|
66
|
-
# Parse version components
|
|
67
|
-
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
|
|
68
|
-
|
|
69
|
-
# Determine version bump type from labels
|
|
70
|
-
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:major') }}" == "true" ]]; then
|
|
71
|
-
NEW_VERSION="$((MAJOR + 1)).0.0"
|
|
72
|
-
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'release:minor') }}" == "true" ]]; then
|
|
73
|
-
NEW_VERSION="${MAJOR}.$((MINOR + 1)).0"
|
|
74
|
-
else
|
|
75
|
-
NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"
|
|
76
|
-
fi
|
|
77
|
-
|
|
78
|
-
# Add dev suffix with PR number for TestPyPI
|
|
79
|
-
TEST_VERSION="${NEW_VERSION}.dev${{ github.event.pull_request.number }}"
|
|
80
|
-
TEST_TAG="v${TEST_VERSION}"
|
|
81
|
-
|
|
82
|
-
echo "TEST_VERSION=$TEST_VERSION" >> $GITHUB_OUTPUT
|
|
83
|
-
echo "TEST_TAG=$TEST_TAG" >> $GITHUB_OUTPUT
|
|
84
|
-
echo "📦 Test version: $TEST_VERSION"
|
|
85
|
-
|
|
86
|
-
# Create a temporary tag for hatch-vcs to pick up and reset HEAD to it
|
|
87
|
-
git config user.name github-actions
|
|
88
|
-
git config user.email github-actions@github.com
|
|
89
|
-
git tag -a "$TEST_TAG" -m "Test release $TEST_TAG"
|
|
90
|
-
|
|
91
|
-
# Force hatch-vcs to see this as the current tag by checking it out
|
|
92
|
-
git checkout "$TEST_TAG"
|
|
93
|
-
|
|
94
|
-
- name: 📦 Build wheel & sdist
|
|
95
|
-
run: |
|
|
96
|
-
echo "🏷️ Current git state:"
|
|
97
|
-
git describe --tags --always
|
|
98
|
-
echo "📦 Building package..."
|
|
99
|
-
|
|
100
|
-
python -m build --wheel --sdist
|
|
101
|
-
|
|
102
|
-
echo "📦 Build completed. Contents of dist/:"
|
|
103
|
-
ls -la dist/
|
|
104
|
-
|
|
105
|
-
# Verify the version in the built package
|
|
106
|
-
echo "📋 Checking built package version:"
|
|
107
|
-
if ls dist/*.tar.gz 1> /dev/null 2>&1; then
|
|
108
|
-
tar -tf dist/*.tar.gz | grep -E "(PKG-INFO|METADATA)" | head -1 | xargs tar -xOf dist/*.tar.gz | grep "^Version:" || echo "Version not found in metadata"
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
- name: 🧪 Upload to Test PyPI
|
|
112
|
-
uses: pypa/gh-action-pypi-publish@v1.13.0
|
|
113
|
-
with:
|
|
114
|
-
repository-url: https://test.pypi.org/legacy/
|
|
115
|
-
packages-dir: dist
|
|
116
|
-
skip-existing: true
|
|
117
|
-
verbose: true
|
|
118
|
-
print-hash: true
|
|
119
|
-
|
|
120
|
-
- name: 📝 Comment on PR
|
|
121
|
-
uses: actions/github-script@v8
|
|
122
|
-
with:
|
|
123
|
-
script: |
|
|
124
|
-
const version = '${{ steps.version.outputs.TEST_VERSION }}';
|
|
125
|
-
const comment = `## 🧪 Test Release Published
|
|
126
|
-
|
|
127
|
-
A test version has been published to TestPyPI for verification.
|
|
128
|
-
|
|
129
|
-
**Version:** \`${version}\`
|
|
130
|
-
|
|
131
|
-
### Installation
|
|
132
|
-
\`\`\`bash
|
|
133
|
-
pip install -i https://test.pypi.org/simple/ strapi-kit==${version}
|
|
134
|
-
\`\`\`
|
|
135
|
-
|
|
136
|
-
### Verification Steps
|
|
137
|
-
1. Install the test package using the command above
|
|
138
|
-
2. Verify the package imports correctly
|
|
139
|
-
3. Test key functionality
|
|
140
|
-
4. Check that all dependencies are resolved
|
|
141
|
-
|
|
142
|
-
✅ Once verified, merge this PR to trigger the actual release to PyPI.`;
|
|
143
|
-
|
|
144
|
-
// Find existing comment
|
|
145
|
-
const { data: comments } = await github.rest.issues.listComments({
|
|
146
|
-
owner: context.repo.owner,
|
|
147
|
-
repo: context.repo.repo,
|
|
148
|
-
issue_number: context.issue.number,
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
const botComment = comments.find(comment =>
|
|
152
|
-
comment.user.type === 'Bot' &&
|
|
153
|
-
comment.body.includes('Test Release Published')
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
if (botComment) {
|
|
157
|
-
// Update existing comment
|
|
158
|
-
await github.rest.issues.updateComment({
|
|
159
|
-
owner: context.repo.owner,
|
|
160
|
-
repo: context.repo.repo,
|
|
161
|
-
comment_id: botComment.id,
|
|
162
|
-
body: comment,
|
|
163
|
-
});
|
|
164
|
-
} else {
|
|
165
|
-
// Create new comment
|
|
166
|
-
await github.rest.issues.createComment({
|
|
167
|
-
owner: context.repo.owner,
|
|
168
|
-
repo: context.repo.repo,
|
|
169
|
-
issue_number: context.issue.number,
|
|
170
|
-
body: comment,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
# Original job for tag-based releases
|
|
175
|
-
publish-prerelease:
|
|
176
|
-
if: github.event_name == 'push'
|
|
177
|
-
runs-on: ubuntu-latest
|
|
178
|
-
environment: testpypi
|
|
179
|
-
env:
|
|
180
|
-
PYTHON_VERSION: "3.12"
|
|
181
|
-
|
|
182
|
-
steps:
|
|
183
|
-
- name: 🛎️ Checkout repository
|
|
184
|
-
uses: actions/checkout@v6
|
|
185
|
-
with:
|
|
186
|
-
fetch-depth: 0 # Needed for hatch-vcs versioning
|
|
187
|
-
|
|
188
|
-
- name: 🐍 Set up Python
|
|
189
|
-
uses: actions/setup-python@v6
|
|
190
|
-
with:
|
|
191
|
-
python-version: ${{ env.PYTHON_VERSION }}
|
|
192
|
-
|
|
193
|
-
- name: ⚡ Install uv (with cache)
|
|
194
|
-
uses: astral-sh/setup-uv@v7
|
|
195
|
-
with:
|
|
196
|
-
enable-cache: true
|
|
197
|
-
|
|
198
|
-
- name: 📦 Build wheel & sdist
|
|
199
|
-
run: |
|
|
200
|
-
uv pip install --system build hatch
|
|
201
|
-
python -m build --wheel --sdist
|
|
202
|
-
|
|
203
|
-
- name: 🚀 Upload to Test PyPI
|
|
204
|
-
uses: pypa/gh-action-pypi-publish@v1.13.0
|
|
205
|
-
with:
|
|
206
|
-
repository-url: https://test.pypi.org/legacy/
|
|
207
|
-
packages-dir: dist
|
|
208
|
-
skip-existing: true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|