Skip to content

Commit a94d29f

Browse files
authored
Add pyproject.toml (#28385)
* Add pyproject.toml Update numpy bounds * Use subprocess to run grpcio since it is not imported in pyproject.toml Update setup.py Remove ImportError from gen_protos.py Update subprocess run and raise RuntimeError if proto generation fails Print output of setup.py Fix linting issues * Remove build-requirements.txt and use build to build the sdist Modify buildPython task * Use wheels to run tox precommit tests Upgrade pip in Dockerfile Move _ELEMENTS to shared file. tests are not importable by each other Add missing element Remove shared_test_variables Remove installing wheel in a test suite Retry run_tox.sh with no installPkg flag Remove natural language test. codepath is covered in the postCommits. Add back tox exit code * Remove cython tests. default tests will run with Cython extensions FIx toxTask name Add no-extra test suite to precommit and remove GH duplicate ubuntu test Skip failing non-cython test Fix tox test name * Force type cast inputs to list * Update stager to use build. If it fails, use legacy setup to build sdist Fix mypy issue * Remove cython env and build-requirements for tox.ini
1 parent 3e066e3 commit a94d29f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+268
-286
lines changed

.github/workflows/beam_PreCommit_Python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
arguments: |
9898
-Pposargs="--ignore=apache_beam/dataframe/ --ignore=apache_beam/examples/ --ignore=apache_beam/runners/ --ignore=apache_beam/transforms/" \
9999
-PpythonVersion=${{ matrix.python_version }} \
100+
-PuseWheelDistribution
100101
- name: Archive code coverage results
101102
uses: actions/upload-artifact@v3
102103
with:

.github/workflows/beam_PreCommit_Python_Coverage.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
uses: ./.github/actions/gradle-command-self-hosted-action
8787
with:
8888
gradle-command: :sdks:python:test-suites:tox:py38:preCommitPyCoverage
89+
arguments: |
90+
-PuseWheelDistribution
8991
- name: Archive code coverage results
9092
uses: actions/upload-artifact@v3
9193
with:

.github/workflows/beam_PreCommit_Python_Dataframes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
arguments: |
9898
-Pposargs=apache_beam/dataframe/ \
9999
-PpythonVersion=${{ matrix.python_version }} \
100+
-PuseWheelDistribution
100101
- name: Archive code coverage results
101102
uses: actions/upload-artifact@v3
102103
with:

.github/workflows/beam_PreCommit_Python_Examples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
arguments: |
9898
-Pposargs=apache_beam/examples/ \
9999
-PpythonVersion=${{ matrix.python_version }} \
100+
-PuseWheelDistribution
100101
- name: Archive code coverage results
101102
uses: actions/upload-artifact@v3
102103
with:

.github/workflows/beam_PreCommit_Python_Runners.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
arguments: |
9898
-Pposargs=apache_beam/runners/ \
9999
-PpythonVersion=${{ matrix.python_version }} \
100+
-PuseWheelDistribution
100101
- name: Archive code coverage results
101102
uses: actions/upload-artifact@v3
102103
with:

.github/workflows/beam_PreCommit_Python_Transforms.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
arguments: |
9898
-Pposargs=apache_beam/transforms/ \
9999
-PpythonVersion=${{ matrix.python_version }} \
100+
-PuseWheelDistribution
100101
- name: Archive code coverage results
101102
uses: actions/upload-artifact@v3
102103
with:

.github/workflows/build_release_candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
pip install -U pip
315315
pip install tox
316316
# TODO(https://github.com/apache/beam/issues/20209): Don't hardcode py version in this file.
317-
pip install -r build-requirements.txt && tox -e py38-docs
317+
tox -e py38-docs
318318
rm -rf target/docs/_build/.doctrees
319319
- name: Build Typescript Docs
320320
working-directory: beam/sdks/typescript

.github/workflows/build_wheels.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ jobs:
9292
uses: actions/setup-python@v4
9393
with:
9494
python-version: 3.8
95-
- name: Get build dependencies
96-
working-directory: ./sdks/python
97-
run: python -m pip install -r build-requirements.txt
98-
- name: Install wheels
99-
run: python -m pip install wheel
10095
- name: Get tag
10196
id: get_tag
10297
run: |
@@ -117,15 +112,15 @@ jobs:
117112
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
118113
- name: Build source
119114
working-directory: ./sdks/python
120-
run: python setup.py sdist --formats=zip
115+
run: pip install -U build && python -m build --sdist
121116
- name: Add checksums
122117
working-directory: ./sdks/python/dist
123118
run: |
124-
file=$(ls | grep .zip | head -n 1)
119+
file=$(ls | grep .tar.gz | head -n 1)
125120
sha512sum $file > ${file}.sha512
126121
- name: Unzip source
127122
working-directory: ./sdks/python
128-
run: unzip dist/$(ls dist | grep .zip | head -n 1)
123+
run: tar -xzvf dist/$(ls dist | grep .tar.gz | head -n 1)
129124
- name: Rename source directory
130125
working-directory: ./sdks/python
131126
run: mv $(ls | grep apache-beam) apache-beam-source
@@ -155,17 +150,17 @@ jobs:
155150
- name: Build RC source
156151
if: steps.is_rc.outputs.is_rc == 1
157152
working-directory: ./sdks/python
158-
run: python setup.py sdist --formats=zip
153+
run: pip install -U build && pythom -m build --sdist
159154
- name: Add RC checksums
160155
if: steps.is_rc.outputs.is_rc == 1
161156
working-directory: ./sdks/python/dist
162157
run: |
163-
file=$(ls | grep .zip | head -n 1)
158+
file=$(ls | grep .tar.gz | head -n 1)
164159
sha512sum $file > ${file}.sha512
165160
- name: Unzip RC source
166161
if: steps.is_rc.outputs.is_rc == 1
167162
working-directory: ./sdks/python
168-
run: unzip dist/$(ls dist | grep .zip | head -n 1)
163+
run: tar -xzvf dist/$(ls dist | grep .tar.gz | head -n 1)
169164
- name: Rename RC source directory
170165
if: steps.is_rc.outputs.is_rc == 1
171166
working-directory: ./sdks/python

.github/workflows/dask_runner_tests.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@ jobs:
4444
uses: actions/setup-python@v4
4545
with:
4646
python-version: 3.8
47-
- name: Get build dependencies
48-
working-directory: ./sdks/python
49-
run: pip install pip setuptools --upgrade && pip install -r build-requirements.txt
5047
- name: Build source
5148
working-directory: ./sdks/python
52-
run: python setup.py sdist
49+
run: pip install -U build && python -m build --sdist
5350
- name: Rename source file
5451
working-directory: ./sdks/python/dist
5552
run: mv $(ls | grep "apache-beam.*tar\.gz") apache-beam-source.tar.gz
@@ -78,9 +75,6 @@ jobs:
7875
uses: actions/setup-python@v4
7976
with:
8077
python-version: ${{ matrix.params.py_ver }}
81-
- name: Get build dependencies
82-
working-directory: ./sdks/python
83-
run: pip install -r build-requirements.txt
8478
- name: Install tox
8579
run: pip install tox
8680
- name: Install SDK with dask

.github/workflows/python_dependency_tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: ['master', 'release-*']
88
tags: 'v*'
99
# paths where Beam Python's dependencies are configured.
10-
paths: ['sdks/python/setup.py', 'sdks/python/build-requirements.txt', 'sdks/python/container/base_image_requirements_manual.txt']
10+
paths: ['sdks/python/setup.py', 'sdks/python/pyproject.toml', 'sdks/python/container/base_image_requirements_manual.txt']
1111

1212
# This allows a subsequently queued workflow run to interrupt previous runs
1313
concurrency:
@@ -38,9 +38,6 @@ jobs:
3838
uses: actions/setup-python@v4
3939
with:
4040
python-version: ${{ matrix.params.py_ver }}
41-
- name: Install Build dependencies
42-
working-directory: ./sdks/python
43-
run: pip install -r build-requirements.txt
4441
- name: Install base_image_requirements.txt
4542
working-directory: ./sdks/python
4643
run: pip install --no-deps -r container/${{ matrix.params.py_env }}/base_image_requirements.txt

0 commit comments

Comments
 (0)