-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove TensorFlow from dependencies. - Drop Python 3.6 support (JAX has dropped Python 3.6 support in July 2021). - Re-enable github test workflow. PiperOrigin-RevId: 408471735
- Loading branch information
Showing
6 changed files
with
76 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,42 @@ | ||
name: Build and minimal test | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
python-version: [3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip | ||
# Please read the documentation on | ||
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows | ||
# before making changes to this step. | ||
uses: actions/cache@v2 | ||
with: | ||
# Cache installed Python packages instead of the pip download cache. | ||
path: ${{ env.pythonLocation }}/lib/python${{ matrix.python-version }}/site-packages | ||
# Look to see if there is a cache hit for the corresponding setup.py. | ||
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('setup.py') }} | ||
# Try the cache with a different setup.py. | ||
restore-keys: ${{ runner.os }}-py${{ matrix.python-version }}-pip- | ||
- name: Install dependencies | ||
# Use `install -e` for local fedjax to prevent actual fedjax files from | ||
# being packaged into cache. | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install -e . | ||
- name: Basic test | ||
# We run tests using `python -I` to prevent the script directory to be | ||
# added to sys.path. | ||
run: | | ||
python -I fedjax/fedjax_test.py | ||
- name: Full test | ||
run: | | ||
./run_tests.sh | ||
- name: Build documentation | ||
run: | | ||
pip install -r docs/requirements.txt | ||
pip install -r requirements-test.txt | ||
# # TODO(b/191778948): Reselect once we understand absl flags and pytest. | ||
# - name: Test | ||
# run: | | ||
# pytest -n auto -q \ | ||
# -k "not SubsetFederatedDataTest and not SQLiteFederatedDataTest and not ForEachClientPmapTest and not DownloadsTest and not CheckpointTest and not LoggingTest" \ | ||
# fedjax --ignore=fedjax/legacy/ | ||
# - name: Build documentation | ||
# run: | | ||
# sphinx-build -M html docs docs/_build | ||
sphinx-build -M html docs docs/_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
# limitations under the License. | ||
"""FedJAX version.""" | ||
|
||
__version__ = '0.0.7' | ||
__version__ = '0.0.8' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
pytest-xdist | ||
flax | ||
tensorflow-cpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# | ||
# Script for running tests in OSS development. | ||
# | ||
# Examples: | ||
# | ||
# * Running all tests under fedjax/ (default): | ||
# | ||
# ./run_tests.sh | ||
# | ||
# * Running tests in directory fedjax/core: | ||
# | ||
# ./run_tests.sh fedjax/core | ||
# | ||
# * Running tests in fedjax/fedjax_test.py and directory fedjax/core: | ||
# | ||
# ./run_tests.sh fedjax/fedjax_test.py fedjax/core | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
if [[ "$#" -eq 0 ]]; then | ||
TO_RUN=(fedjax) | ||
else | ||
TO_RUN="$@" | ||
fi | ||
|
||
# Install build/test dependencies. | ||
pip install -e . | ||
pip install -r requirements-test.txt | ||
|
||
# Run tests in serial. | ||
# | ||
# We use 'python -I' to prevent the script directory from being included in | ||
# sys.path. | ||
# | ||
# TODO(wuke): Improve readability of test failures. | ||
# | ||
# TODO(wuke): Run tests in parallel. We need to deal with race conditions caused | ||
# by multiple tests accessing temporary files with the same name (e.g. | ||
# "test_sqlite_federated_data.sqlite" in both | ||
# fedjax/core/sqlite_federated_data_test.py and | ||
# fedjax/core/federated_data_test.py | ||
find "${TO_RUN[@]}" -name '*_test.py' -print0 | \ | ||
xargs -0 -n1 -- sh -c 'python -I $0 2>&1 || exit 255' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters