You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "nitobuendia (via GitHub)" <gi...@apache.org> on 2024/08/28 04:10:39 UTC
[PR] docs: modernize py dependencies docs and example [beam]
nitobuendia opened a new pull request, #32345:
URL: https://github.com/apache/beam/pull/32345
**Please** add a meaningful description for your change here
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn merged PR #32345:
URL: https://github.com/apache/beam/pull/32345
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #32345:
URL: https://github.com/apache/beam/pull/32345#issuecomment-2316413762
R: @tvalentyn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #32345:
URL: https://github.com/apache/beam/pull/32345#issuecomment-2316585123
Closed and reopened to rerun the tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32345:
URL: https://github.com/apache/beam/pull/32345#issuecomment-2314324661
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on code in PR #32345:
URL: https://github.com/apache/beam/pull/32345#discussion_r1735473125
##########
sdks/python/apache_beam/examples/complete/juliaset/pyproject.toml:
##########
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+[project]
+name = "juliaset"
+version = "0.0.1"
+description = "Julia set workflow package."
Review Comment:
let's add [build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
##########
website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md:
##########
@@ -95,43 +95,47 @@ If your pipeline uses packages that are not available publicly (e.g. packages th
Often, your pipeline code spans multiple files. To run your project remotely, you must group these files as a Python package and specify the package when you run your pipeline. When the remote workers start, they will install your package. To group your files as a Python package and make it available remotely, perform the following steps:
-1. Create a [setup.py](https://pythonhosted.org/an_example_pypi_project/setuptools.html) file for your project. The following is a very basic `setup.py` file.
+1. Create a [pyproject.toml](https://packaging.python.org/en/latest/tutorials/packaging-projects/) file for your project. The following is a very basic `pyproject.toml` file.
- import setuptools
+ [project]
Review Comment:
let's add
```
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
```
##########
website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md:
##########
@@ -95,43 +95,47 @@ If your pipeline uses packages that are not available publicly (e.g. packages th
Often, your pipeline code spans multiple files. To run your project remotely, you must group these files as a Python package and specify the package when you run your pipeline. When the remote workers start, they will install your package. To group your files as a Python package and make it available remotely, perform the following steps:
-1. Create a [setup.py](https://pythonhosted.org/an_example_pypi_project/setuptools.html) file for your project. The following is a very basic `setup.py` file.
+1. Create a [pyproject.toml](https://packaging.python.org/en/latest/tutorials/packaging-projects/) file for your project. The following is a very basic `pyproject.toml` file.
- import setuptools
+ [project]
+ name = "PACKAGE-NAME"
+ version = "PACKAGE-VERSION"
+ dependencies = [
+ # List Python packages your pipeline depends on.
+ ]
+
+2. If needed by your environment, create a setup.py file for your project.
- setuptools.setup(
- name='PACKAGE-NAME',
- version='PACKAGE-VERSION',
- install_requires=[
- # List Python packages your pipeline depends on.
- ],
- packages=setuptools.find_packages(),
- )
+ # Note that the package is completely defined by pyproject.toml.
Review Comment:
```suggestion
# Note that the package can be completely defined by pyproject.toml.
```
##########
website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md:
##########
@@ -95,43 +95,47 @@ If your pipeline uses packages that are not available publicly (e.g. packages th
Often, your pipeline code spans multiple files. To run your project remotely, you must group these files as a Python package and specify the package when you run your pipeline. When the remote workers start, they will install your package. To group your files as a Python package and make it available remotely, perform the following steps:
-1. Create a [setup.py](https://pythonhosted.org/an_example_pypi_project/setuptools.html) file for your project. The following is a very basic `setup.py` file.
+1. Create a [pyproject.toml](https://packaging.python.org/en/latest/tutorials/packaging-projects/) file for your project. The following is a very basic `pyproject.toml` file.
- import setuptools
+ [project]
+ name = "PACKAGE-NAME"
+ version = "PACKAGE-VERSION"
+ dependencies = [
+ # List Python packages your pipeline depends on.
+ ]
+
+2. If needed by your environment, create a setup.py file for your project.
Review Comment:
```suggestion
2. If your package requires if some programmatic configuration, or you need to use the `--setup_file` pipeline option, create a setup.py file for your project.
```
##########
website/www/site/content/en/documentation/sdks/python-pipeline-dependencies.md:
##########
@@ -95,43 +95,47 @@ If your pipeline uses packages that are not available publicly (e.g. packages th
Often, your pipeline code spans multiple files. To run your project remotely, you must group these files as a Python package and specify the package when you run your pipeline. When the remote workers start, they will install your package. To group your files as a Python package and make it available remotely, perform the following steps:
-1. Create a [setup.py](https://pythonhosted.org/an_example_pypi_project/setuptools.html) file for your project. The following is a very basic `setup.py` file.
+1. Create a [pyproject.toml](https://packaging.python.org/en/latest/tutorials/packaging-projects/) file for your project. The following is a very basic `pyproject.toml` file.
- import setuptools
+ [project]
+ name = "PACKAGE-NAME"
+ version = "PACKAGE-VERSION"
+ dependencies = [
+ # List Python packages your pipeline depends on.
+ ]
+
+2. If needed by your environment, create a setup.py file for your project.
- setuptools.setup(
- name='PACKAGE-NAME',
- version='PACKAGE-VERSION',
- install_requires=[
- # List Python packages your pipeline depends on.
- ],
- packages=setuptools.find_packages(),
- )
+ # Note that the package is completely defined by pyproject.toml.
+ # This file is optional.
+ import setuptools
+ setuptools.setup()
-2. Structure your project so that the root directory contains the `setup.py` file, the main workflow file, and a directory with the rest of the files, for example:
+3. Structure your project so that the root directory contains the `pyproject.toml`, the `setup.py` file, and a `src/` directory with the rest of the files. For example:
root_dir/
+ pyproject.toml
setup.py
- main.py
- my_package/
- my_pipeline_launcher.py
- my_custom_dofns_and_transforms.py
- other_utils_and_helpers.py
+ src/
+ main.py
+ my_package/
+ my_pipeline_launcher.py
+ my_custom_dofns_and_transforms.py
+ other_utils_and_helpers.py
See [Juliaset](https://github.com/apache/beam/tree/master/sdks/python/apache_beam/examples/complete/juliaset) for an example that follows this project structure.
-3. Install your package in the submission environment, for example by using the following command:
+4. Install your package in the submission environment, for example by using the following command:
pip install -e .
-4. Run your pipeline with the following command-line option:
+5. Run your pipeline with the following command-line option:
Review Comment:
If you use a custom container (link to {#custom-containers} ), copy and install the package in the container as well. Otherwise, run your pipeline with the following command-line option:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32345:
URL: https://github.com/apache/beam/pull/32345#issuecomment-2316414659
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment `assign set of reviewers`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] docs: modernize py dependencies docs and example [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn closed pull request #32345: docs: modernize py dependencies docs and example
URL: https://github.com/apache/beam/pull/32345
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org