Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: pip install -r requirements.txt
- run: pip install --group lint -e .
- run: pre-commit run --all-files
- run: mypy kopf --strict
- run: |
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- run: pip install -r requirements.txt
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt-dev
- run: pip install --upgrade pip wheel setuptools

- run: pip install -r requirements.txt
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2 --no-cov
Expand All @@ -117,7 +117,7 @@ jobs:
with:
version: ${{ matrix.k3s }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: pip install -r requirements.txt -r examples/requirements.txt
- run: pip install --group test -e . -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e

coveralls-finish:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: pip install --upgrade pip setuptools wheel twine
- run: python setup.py sdist bdist_wheel
- run: pip install --upgrade pip build
- run: python -m build # includes sdist & wheel by default
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
10 changes: 5 additions & 5 deletions .github/workflows/thorough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: "3.13"
- run: pip install -r requirements.txt
- run: pip install --group lint -e .
- run: pre-commit run --all-files
- run: mypy kopf --strict
- run: |
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- run: pip install -r requirements.txt
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- run: sudo apt-get update && sudo apt-get install libxml2-dev libxslt-dev
- run: pip install --upgrade pip wheel setuptools

- run: pip install -r requirements.txt
- run: pip install --group test -e .
- run: pip install -e .[${{ matrix.install-extras }}]
if: ${{ matrix.install-extras }}
- run: pytest --color=yes --timeout=2 --no-cov
Expand All @@ -121,7 +121,7 @@ jobs:
with:
version: ${{ matrix.k3s }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: pip install -r requirements.txt -r examples/requirements.txt
- run: pip install --group test -e . -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e

full-scale:
Expand All @@ -140,7 +140,7 @@ jobs:
with:
python-version: "3.13"
- run: tools/install-minikube.sh
- run: pip install -r requirements.txt -r examples/requirements.txt
- run: pip install --group test -e . -r examples/requirements.txt
- run: pytest --color=yes --timeout=30 --only-e2e

coveralls-finish:
Expand Down
11 changes: 0 additions & 11 deletions .isort.cfg

This file was deleted.

8 changes: 4 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ build:
os: ubuntu-24.04
tools:
python: "3"
python:
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
jobs:
install:
- pip install --upgrade pip
- pip install --group docs -e .
sphinx:
configuration: docs/conf.py
builder: "dirhtml"
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) 2020 Sergey Vasilyev <[email protected]>
Copyright (c) 2020-2025 Sergey Vasilyev <[email protected]>
Copyright (c) 2019-2020 Zalando SE

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
7 changes: 0 additions & 7 deletions docs/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ kubectl apply -f crd.yaml
Also, some libraries are needed for some operators and handlers:

```bash
pip install -r requirements.txt
pip install --group test -e .
```
4 changes: 3 additions & 1 deletion kopf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
Logger,
)
from kopf._cogs.helpers.versions import (
version as __version__,
__version__,
__version_tuple__,
__commit_id__,
)
from kopf._cogs.structs.bodies import (
RawEventType,
Expand Down
2 changes: 2 additions & 0 deletions kopf/_cogs/helpers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto-generated by setuptools-scm on builds & pip install. Configured in pyproject.toml.
versions.py
22 changes: 0 additions & 22 deletions kopf/_cogs/helpers/versions.py

This file was deleted.

3 changes: 0 additions & 3 deletions mypy.ini

This file was deleted.

128 changes: 128 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
[build-system]
requires = ["setuptools", "setuptools-scm>=8.1"]
build-backend = "setuptools.build_meta"

[project]
name = "kopf"
description = "Kubernetes Operator Pythonic Framework (Kopf)"
keywords = ["kubernetes", "operator", "framework", "python", "k8s"]
authors = [{name = "Sergey Vasilyev", email = "[email protected]"}]
maintainers = [{name = "Sergey Vasilyev", email = "[email protected]"}]
license = "MIT"
readme = "README.md"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.10"
dependencies = [
"python-json-logger", # 0.05 MB
"iso8601", # 0.07 MB
"pyyaml", # 0.90 MB
"click>=8.2.0", # 0.60 MB
"aiohttp", # 7.80 MB
"aiohttp>=3.9.0; python_version >= '3.12'",
]
dynamic = ["version"] # taken from git tags

[project.urls]
homepage = "https://github.com/nolar/kopf"
repository = "https://github.com/nolar/kopf"
documentation = "https://kopf.readthedocs.io"

[project.scripts]
kopf = "kopf.cli:main"

[project.optional-dependencies]
full-auth = [
"pykube-ng", # 4.90 MB
"kubernetes", # 40.0 MB (!)
]
uvloop = [
"uvloop", # 9.00 MB
"uvloop>=0.18.0; python_version>='3.12'",
]
dev = [
# NB: oscrypto is pinned for Ubuntu 24.04+ in dependency-group - read the details there.
"oscrypto", # 2.80 MB (smaller than cryptography: 8.7 MB)
"certbuilder", # +0.1 MB (2.90 MB if alone)
"certvalidator", # +0.1 MB (2.90 MB if alone)
"pyngrok", # 1.00 MB + a downloaded binary
]

[dependency-groups]
docs = [
"sphinx>=2.0.0",
"sphinx-autobuild",
"sphinx-autodoc-typehints",
"sphinx_rtd_theme>=0.5",
]
test = [
"aresponses",
"astpath[xpath]",
"certbuilder",
"certvalidator",
"codecov",
"coverage",
"coveralls",
"freezegun",
"lxml",
"pyngrok",
"pytest>=6.0.0",
"pytest-aiohttp",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"pytest-timeout",
"types-pyyaml",
"types-setuptools",

# Enforce the hotfix for Ubuntu 24.04 in CI. Otherwise, we are stuck in Ubuntu 22.04.
# The bugfix is merged but not released: https://github.com/wbond/oscrypto/issues/78
# Pinning this in the final operators is the decision of the operator developers,
# including the protocols of accessing the repo or vendoring the dependency code.
# The dev-mode dependency is used ONLY with a temporary insecure self-signed CA for simplicity,
# and ONLY with Ubuntu 24.04+. Therefore, it is not pinned in the main dependencies (e.g., works fine in 22.04).
# In the worst case, configure the operator with a self-signed CA made in the OpenSSL CLI.
"oscrypto @ git+https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3",
]
lint = [
{include-group = "test"},
"mypy==1.19.0",
"import-linter",
"isort",
"pre-commit",
]

[tool.setuptools_scm]
version_file = "kopf/_cogs/helpers/versions.py"

[tool.mypy]
warn_unused_configs = true
ignore_missing_imports = true

[tool.pytest]
minversion = "9.0"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
addopts = ["--strict-markers"]

[tool.isort]
line_length = 100
multi_line_output = 11
balanced_wrapping = true
combine_as_imports = true
case_sensitive = true
known_first_party = ["kopf"]
filter_files = true
skip_glob = ["examples/*.py"]
5 changes: 0 additions & 5 deletions pytest.ini

This file was deleted.

35 changes: 0 additions & 35 deletions requirements.txt

This file was deleted.

Loading
Loading