Skip to main content

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

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

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_ioc-3.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

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

Hashes for simple_ioc-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61de2038895cb393831b13dd24eedd1de08c0d1ac9f1720c2cea22314467248d
MD5 51b2496216661318d77b3bd4c428f361
BLAKE2b-256 a6267d3655198a871765bb0dfa6271c6f7a95c19aefe594fb1fa7514774a93cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page