Skip to content

Commit 11bece8

Browse files
authored
Fix the publish to pypi action (keras-team#1311)
It has been failing since keras-team#1309, see https://github.com/keras-team/keras-nlp/actions/runs/6819858177/job/18547841938 I believe what is happening is that newly pinned nightly only had linux wheels for 3.9. And our publish to pypi flow did not specify the python version. https://pypi.org/project/tensorflow-text-nightly/2.16.0.dev20231107/#files Doing a few things here: - Updating the pinned package to a version where tensorflow-text-nightly has support for python 3.9, 3.10, and 3.11 on linux. - Fixing out publish to pypi workflow to set the python version like other workflow versions. - Some other cleanups for consistency with our github actions.
1 parent 239f6fd commit 11bece8

File tree

6 files changed

+42
-26
lines changed

6 files changed

+42
-26
lines changed

.github/workflows/actions.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
build:
14+
keras_2:
1515
name: Test the code with Keras 2
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- name: Set up Python 3.9
2020
uses: actions/setup-python@v1
2121
with:
@@ -43,15 +43,15 @@ jobs:
4343
- name: Run integration tests
4444
run: |
4545
python pip_build.py --install && cd integration_tests && pytest .
46-
multibackend:
46+
keras_3:
4747
name: Test the code with Keras 3
4848
strategy:
4949
fail-fast: false
5050
matrix:
5151
backend: [tensorflow, jax, torch]
5252
runs-on: ubuntu-latest
5353
steps:
54-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
5555
- name: Set up Python 3.9
5656
uses: actions/setup-python@v1
5757
with:
@@ -77,11 +77,11 @@ jobs:
7777
KERAS_BACKEND: ${{ matrix.backend }}
7878
run: |
7979
pytest keras_nlp/
80-
format:
80+
check_format:
8181
name: Check the code format
8282
runs-on: ubuntu-latest
8383
steps:
84-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v3
8585
- name: Set up Python 3.9
8686
uses: actions/setup-python@v1
8787
with:

.github/workflows/publish-to-pypi.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,31 @@ jobs:
1010
name: Build and publish to PyPI
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@master
14-
- name: Install dependencies
15-
run: |
16-
pip install -r requirements.txt --progress-bar off
17-
- name: Build a binary wheel and a source tarball
18-
run: >-
19-
python pip_build.py
20-
- name: Publish distribution to PyPI
21-
if: startsWith(github.ref, 'refs/tags')
22-
uses: pypa/gh-action-pypi-publish@master
23-
with:
24-
password: ${{ secrets.PYPI_API_TOKEN }}
13+
- uses: actions/checkout@v3
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.9
18+
- name: Get pip cache dir
19+
id: pip-cache
20+
run: |
21+
python -m pip install --upgrade pip setuptools
22+
echo "::set-output name=dir::$(pip cache dir)"
23+
- name: pip cache
24+
uses: actions/cache@v2
25+
with:
26+
path: ${{ steps.pip-cache.outputs.dir }}
27+
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
28+
restore-keys: |
29+
${{ runner.os }}-pip-
30+
- name: Install dependencies
31+
run: |
32+
pip install -r requirements.txt --progress-bar off
33+
- name: Build a binary wheel and a source tarball
34+
run: >-
35+
python pip_build.py
36+
- name: Publish distribution to PyPI
37+
if: startsWith(github.ref, 'refs/tags')
38+
uses: pypa/gh-action-pypi-publish@master
39+
with:
40+
password: ${{ secrets.PYPI_API_TOKEN }}

requirements-jax-cuda.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tensorflow cpu-only version.
2-
tf-nightly-cpu==2.16.0.dev20231107 # Pin a working nightly until rc0.
3-
tensorflow-text-nightly==2.16.0.dev20231107 # Pin a working nightly until rc0.
2+
tf-nightly-cpu==2.16.0.dev20231109 # Pin a working nightly until rc0.
3+
tensorflow-text-nightly==2.16.0.dev20231109 # Pin a working nightly until rc0.
44

55
# Torch cpu-only version.
66
--extra-index-url https://download.pytorch.org/whl/cpu

requirements-tensorflow-cuda.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Tensorflow with cuda support.
22
--extra-index-url https://pypi.nvidia.com
3-
tf-nightly[and-cuda]==2.16.0.dev20231107 # Pin a working nightly until rc0.
4-
tensorflow-text-nightly==2.16.0.dev20231107 # Pin a working nightly until rc0.
3+
tf-nightly[and-cuda]==2.16.0.dev20231109 # Pin a working nightly until rc0.
4+
tensorflow-text-nightly==2.16.0.dev20231109 # Pin a working nightly until rc0.
55

66
# Torch cpu-only version.
77
--extra-index-url https://download.pytorch.org/whl/cpu

requirements-torch-cuda.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tensorflow cpu-only version.
2-
tf-nightly-cpu==2.16.0.dev20231107 # Pin a working nightly until rc0.
3-
tensorflow-text-nightly==2.16.0.dev20231107 # Pin a working nightly until rc0.
2+
tf-nightly-cpu==2.16.0.dev20231109 # Pin a working nightly until rc0.
3+
tensorflow-text-nightly==2.16.0.dev20231109 # Pin a working nightly until rc0.
44

55
# Torch with cuda support.
66
--extra-index-url https://download.pytorch.org/whl/cu118

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tensorflow.
2-
tf-nightly-cpu==2.16.0.dev20231107 # Pin a working nightly until rc0.
3-
tensorflow-text-nightly==2.16.0.dev20231107 # Pin a working nightly until rc0.
2+
tf-nightly-cpu==2.16.0.dev20231109 # Pin a working nightly until rc0.
3+
tensorflow-text-nightly==2.16.0.dev20231109 # Pin a working nightly until rc0.
44

55
# Torch.
66
--extra-index-url https://download.pytorch.org/whl/cpu

0 commit comments

Comments
 (0)