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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to