30 Commits

Author SHA1 Message Date
Xuwznln
043f934a42 Update ci 2025-10-01 17:28:01 +08:00
Xuwznln
0faaa9ebdb Bump version: 0.1.3 → 0.1.4 2025-10-01 16:25:50 +08:00
Xuwznln
c4d55fed1b Fix release build 2025-10-01 16:21:00 +08:00
Xuwznln
0684e823c0 Bump version: 0.1.2 → 0.1.3 2025-10-01 16:10:24 +08:00
Xuwznln
98e0b9966e Update safety report 2025-10-01 16:07:17 +08:00
Xuwznln
041710d331 Bump version: 0.1.1 → 0.1.2 2025-10-01 15:40:58 +08:00
Xuwznln
cb9dd57f19 Bump version to 0.1.1 2025-10-01 15:40:46 +08:00
Xuwznln
3d032c0b98 Update gitignore 2025-10-01 15:38:25 +08:00
Xuwznln
1ccf2d4ac7 Merge pull request #6 from ZGCA-Forge/dependabot/github_actions/actions/setup-python-6
ci(deps): bump actions/setup-python from 5 to 6
2025-10-01 15:36:58 +08:00
dependabot[bot]
477d7075d5 ci(deps): bump actions/setup-python from 5 to 6
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-08 07:29:29 +00:00
Xuwznln
ec2fafb363 Bump version: 0.0.6 → 0.1.0 2025-09-05 01:28:49 +08:00
Xuwznln
74e7a15ef9 Merge pull request #5 from ZGCA-Forge/dependabot/github_actions/actions/checkout-5
ci(deps): bump actions/checkout from 4 to 5
2025-09-05 01:27:15 +08:00
dependabot[bot]
661ee43a1c ci(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-04 17:27:06 +00:00
Xuwznln
0dff62e738 Merge pull request #4 from ZGCA-Forge/dependabot/github_actions/actions/configure-pages-5
ci(deps): bump actions/configure-pages from 4 to 5
2025-09-05 01:26:56 +08:00
Xuwznln
823b04dcbc Merge branch 'main' into dependabot/github_actions/actions/configure-pages-5 2025-09-05 01:26:41 +08:00
Xuwznln
80726163dd Merge pull request #3 from ZGCA-Forge/dependabot/github_actions/softprops/action-gh-release-2
ci(deps): bump softprops/action-gh-release from 1 to 2
2025-09-05 01:26:18 +08:00
Xuwznln
656ef7ca80 Merge pull request #2 from ZGCA-Forge/dependabot/github_actions/actions/download-artifact-5
ci(deps): bump actions/download-artifact from 4 to 5
2025-09-05 01:26:11 +08:00
Xuwznln
cc394fd63c Merge pull request #1 from ZGCA-Forge/dependabot/github_actions/actions/upload-pages-artifact-4
ci(deps): bump actions/upload-pages-artifact from 3 to 4
2025-09-05 01:26:01 +08:00
Xuwznln
2d83bad8ce Merge branch 'main' into dependabot/github_actions/actions/upload-pages-artifact-4 2025-09-05 01:25:52 +08:00
Xuwznln
9d52781134 Bump version: 0.0.5 → 0.0.6 2025-09-05 01:23:06 +08:00
Xuwznln
89169ca7be 添加 PyPI 下载量徽章并格式化文档 2025-09-05 01:22:52 +08:00
dependabot[bot]
cda31464d3 ci(deps): bump actions/configure-pages from 4 to 5
Bumps [actions/configure-pages](https://github.com/actions/configure-pages) from 4 to 5.
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/configure-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 08:01:31 +00:00
dependabot[bot]
20a904ef8a ci(deps): bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '2'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 05:52:50 +00:00
dependabot[bot]
d8070b5e49 ci(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 05:47:49 +00:00
dependabot[bot]
d5704e78c3 ci(deps): bump actions/upload-pages-artifact from 3 to 4
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-03 05:41:50 +00:00
Xuwznln
9d6d21de62 Bump version: 0.0.4 → 0.0.5 2025-09-03 13:09:22 +08:00
Xuwznln
502d4c4c04 Update publish.yml 2025-09-03 13:09:03 +08:00
Xuwznln
02f3216456 Update publish.yml 2025-09-03 13:04:30 +08:00
Xuwznln
a871c11df8 Bump version: 0.0.3 → 0.0.4 2025-09-03 12:59:30 +08:00
Xuwznln
7d1bc307ee Update publish.yml 2025-09-03 12:59:22 +08:00
9 changed files with 97 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.3
current_version = 0.1.4
commit = True
tag = True
tag_name = v{new_version}

View File

@@ -16,10 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10" # Use minimum version for consistency
@@ -40,10 +40,10 @@ jobs:
needs: [code-format] # Only run after code formatting passes
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python 3.10
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
@@ -72,7 +72,7 @@ jobs:
needs: [basic-build] # Only run after basic build passes
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
@@ -112,20 +112,14 @@ jobs:
needs: [basic-build] # Run in parallel with ROS2 test after basic build
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
- name: Run Safety CLI to check for vulnerabilities
uses: pyupio/safety-action@v1
with:
python-version: "3.10" # Use minimum version for consistency
- name: Install security tools
run: |
python -m pip install --upgrade pip
pip install "safety>=3.0.0" "typer<0.12.0" "marshmallow<4.0.0"
- name: Run safety security scan
run: safety check --output json > safety-report.json
api-key: ${{ secrets.SAFETY_CHECK }}
output-format: json
args: --detailed-output --output-format json
- name: Upload security reports
uses: actions/upload-artifact@v4
@@ -142,10 +136,10 @@ jobs:
needs: [basic-build] # Run in parallel with other checks
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10" # Use minimum version for consistency
@@ -182,10 +176,10 @@ jobs:
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
@@ -201,20 +195,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install pytest
pip install -e .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-line-length=200 --extend-ignore=E203,W503,F401,E402,E721,F841 --statistics
- name: Type checking with mypy
run: |
mypy msgcenterpy --disable-error-code=unused-ignore
- name: Test with pytest
run: |
pytest

View File

@@ -36,12 +36,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
@@ -55,7 +55,7 @@ jobs:
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v5
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_pages == 'true')
- name: Build Sphinx documentation
@@ -64,7 +64,7 @@ jobs:
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v4
if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_to_pages == 'true')
with:
path: docs/_build/html

View File

@@ -10,7 +10,7 @@ name: Upload PyPI package
on:
release:
types: [published]
types: [published, edited]
workflow_dispatch:
inputs:
test_pypi:
@@ -29,10 +29,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10" # Use minimum version for consistency
@@ -53,10 +53,10 @@ jobs:
needs: [code-format] # Only run after code formatting passes
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python 3.10
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
@@ -85,7 +85,7 @@ jobs:
needs: [basic-build] # Only run after basic build passes
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
@@ -125,20 +125,14 @@ jobs:
needs: [basic-build] # Run in parallel with ROS2 test after basic build
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
- name: Run Safety CLI to check for vulnerabilities
uses: pyupio/safety-action@v1
with:
python-version: "3.10" # Use minimum version for consistency
- name: Install security tools
run: |
python -m pip install --upgrade pip
pip install "safety>=3.0.0" "typer<0.12.0" "marshmallow<4.0.0"
- name: Run safety security scan
run: safety check --output json > safety-report.json
api-key: ${{ secrets.SAFETY_CHECK }}
output-format: json
args: --detailed-output --output-format json
- name: Upload security reports
uses: actions/upload-artifact@v4
@@ -154,10 +148,10 @@ jobs:
needs: [test-with-ros2]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10" # Use minimum version for consistency
@@ -167,15 +161,33 @@ jobs:
python -m pip install build twine
- name: Verify version consistency
if: github.event_name == 'release'
if: github.event_name == 'release' && (github.event.action == 'published' || (github.event.action == 'edited' && !github.event.release.prerelease))
run: |
VERSION=$(python -c "import msgcenterpy; print(msgcenterpy.__version__)" 2>/dev/null || echo "unknown")
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
# Install package first
pip install -e .
# Get package version (fail fast if not available)
VERSION=$(python -c "import msgcenterpy; print(msgcenterpy.__version__)")
# Handle both v0.0.3 and 0.0.3 tag formats
RAW_TAG="${GITHUB_REF#refs/tags/}"
if [[ "$RAW_TAG" == v* ]]; then
TAG_VERSION="${RAW_TAG#v}"
else
TAG_VERSION="$RAW_TAG"
fi
echo "Package version: $VERSION"
echo "Tag version: $TAG_VERSION"
if [ "$VERSION" != "$TAG_VERSION" ]; then
echo "Version mismatch: package=$VERSION, tag=$TAG_VERSION"
echo "Version mismatch: package=$VERSION, tag=$TAG_VERSION"
echo "Please ensure the package version matches the git tag"
exit 1
fi
echo "✅ Version verification passed: $VERSION"
- name: Build release distributions
run: |
python -m build
@@ -195,7 +207,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- release-build
if: github.event_name == 'release' && !github.event.release.prerelease && github.event.inputs.test_pypi != 'true'
if: github.event_name == 'release' && !github.event.release.prerelease && github.event.inputs.test_pypi != 'true' && (github.event.action == 'published' || github.event.action == 'edited')
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
@@ -205,7 +217,7 @@ jobs:
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: release-dists
path: dist/
@@ -218,7 +230,7 @@ jobs:
runs-on: ubuntu-latest
needs:
- release-build
if: github.event.inputs.test_pypi == 'true' || (github.event_name == 'release' && github.event.release.prerelease)
if: github.event.inputs.test_pypi == 'true' || (github.event_name == 'release' && github.event.release.prerelease && (github.event.action == 'published' || github.event.action == 'edited'))
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
@@ -228,7 +240,7 @@ jobs:
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: release-dists
path: dist/
@@ -242,17 +254,19 @@ jobs:
name: Add assets to GitHub release
runs-on: ubuntu-latest
needs: release-build
if: github.event_name == 'release'
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited')
permissions:
contents: write # Need write access to upload release assets
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: release-dists
path: dist/
- name: Upload release assets
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: dist/*
env:
@@ -265,7 +279,7 @@ jobs:
if: always() && (needs.pypi-publish.result == 'success' || needs.test-pypi-publish.result == 'success')
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Create deployment summary
run: |

3
.gitignore vendored
View File

@@ -48,6 +48,9 @@ docs/_static/
# Visual Studio Code
.vscode/
.cursor/
.cursorignore
pyrightconfig.json
# ================================
# Operating System files

View File

@@ -184,7 +184,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2025 ZGCA-Forge/MsgCenterPy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -4,6 +4,7 @@
[![PyPI version](https://badge.fury.io/py/msgcenterpy.svg)](https://badge.fury.io/py/msgcenterpy)
[![Python versions](https://img.shields.io/pypi/pyversions/msgcenterpy.svg)](https://pypi.org/project/msgcenterpy/)
[![PyPI downloads](https://img.shields.io/pypi/dm/msgcenterpy.svg)](https://pypi.org/project/msgcenterpy/)
[![Build Status](https://github.com/ZGCA-Forge/MsgCenterPy/actions/workflows/ci.yml/badge.svg)](https://github.com/ZGCA-Forge/MsgCenterPy/actions)
[![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-brightgreen)](https://zgca-forge.github.io/MsgCenterPy/)
@@ -59,7 +60,25 @@ Please visit: [https://zgca-forge.github.io/MsgCenterPy/](https://zgca-forge.git
## Development
### Development Environment Setup
### Quick Development Setup
For **Linux/macOS**:
```bash
git clone https://github.com/ZGCA-Forge/MsgCenterPy.git
cd MsgCenterPy
./scripts/setup-dev.sh
```
For **Windows**:
```powershell
git clone https://github.com/ZGCA-Forge/MsgCenterPy.git
cd MsgCenterPy
.\scripts\setup-dev.ps1
```
### Manual Development Setup
```bash
git clone https://github.com/ZGCA-Forge/MsgCenterPy.git
@@ -70,6 +89,10 @@ pre-commit install
For API documentation, please refer to Quick Start
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=ZGCA-Forge/MsgCenterPy&type=Date)](https://star-history.com/#ZGCA-Forge/MsgCenterPy&Date)
## License
This project is licensed under Apache-2.0 License - see the [LICENSE](LICENSE) file for details.

View File

@@ -5,7 +5,7 @@ A multi-format message conversion system supporting seamless conversion
between ROS2, Pydantic, Dataclass, JSON, Dict, YAML and JSON Schema.
"""
__version__ = "0.0.3"
__version__ = "0.1.4"
__license__ = "Apache-2.0"
from msgcenterpy.core.envelope import MessageEnvelope, create_envelope

View File

@@ -72,7 +72,7 @@ version = {attr = "msgcenterpy.__version__"}
[tool.black]
line-length = 120
target-version = ['py310']
target-version = ['py310', 'py311', 'py312']
[tool.isort]
profile = "black"