Skip to content

Commit 5fa75ae

Browse files
jonas-eschletensorflower-gardener
authored andcommitted
PR #779: Fix pip build
Imported from GitHub PR #779 As discussed in #776 I tried but actually run into the issue that layers/experimental cannot be used as a build target, as the builds _inside_ experimental _require_ layers -> circular deps. The other folders in `layers` circumvent this by specifying only the specific build targets. Instead of changing the logic (i.e. is experimental meant to be dev-built only?), I did what the error advertised and added it to the ignored builds, as it's seemingly not made to be built Copybara import of the project: -- 9d3bb64 by Jonas Eschle <mayou36@jonas.eschle.com>: docs: update CONTRIBUTING.md with new name tf-keras (cherry picked from commit fb79960) -- 7bd7b3d by Jonas Eschle <mayou36@jonas.eschle.com>: fix: python build ignore experimental due to circular refs (cherry picked from commit 9b349e3) Merging this change closes #779 FUTURE_COPYBARA_INTEGRATE_REVIEW=#779 from jonas-eschle:fix_pip_build 7bd7b3d PiperOrigin-RevId: 685927076
1 parent ea2cc87 commit 5fa75ae

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ development environment and run the unit tests. This is covered in the section
2020
### Step 3. Create a pull request
2121

2222
Once the change is ready, open a pull request from your branch in your fork to
23-
the master branch in [keras-team/keras](https://github.com/keras-team/keras).
23+
the master branch in [keras-team/tf-keras](https://github.com/keras-team/tf-keras).
2424

2525
### Step 4. Sign the Contributor License Agreement
2626

@@ -149,8 +149,8 @@ as a dependency, we need to uninstall `keras-nightly` so that tests will run
149149
against TF-Keras code in the local workspace.
150150

151151
```shell
152-
git clone https://github.com/YOUR_GITHUB_USERNAME/keras.git
153-
cd keras
152+
git clone https://github.com/YOUR_GITHUB_USERNAME/tf-keras.git
153+
cd tf-keras
154154
pip install -r requirements.txt
155155
pip uninstall keras-nightly
156156
```
@@ -220,14 +220,14 @@ We use [Bazel](https://bazel.build/) to build and run the tests.
220220

221221
### Run a test file
222222

223-
For example, to run the tests in `keras/engine/base_layer_test.py`,
223+
For example, to run the tests in `tf_keras/engine/base_layer_test.py`,
224224
we can run the following command at the root directory of the repo.
225225

226226
```shell
227-
bazel test keras/engine:base_layer_test
227+
bazel test tf_keras/engine:base_layer_test
228228
```
229229

230-
`keras/engine` is the relative path to the directory containing the `BUILD` file
230+
`tf_keras/engine` is the relative path to the directory containing the `BUILD` file
231231
defining the test. `base_layer_test` is the test target name defined with
232232
`tf_py_test` in the `BUILD` file.
233233

@@ -239,7 +239,7 @@ can use the following command to run all the tests in `activations_test.py`,
239239
whose names contain `test_serialization`.
240240

241241
```
242-
bazel test keras:activations_test --test_filter=*test_serialization*
242+
bazel test tf_keras:activations_test --test_filter=*test_serialization*
243243
```
244244

245245
### Run all tests
@@ -267,7 +267,7 @@ command above.
267267
However, it may slow down the tests for not running in parallel
268268
and may cause the test to timeout.
269269

270-
## Contributing to TF-Keras applications
270+
## Contributing to TF-tf_keras applications
271271

272272
Contributions to the
273273
[pre-trained application library](https://keras.io/api/applications/) are

tf_keras/tools/pip_package/create_pip_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
PIP_EXCLUDED_DIRS = frozenset(
3838
[
3939
"tf_keras/benchmarks",
40+
"tf_keras/layers/experimental", # cannot build currently, circular refs
4041
"tf_keras/tests",
4142
]
4243
)
@@ -45,6 +46,7 @@
4546
EXCLUDED_INIT_FILE_DIRECTORIES = frozenset(
4647
[
4748
"tf_keras/benchmarks",
49+
"tf_keras/layers/experimental",
4850
"tf_keras/tools",
4951
]
5052
)

0 commit comments

Comments
 (0)