Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Radko committed Jun 7, 2024
0 parents commit 7cda3f7
Show file tree
Hide file tree
Showing 40 changed files with 1,688 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.bumpversion]
current_version = "0.0.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
commit_args = ""
[[tool.bumpversion.files ]]
filename = "./django_kafka/__init__.py"
88 changes: 88 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Test

on:
- push
- pull_request

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.12"
django:
- "4.0"
- "4.1"
- "4.2"
- "5.0"
exclude:
- python-version: "3.11"
django: "4.0"
- python-version: "3.12"
django: "4.0"
- python-version: "3.12"
django: "4.1"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install Django 3.2
if: matrix.django == 3.2
run: pip install "Django>=3.2"
- name: Install Django 4.0
if: matrix.django == 4.0
run: pip install "Django>=4.0"
- name: Install Django 4.1
if: matrix.django == 4.1
run: pip install "Django>=4.1"
- name: Install Django 4.2
if: matrix.django == 4.2
run: pip install "Django>=4.2"
- name: Install Django 5.0
if: matrix.django == 5.0
run: pip install "Django>=5.0"

- name: Install Django ${{ matrix.django }}
run: pip install -r requirements-ci.txt

- name: Install package
run: pip install -e .

- name: Run tests
run: python ./example/manage.py test

publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install req packages
run: python -m pip install -U setuptools build

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel

- name: Publish Package on PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.pyc
.idea/
.pycharm_helpers/
.ipython/
dist/
*.egg-info/
build/
*.sw*
.coverage
.bash_history
db.sqlite3
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.12

ENV PYTHONUNBUFFERED 1
ENV LC_ALL=C.UTF-8

RUN useradd -m app

USER app
WORKDIR /app

ADD ./example/requirements.txt /app/example/
ADD ./requirements-ci.txt /app/

ENV PATH /home/app/venv/bin:$PATH

RUN python3 -m venv ~/venv && \
pip install -r ./example/requirements.txt

ADD . /app/

ENV DJANGO_SETTINGS_MODULE conf.settings
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 RegioHelden GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include LICENSE README.md
recursive-include django_kafka/ *
Loading

0 comments on commit 7cda3f7

Please sign in to comment.