diff --git a/.github/workflows/testing.yml b/.github/workflows/pipeline.yml similarity index 75% rename from .github/workflows/testing.yml rename to .github/workflows/pipeline.yml index e8f49a4..123f47a 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/pipeline.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - '**' pull_request: branches: - main @@ -13,6 +15,7 @@ permissions: jobs: ruff: + name: "Ruff Linting" runs-on: ubuntu-latest steps: - name: Check out repository @@ -41,6 +44,7 @@ jobs: pytest: runs-on: ubuntu-latest + name: "Pytest Tests" steps: - name: Check out repository uses: actions/checkout@v4 @@ -65,3 +69,25 @@ jobs: with: folder: badges/ clean: false + + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + needs: [ ruff, pytest ] + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + environment: + name: pypi + url: https://pypi.org/p/python-injector-framework + permissions: + id-token: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Setup Poetry + uses: ./.github/actions/setup-poetry + - name: Build Project + run: | + source .venv/bin/activate + poetry build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d796693 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,27 @@ +# Change Log + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/) +and this project adheres to [Semantic Versioning](http://semver.org/). + +## [v0.0.0] - 2024-06-03 + +Pre Release! ๐Ÿš€ + +### Added + +- Wiring via `@wiring.inject` or `wiring.wire()` +- Providers for injection + - BlankProvider + - ExistingSingleton + - Singleton + - Factory +- Overriding providers with context managers +- Simple service example to examples/ + +### Changed + +### Fixed + +### Closes diff --git a/README.md b/README.md index 2a54648..ee1b33f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ A simple Python dependency injection framework. **This project is under active development. The following example does not represent the final state for the project.** +You can install this project from pypi. + +```shell +pip install python-injection-framework +``` + ### Dependency Injection The injection framework is configured to inject any default values for method arguments that are instances @@ -122,6 +128,32 @@ if __name__ == "__main__": If you would like to see more examples, feel free to check out [examples/](examples). +## Contributing + +1. Clone the repository and configure Poetry ๐Ÿช„ + + ```shell + git clone git@github.com:scottzach1/Python-Injection-Framework.git + cd Python-Injection-Framework + poetry install + ``` + +2. Configure pre-commit hooks ๐Ÿช + + ```shell + pre-commit install + ``` + +3. Write your changes! ๐Ÿ’ป๏ธ + +4. Run test cases ๐Ÿงช + + ```shell + pytest tests/ + ``` + +5. Submit a Pull Request โ†–๏ธ + ## Authors | [![Zac Scott](https://avatars.githubusercontent.com/u/38968222?s=128&v=4)](https://github.com/scottzach1) | diff --git a/pyproject.toml b/pyproject.toml index 3b25500..bc12771 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "injected" +name = "python-injection-framework" version = "0.0.0" description = "Another Python Dependency injector framework." authors = ["Zac Scott "]