Skip to content

Commit

Permalink
Boilerplate from template
Browse files Browse the repository at this point in the history
  • Loading branch information
aamalev committed Dec 13, 2024
1 parent 3b30c28 commit d6c9bf3
Show file tree
Hide file tree
Showing 9 changed files with 415 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.py]
max_line_length = 120

[*.{yml,yaml}]
indent_size = 2

[*.rst]
indent_size = 2

[Makefile]
indent_style = tab
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: ".github/workflows"
schedule:
interval: "daily"
69 changes: 69 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Tests

on:
push:
branches:
- 'main'
tags: [ '*' ]
pull_request:
branches:
- 'main'

jobs:
tests:
strategy:
max-parallel: 7
matrix:
os:
- ubuntu-22.04
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- pypy-3.9
include:
- os: ubuntu-22.04
python-version: '3.9'
coverage: true
lint: true
- os: macOS-latest
python-version: '3.9'
- os: windows-latest
python-version: '3.9'

runs-on: ${{ matrix.os }}

steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -U hatch
- name: ruff
if: ${{ matrix.lint }}
run: |
hatch run lint:style aioworkers_kafka tests
- name: mypy
if: ${{ matrix.lint }}
run: |
hatch run lint:mypy aioworkers_kafka tests
- name: Tests with coverage
run: |
hatch run cov
- name: coverage.xml
if: ${{ matrix.coverage }}
run: |
hatch run coverage xml
- name: Upload coverage to Codecov
if: ${{ matrix.coverage }}
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
37 changes: 37 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-22.04
environment:
name: PyPI
url: https://pypi.org/project/aioworkers-kafka/${{ github.ref_name }}
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/[email protected]
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade hatch
- name: Build
run: |
hatch version $GITHUB_REF_NAME
hatch build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
- name: Publish
env:
HATCH_INDEX_USER: __token__
HATCH_INDEX_AUTH: ${{ secrets.PYPI_TOKEN }}
run: |
hatch publish
15 changes: 15 additions & 0 deletions .scaraplate.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[cookiecutter_context]
_checkout = None
_repo_dir = cookiecutter-aioworkers-plugin
_template = cookiecutter-aioworkers-plugin
author_email = [email protected]
author_name = Alexander Malev
description = aioworkers plugin for kafka
development_status = Development Status :: 4 - Beta
docs = https://github.com/aioworkers/aioworkers-kafka#readme
git_branch = main
project_name = kafka
project_package = aioworkers_kafka
project_slug = aioworkers-kafka
python_ci = 3.9
python_versions = 3.9,3.10,3.11,3.12,3.13
66 changes: 66 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
aioworkers-kafka
================

.. image:: https://img.shields.io/pypi/v/aioworkers-kafka.svg
:target: https://pypi.org/project/aioworkers-kafka

.. image:: https://github.com/aioworkers/aioworkers-kafka/workflows/Tests/badge.svg
:target: https://github.com/aioworkers/aioworkers-kafka/actions?query=workflow%3ATests

.. image:: https://codecov.io/gh/aioworkers/aioworkers-kafka/branch/master/graph/badge.svg
:target: https://codecov.io/gh/aioworkers/aioworkers-kafka
:alt: Coverage

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v0.json
:target: https://github.com/charliermarsh/ruff
:alt: Code style: ruff

.. image:: https://img.shields.io/badge/types-Mypy-blue.svg
:target: https://github.com/python/mypy
:alt: Code style: Mypy

.. image:: https://readthedocs.org/projects/aioworkers-kafka/badge/?version=latest
:target: https://github.com/aioworkers/aioworkers-kafka#readme
:alt: Documentation Status

.. image:: https://img.shields.io/pypi/pyversions/aioworkers-kafka.svg
:target: https://pypi.org/project/aioworkers-kafka
:alt: Python versions

.. image:: https://img.shields.io/pypi/dm/aioworkers-kafka.svg
:target: https://pypistats.org/packages/aioworkers-kafka

.. image:: https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg
:alt: Hatch project
:target: https://github.com/pypa/hatch


Development
-----------

Check code:

.. code-block:: shell
hatch run lint:all
Format code:

.. code-block:: shell
hatch run lint:fmt
Run tests:

.. code-block:: shell
hatch run pytest
Run tests with coverage:

.. code-block:: shell
hatch run cov
1 change: 1 addition & 0 deletions aioworkers_kafka/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0"
Empty file added aioworkers_kafka/py.typed
Empty file.
Loading

0 comments on commit d6c9bf3

Please sign in to comment.