Skip to content

Modernize Python/TensorFlow CI and add example smoke tests#83

Merged
shenweichen merged 8 commits intomasterfrom
codex/update-ci-tf-matrix
Apr 18, 2026
Merged

Modernize Python/TensorFlow CI and add example smoke tests#83
shenweichen merged 8 commits intomasterfrom
codex/update-ci-tf-matrix

Conversation

@shenweichen
Copy link
Copy Markdown
Owner

@shenweichen shenweichen commented Apr 18, 2026

Summary

This PR modernizes the project's TensorFlow compatibility, CI matrix, examples, and smoke-test coverage.

  • Replace the legacy CI matrix with explicit Python/TensorFlow combinations.
  • Add conditional legacy Keras support for newer TensorFlow versions via tf-keras and TF_USE_LEGACY_KERAS.
  • Modernize LINE and SDNE to use public tensorflow.keras APIs.
  • Remove the runtime dependency on deepctr.
  • Refactor examples into importable main() entry points with lightweight smoke mode.
  • Add CI coverage for examples/*.py.
  • Update model tests with embedding count and dimension assertions.
  • Update package metadata, dependency extras, README install guidance, and the CI badge.

Extended description

The previous CI matrix attempted broad TensorFlow coverage through version combinations that are no longer consistently installable across supported Python versions. This PR replaces that setup with an explicit compatibility matrix covering TensorFlow 1.15.5, 2.10, 2.15, and 2.20 on supported Python versions. It also updates GitHub Actions dependencies and adds version-specific install handling for NumPy, protobuf, and legacy Keras.

The TensorFlow-backed models are updated to avoid private Keras imports and compatibility-sensitive helper dependencies. LINE now uses TensorFlow-native reduction and loss helpers instead of deepctr, while SDNE now avoids NumPy operations on symbolic tensors and uses public tensorflow.keras APIs.

The example scripts are also made easier to validate. Each example now exposes a main() entry point and supports a smoke mode that uses smaller graphs, fewer epochs, and reduced embedding dimensions. This allows CI to import and run the examples without requiring full training, plotting, or evaluation runs.

Package metadata and docs are updated alongside the code changes. TensorFlow is exposed as an optional tf extra, test dependencies are grouped under a test extra, Python support is clarified as >=3.7, and the README now uses a modern editable install command.

Resolved issues

Resolved by this PR:

Related but not closed by this PR:

Notes

  • Example smoke tests use reduced graph sizes, epochs, and embedding dimensions so CI can validate behavior quickly.
  • TensorFlow-dependent tests are skipped automatically when TensorFlow is not installed.
  • Full compatibility validation is covered by the GitHub Actions matrix on this PR.

@shenweichen shenweichen changed the title Update CI TF matrix and add example smoke coverage Modernize Python/TensorFlow CI and add example smoke tests Apr 18, 2026
@shenweichen shenweichen marked this pull request as ready for review April 18, 2026 15:35
@shenweichen shenweichen merged commit 1027d10 into master Apr 18, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant