Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

agroptima/simple-ioc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple IoC

Build Status License GPLv3 Python versions

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:

  1. Update the version number in setup.py

  2. Install build tools (if not already installed):

    pip install build twine
  3. Build the distribution packages:

    python -m build

    This creates both source distribution (.tar.gz) and wheel (.whl) in the dist/ directory.

  4. Verify the build:

    twine check dist/*
  5. 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
  6. 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

About

A simple implementation of IoC

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages