This is an automated email from the ASF dual-hosted git repository.
sxnan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/flink-agents.git
The following commit(s) were added to refs/heads/main by this push:
new ea7cc41 [build] Improve the building process to favor uv and
pyproject (#140)
ea7cc41 is described below
commit ea7cc41e73f16f29e91577fc2cbf821d2bb53d4f
Author: Xuannan <[email protected]>
AuthorDate: Thu Sep 4 14:09:40 2025 +0800
[build] Improve the building process to favor uv and pyproject (#140)
---
README.md | 39 +++++++++++-------------
python/pyproject.toml | 47 +++++------------------------
python/requirements/all_requirements.txt | 17 -----------
python/requirements/build_requirements.txt | 15 ---------
python/requirements/linter_requirements.txt | 15 ---------
python/requirements/test_requirements.txt | 19 ------------
6 files changed, 24 insertions(+), 128 deletions(-)
diff --git a/README.md b/README.md
index 9dad0a3..2e84a21 100644
--- a/README.md
+++ b/README.md
@@ -29,45 +29,40 @@ mvn clean install -DskipTests
### Python Build
-#### Using uv (Recommended)
-
-Firstly, install uv and build dependencies:
+#### Using uv (Recommended) — Build and Install
```shell
-pip install uv
cd python
-uv sync --extra build
-```
-Then build the package:
+# Install uv (fast Python package manager)
+pip install uv
-```shell
+# Create env and install build dependencies
+uv sync --extra build
+
+# Build sdist and wheel into python/dist/
uv run python -m build
+
+# Install the built wheel into the environment
+uv pip install dist/*.whl
```
-#### Using pip (Traditional)
-Alternatively, you can use traditional pip:
+#### Using pip (Alternative) — Build and Install
```shell
cd python
-pip install -e .[build]
-python -m build
-```
-The sdist and wheel package of flink-agents will be found under
`./python/dist/`. Either of them could be
-used for installation:
+# Install project (editable) with 'build' extra/tools
+pip install -e .[build]
-```shell
-# Using uv
-uv pip install python/dist/*.whl
+# Build sdist and wheel into python/dist/
+python -m build
-# Using pip
-python -m pip install python/dist/*.whl
+# Install the built wheel into the environment
+python -m pip install dist/*.whl
```
-> **Note**: The `requirements/*.txt` files are deprecated. Please use the
modern `pyproject.toml`
-> dependency groups. See
[python/MIGRATION_GUIDE.md](python/MIGRATION_GUIDE.md) for details.
## How to Contribute
diff --git a/python/pyproject.toml b/python/pyproject.toml
index d8c7ffd..8ba7b83 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -40,7 +40,6 @@ classifiers = [
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
- 'Programming Language :: Python :: 3.12',
]
dependencies = [
@@ -57,43 +56,28 @@ dependencies = [
[project.optional-dependencies]
# Development dependencies - includes all tools needed for development
dev = [
- "build",
- "ruff==0.11.13",
- "pytest==8.4.0",
- "wheel",
- "setuptools>=75.3",
+ "flink-agents[build]",
+ "flink-agents[lint]",
+ "flink-agents[test]",
]
# Build dependencies - tools needed for building the package
build = [
"build",
- "wheel",
- "setuptools>=75.3",
]
-# Linting dependencies - code quality tools
-lint = [
- "ruff==0.11.13",
-]
-
-# Testing dependencies - tools needed for running tests
+# Test dependencies
test = [
"pytest==8.4.0",
- "wheel",
- "setuptools>=75.3",
]
-# All dependencies - convenience group that includes everything
-all = [
- "build",
+# Lint dependencies
+lint = [
"ruff==0.11.13",
- "pytest==8.4.0",
- "wheel",
- "setuptools>=75.3",
]
[tool.cibuildwheel]
-build = ["cp39-*", "cp310-*", "cp311-*", "cp312-*"]
+build = ["cp39-*", "cp310-*", "cp311-*"]
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
@@ -101,23 +85,6 @@ archs = ["x86_64", "arm64"]
[tool.cibuildwheel.linux]
archs = ["x86_64"]
-# uv configuration
-[tool.uv]
-# Use uv for dependency resolution and virtual environment management
-dev-dependencies = [
- "build",
- "ruff==0.11.13",
- "pytest==8.4.0",
- "wheel",
- "setuptools>=75.3",
-]
-
-# Override problematic dependencies for Python 3.12 compatibility
-override-dependencies = [
- "pemja>=0.4.2; python_version>='3.12'",
- "numpy>=1.25.0; python_version>='3.12'",
-]
-
# Configure uv workspace (if needed for multi-package projects)
[tool.uv.workspace]
# Currently a single package project, but ready for workspace expansion
diff --git a/python/requirements/all_requirements.txt
b/python/requirements/all_requirements.txt
deleted file mode 100644
index 3ea6b66..0000000
--- a/python/requirements/all_requirements.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
--r build_requirements.txt
--r linter_requirements.txt
--r test_requirements.txt
\ No newline at end of file
diff --git a/python/requirements/build_requirements.txt
b/python/requirements/build_requirements.txt
deleted file mode 100644
index 80a5f80..0000000
--- a/python/requirements/build_requirements.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-build
\ No newline at end of file
diff --git a/python/requirements/linter_requirements.txt
b/python/requirements/linter_requirements.txt
deleted file mode 100644
index f735997..0000000
--- a/python/requirements/linter_requirements.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-ruff==0.11.13
diff --git a/python/requirements/test_requirements.txt
b/python/requirements/test_requirements.txt
deleted file mode 100644
index 52a14f7..0000000
--- a/python/requirements/test_requirements.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-wheel
-setuptools>=75.3
-pytest==8.4.0
-pydantic==2.11.4
-apache-flink==1.20.1