Skip to content

Commit

Permalink
feat(setuptools): 🚀 re-introduce pyproject.toml with setuptools
Browse files Browse the repository at this point in the history
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
  • Loading branch information
onuralpszr committed Oct 1, 2023
1 parent d33c176 commit c88ab30
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 48 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install poetry for Python ${{ matrix.python-version }}
run: python -m pip install --upgrade poetry
- name: Install setuptools for Python ${{ matrix.python-version }}
run: python -m pip install --upgrade setuptools


- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache: 'pip'

- name: Setup an environment for Python ${{ matrix.python-version }}
run: poetry install
run: pip install ".[dev]"

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test
run: |
poetry run kfk
cd tests && poetry run pytest
kfk
cd tests && pytest
- name: Build
run: |
poetry run python -m build
poetry run twine check --strict dist/*
python -m build
twine check --strict dist/*
78 changes: 40 additions & 38 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
[tool.poetry]
[project]
name = "strimzi-kafka-cli"
version = "0.1.0-alpha68"
description = "Command Line Interface for Strimzi Kafka Operator"
authors = ["Aykut Bulgu <aykut@systemcraftsman.com>"]
maintainers = ["Aykut Bulgu <aykut@systemcraftsman.com>"]
authors = [{ name = "Aykut Bulgu", email = "aykut@systemcraftsman.com" }]
readme = "README.md"
license = "Apache-2.0"
packages = [{include = "kfk"}]
homepage = "https://github.com/systemcraftsman/strimzi-kafka-cli"
repository = "https://github.com/systemcraftsman/strimzi-kafka-cli"
documentation = "https://github.com/systemcraftsman/strimzi-kafka-cli/blob/main/README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.8,<3.12.0"
keywords = ["kafka", "strimzi", "cli", "operator", "kubernetes", "k8s", "openshift","apache-kafka"]

classifiers=[
Expand All @@ -29,29 +25,42 @@ classifiers=[
'Operating System :: MacOS'
]

[tool.poetry.urls]
Tracker = "https://github.com/systemcraftsman/strimzi-kafka-cli/issues"
dependencies = [
"click == 8.0.1",
"pyyaml",
"wget",
"jproperties"
]

[tool.poetry.dependencies]
python = ">=3.8,<3.12.0"
click = "8.0.1"
pyyaml = "^6.0.1"
wget = "^3.2"
jproperties = "^2.1.1"
[project.optional-dependencies]
dev = [
"twine",
"flake8",
"flake8-pyproject",
"pytest",
"wheel",
"build",
"ruff",
"isort",
"black",
"mypy",
"pre-commit",
"bandit",
"autoflake"
]

[tool.urls]
Tracker = "https://github.com/systemcraftsman/strimzi-kafka-cli/issues"
Homepage = "https://github.com/systemcraftsman/strimzi-kafka-cli"
Repository = "https://github.com/systemcraftsman/strimzi-kafka-cli"
Documentation = "https://github.com/systemcraftsman/strimzi-kafka-cli/blob/main/README.md"


[tool.poetry.group.dev.dependencies]
twine = "^4.0.2"
pytest = "^7.4.2"
wheel = "^0.40.0"
build = "^0.10.0"
ruff = "^0.0.280"
isort = "^5.12.0"
black = "^23.7.0"
mypy = "^1.4.1"
pre-commit = "^3.3.3"
flake8 = { version = "*", python = ">=3.8.1,<3.12.0" }
flake8-pyproject = "^1.2.3"
[tool.setuptools]
package-dir = {"kfk" = "kfk"}
include-package-data = true
license-files = ["LICENSE"]
zip-safe = true


[tool.flake8]
Expand Down Expand Up @@ -102,16 +111,9 @@ exclude = '''
'''


[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
exclude = ["docs*", "test*","examples"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.poetry.scripts]
[project.scripts]
kfk = "kfk.main:kfk"

0 comments on commit c88ab30

Please sign in to comment.