Common utilities and shared code for PRS microservices
Project description
PRS Commons
A Python library containing common utilities and shared code for PRS microservices.
Installation
From Source (Development)
For development, clone and install in editable mode:
git clone https://<token>@github.com/IshaFoundationIT/prs-facade-common.git
cd prs-facade-common
pip install -e ".[dev]" # Install with development dependencies
From Private Package Repository
Add your private package repository to pip configuration and install:
# Configure pip to use your private repository
pip config set global.extra-index-url https://your.private.registry.com/simple/
# Install the package
pip install prs-commons
Usage
from prs_commons import MyClass
# Create an instance
obj = MyClass("User")
# Use the instance
print(obj.greet()) # Output: Hello, User!
# Get version
print(f"Library version: {MyClass.version()}")
Development
Prerequisites
- Python 3.11+
- Poetry (recommended) or pip
Setup
-
Clone the repository:
git clone https://<token>@github.com/IshaFoundationIT/prs-facade-common.git cd prs-facade-common
-
Install dependencies:
# Using Poetry poetry install --with dev # Or using pip pip install -e ".[dev]"
-
Install pre-commit hooks:
pre-commit install
Running Tests
# Run all tests
pytest
# Run with coverage report
pytest --cov=prs_commons --cov-report=term-missing
Publishing New Versions
Prerequisites
-
Set up your
~/.pypircfile with your GitHub token:[distutils] index-servers = github [github] repository = https://upload.pypi.org/legacy/ username = __token__ password = your_github_token_here
Replace
your_github_token_herewith a GitHub Personal Access Token withwrite:packagesscope. -
Update the version in
pyproject.toml -
Build the package:
python -m build
-
Publish to GitHub Package Registry:
python -m twine upload --repository github dist/*
Installing from GitHub Package Registry
-
Create a personal access token with
read:packagesscope -
Configure pip to use your token:
pip install --index-url https://USERNAME:TOKEN@pkgs.dev.azure.com/ORGANIZATION/PROJECT/_packaging/REPOSITORY/pypi/simple/ --no-deps PACKAGE_NAME
Or add to your
pip.conf:[global] extra-index-url = https://USERNAME:TOKEN@pkgs.dev.azure.com/ORGANIZATION/PROJECT/_packaging/REPOSITORY/pypi/simple/
Contributing
- Create a feature branch
- Make your changes
- Run tests and pre-commit checks
- Submit a pull request
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prs_commons-0.1.0.tar.gz.
File metadata
- Download URL: prs_commons-0.1.0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fd6f4cefe2543120aa54878ec7f1696e7722928ca0b0e7b93e870d5e2e337cb
|
|
| MD5 |
f64029af54994569a0b511dca8d69b89
|
|
| BLAKE2b-256 |
80648c1430acd08c7890cfd8f25594e2852fa18a26261cd04e26c0d9fe16ef45
|
File details
Details for the file prs_commons-0.1.0-py3-none-any.whl.
File metadata
- Download URL: prs_commons-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
317d9ebf7e9ee254ff583329479e8ba77e0ff901a062f61861cacff4d006167f
|
|
| MD5 |
3d1a58eeefdb520e332ddea1c20ca3d8
|
|
| BLAKE2b-256 |
dfc3f674814ffdea2338f3347b04464f04ca7739ce2336a795bcd218b59b4753
|