Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[flake8]
exclude =
__pycache__,
.git,
.venv,
venv,
docs
ignore = E203,W503
max-line-length = 120
59 changes: 37 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,52 @@
name: Build & Upload Python Package to PYPI production
name: Build & Upload Python Package to PyPI

on:
release:
types: [ created ]
push:
tags:
- '*'
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Install uv 💜
uses: astral-sh/setup-uv@v6

- name: Install and run ruff 🐶
uses: astral-sh/ruff-action@v3

- name: Set up Python 🐍
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
python-version: "3.13"

- name: Install dependencies 📦
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
uv sync --all-groups --frozen

- name: Lint with flake8 ❄️
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src/ --config=flake8.cfg
- name: Test with pytest
uv run flake8

- name: Test with pytest ✅
run: |
uv run pytest tests

- name: Version replacement based on tag ↔️
if: github.ref_type == 'tag'
run: |
pytest tests
- name: Build and publish
TAG_VERSION=${GITHUB_REF#refs/tags/}
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION

- name: Build and publish 🚀
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
uv build
uv publish
55 changes: 34 additions & 21 deletions .github/workflows/deploy_to_test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
name: Deploy To Test PYPI
name: Build & Upload Python Package To Test PyPI

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Install uv 💜
uses: astral-sh/setup-uv@v6

- name: Install and run ruff 🐶
uses: astral-sh/ruff-action@v3

- name: Set up Python 🐍
uses: actions/setup-python@v4
with:
python-version: '3.11'
skip_existing: true
- name: Install dependencies
python-version: "3.13"

- name: Install dependencies 📦
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
uv sync --all-groups --frozen

- name: Lint with flake8 ❄️
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src/ --config=flake8.cfg
- name: Test with pytest
uv run flake8

- name: Test with pytest ✅
run: |
uv run pytest tests

- name: Version replacement based on tag ↔️
if: github.ref_type == 'tag'
run: |
pytest tests
- name: Build and publish
TAG_VERSION=${GITHUB_REF#refs/tags/}
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION

- name: Build and publish 🚀
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME_TEST }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_TEST }}
UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN_TEST_PYPI }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository testpypi dist/*
uv build
uv publish --index testpypi
39 changes: 27 additions & 12 deletions .github/workflows/push_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,38 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.8", "3.14"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Install uv 💜
uses: astral-sh/setup-uv@v6

- name: Install and run ruff 🐶
uses: astral-sh/ruff-action@v3

- name: Set up Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: Install dependencies 📦
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
- name: Lint with flake8
uv sync --all-groups --frozen

- name: Lint with flake8 ❄️
run: |
uv run flake8

- name: Test with pytest ✅
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src/ --config=flake8.cfg
- name: Test with pytest
uv run pytest tests

- name: Version replacement based on tag ↔️
if: github.ref_type == 'tag'
run: |
pytest tests
TAG_VERSION=${GITHUB_REF#refs/tags/}
echo "Tag version: $TAG_VERSION"
uv version $TAG_VERSION
24 changes: 15 additions & 9 deletions .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Checkout 🛒
uses: actions/checkout@v4

- name: Install uv 💜
uses: astral-sh/setup-uv@v6

- name: Set up Python 🐍
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Create html documentation

- name: Create html documentation 📚
run: |
pip install --user pdoc3
python setup.py install
pdoc --html -f -o .\docs keboola.component
mv .docs/keboola/component/* docs
rm -r .docs/keboola
- name: Commit docs
uv sync --all-groups --frozen
uv run pdoc --html -f -o ./docs keboola.component
mv ./docs/keboola/component/* docs
rm -r ./docs/keboola

- name: Commit docs 📝
run: |
git config --global user.name 'KCF'
git config --global user.email '[email protected]'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Keboola :(){:|:&};: s.r.o.
Copyright (c) 2025 Keboola

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 0 additions & 20 deletions flake8.cfg

This file was deleted.

53 changes: 53 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
[project]
name = "keboola.component"
version = "0.0.0" # replaced by the actual version based on the release tag in github actions
dependencies = [
"pygelf",
"pytz<2021.0",
"deprecated",
]
requires-python = ">=3.8"

authors = [
{ name = "Keboola KDS Team", email = "[email protected]" }
]
description = "General library for Python applications running in Keboola Connection environment"
readme = "README.md"
license = "MIT"
license-files = [ "LICENSE" ]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Education",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Development Status :: 5 - Production/Stable",
]

[project.urls]
Documentation = "https://keboola.github.io/python-component/interface.html"
Repository = "https://github.com/keboola/python-component"
"Component Template project" = "https://github.com/keboola/cookiecutter-python-component"

[dependency-groups]
dev = [
"flake8>=5.0.4",
"pytest>=8.3.5",
"ruff>=0.13.2",
"pdoc3",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

51 changes: 0 additions & 51 deletions setup.py

This file was deleted.

Loading
Loading