A lightweight library with an implementation of IoC
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
Simple IoC
Install
pipenv install simple-ioc
or
pip install simple-ioc
Usage
In order to have the IoC (Inversion of Control) working in your application, you must register your services in the IoC container:
from simple_ioc import Container
class AService:
# Your service implementation comes here
Container().register('an_identifier', lambda: AService())
Then, from any point in your application, you can retrieve the service by calling get:
a_service = Container().get('an_identifier')
Publishing to PyPI
Follow these steps to publish a new version of the package to PyPI:
-
Update the version number in
setup.py -
Install build tools (if not already installed):
pip install build twine
-
Build the distribution packages:
python -m build
This creates both source distribution (.tar.gz) and wheel (.whl) in the
dist/directory. -
Verify the build:
twine check dist/*
-
Upload to PyPI using twine:
twine upload dist/*
Note: Use an API token instead of username/password. Configure it in
~/.pypirc:[pypi] username = __token__ password = pypi-YOUR-API-TOKEN-HERE
-
Clean up the build artifacts (optional):
rm -rf build/ dist/ *.egg-info/
Best Practices
-
Use version tags: After publishing, tag the release in git:
git tag -a X.Y.Z -m "Release X.Y.Z" git push origin --tags
Prerequisites
- You need a PyPI account with the appropriate permissions to upload this package
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 simple_ioc-3.2.0-py3-none-any.whl.
File metadata
- Download URL: simple_ioc-3.2.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61de2038895cb393831b13dd24eedd1de08c0d1ac9f1720c2cea22314467248d
|
|
| MD5 |
51b2496216661318d77b3bd4c428f361
|
|
| BLAKE2b-256 |
a6267d3655198a871765bb0dfa6271c6f7a95c19aefe594fb1fa7514774a93cd
|