root/meisheng/: ms-common-1.4.14 metadata and description

Simple index

Shared utilities for Mei Sheng Textiles applications

author_email Mei Sheng Textiles Development Team <dev@meisheng.group>
classifiers
  • Development Status :: 5 - Production/Stable
  • Intended Audience :: Developers
  • License :: Other/Proprietary License
  • Operating System :: OS Independent
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.11
  • Programming Language :: Python :: 3.12
  • Framework :: FastAPI
  • Topic :: Software Development :: Libraries :: Python Modules
description_content_type text/markdown
keywords fastapi, microservices, textiles, manufacturing
license Proprietary
project_urls
  • Homepage, https://gitea.dev.meisheng.group/Mei_Sheng_Textiles/ms_common_python
  • Bug Reports, https://gitea.dev.meisheng.group/Mei_Sheng_Textiles/ms_common_python/issues
  • Source, https://gitea.dev.meisheng.group/Mei_Sheng_Textiles/ms_common_python
requires_dist
  • fastapi>=0.100.0
  • httpx>=0.24.0
  • sqlalchemy>=2.0.0
  • pydantic>=2.0.0
  • python-multipart>=0.0.6
  • faststream>=0.5.30
  • pytest>=7.0.0; extra == "dev"
  • pytest-cov>=4.0.0; extra == "dev"
  • pytest-asyncio>=0.21.0; extra == "dev"
  • pytest-mock>=3.10.0; extra == "dev"
  • black>=23.0.0; extra == "dev"
  • isort>=5.12.0; extra == "dev"
  • flake8>=6.0.0; extra == "dev"
  • mypy>=1.0.0; extra == "dev"
  • psycopg2-binary>=2.9.0; extra == "postgres"
  • asyncpg>=0.28.0; extra == "postgres"
  • python-consul>=1.1.0; extra == "consul"
  • faststream[kafka]>=0.5.30; extra == "messaging"
  • sentry-sdk[fastapi]>=2.0.0; extra == "telemetry"
  • posthog>=3.0.0; extra == "telemetry"
requires_python >=3.11

Because this project isn't in the mirror_whitelist, no releases from root/pypi are included.

File Tox results History
ms_common-1.4.14-py3-none-any.whl
Size
143 KB
Type
Python Wheel
Python
3
ms_common-1.4.14.tar.gz
Size
126 KB
Type
Source

MS Common Python Package

Shared utilities and services for Mei Sheng Textiles dye house applications.

Installation

# From internal PyPI (preferred)
pip install ms-common --index-url https://pypi.dev.meisheng.group/simple/

# With optional extras
pip install ms-common[messaging]   # Kafka via FastStream
pip install ms-common[consul]      # Consul service discovery
pip install ms-common[postgres]    # PostgreSQL support

Features

Quick Start

API Key Service

from ms_common import create_api_key_service

# PostgreSQL (DH_Production_Manager)
service = create_api_key_service('postgres',
    session_factory=get_async_session,
    user_model=User, api_key_model=ApiKey)

# SQLite (MS_QC_DB)
service = create_api_key_service('sqlite', db_path='/app/data/api_keys.db')

# Config-based (dye_process_manager)
service = create_api_key_service('config', config_keys={'admin': 'key123'})

key_info = await service.validate_api_key(api_key)

Kafka Messaging

from ms_common.messaging.kafka import create_kafka_producer, create_kafka_consumer

# Producer
producer = create_kafka_producer(config)
await producer.send("quality.events", event)

# Consumer
consumer = create_kafka_consumer(config, topics=["quality.events"])
async with consumer.consuming_context():
    async for msg in consumer.get_messages(timeout=10.0):
        handle(msg)

Health Check Endpoints

from fastapi import FastAPI
from ms_common.monitoring.endpoints import create_monitoring_router

app = FastAPI()
app.include_router(create_monitoring_router("my-service"), prefix="/api/v1/monitoring")

Development

git clone ssh://git@gitea.dev.meisheng.group:2222/Mei_Sheng_Textiles/ms_common_python.git
cd ms_common_python
uv sync --all-extras
uv run pytest

Versioning

Version is defined once in pyproject.toml. At runtime, ms_common.__version__ reads it via importlib.metadata -- there is nothing to keep in sync.

Publishing to PyPI

Use upload.py to build and publish. It talks directly to the pypicloud REST API (no twine dependency, no shell escaping issues).

# Build and upload the current version
uv run python upload.py

# Bump version first (updates pyproject.toml, then builds + uploads)
uv run python upload.py --bump patch   # 1.3.8 -> 1.3.9
uv run python upload.py --bump minor   # 1.3.8 -> 1.4.0
uv run python upload.py --bump major   # 1.3.8 -> 2.0.0

# Build without uploading
uv run python upload.py --build-only

# List all published versions
uv run python upload.py --list

# Delete a broken version
uv run python upload.py --delete 1.2.0

License

Internal use only -- Mei Sheng Textiles Ltd.