Skip to content

Commit

Permalink
Configure publishing (#2)
Browse files Browse the repository at this point in the history
* Add debug condition

* Add pyproject.toml

* Try pypi user

* Add build module to dev image

* Add twin to dev image

* Change package name

* Use twine in publish script

* Prepare first tag release
  • Loading branch information
samizdam authored Jan 29, 2023
1 parent 19daecd commit 817b22a
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install build twine
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

# python local artifacts
*/__pycache__/*
*/*.egg-info/*
/dist/

# local env artifacts
/.env
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.2.0] - 2023-01-29

### Added

- Added DI class


[unreleased]: https://github.com/free-elephants/python-di/compare/0.2.0...HEAD
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ FROM python:3.11-alpine
RUN pip install --upgrade pip \
&& pip install \
black \
build \
coverage \
pylint \
pylint-quotes
pylint-quotes \
twine

# End dev dependencies

Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ PATH := $(shell pwd)/bin:$(PATH)
$(shell cp -n dev.env .env)
include .env

install: build
#pip install -r requirements.pip
install: docker-build

build:
build: docker-build
python -m build

docker-build:
docker build -t "$(PYTHON_DEV_IMAGE):$(REVISION)" .

test:
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# python-di
# fe-python-di

Simple python dependency injection implementation.

```bash
pip install fe-python-di
```

```python
from di import DI

di = DI()

# set preconfigured component to container
di[InjectedService] = InjectedService()

# get instance by type name
some_service: SomeYourComponentName = di.get(SomeYourComponentName)
```

Simple python dependency injection implementation

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[project]
name = "fe-python-di"
description = "Simple python dependency injection"
version = "0.1.1"
authors = [
{ name = "samizdam", email = "samizdam@inbox.ru" }
]

0 comments on commit 817b22a

Please sign in to comment.