Skip to content

Update doc build instructions and clean up unused packages #4885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/flax_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uv-version: "0.3.0"
- name: Install standalone dependencies only
run: |
uv sync --extra all
uv sync
- name: Test importing Flax
run: |
uv run python -c "import flax"
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:

- name: Install dependencies
run: |
uv sync --extra all --extra testing --extra docs
uv sync --extra testing --extra docs
- name: Install JAX
run: |
if [[ "${{ matrix.jax-version }}" == "newest" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jax_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
version: "0.3.0"
- name: Install dependencies
run: |
uv sync --extra all --extra testing --extra docs
uv sync --extra testing --extra docs
- name: Install JAX
run: |
uv pip install -U --pre jax jaxlib -i https://us-python.pkg.dev/ml-oss-artifacts-published/jax/simple/
Expand Down
16 changes: 9 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Deprecation

This folder contains the deprecated Flax Linen documentation. For the latest Flax NNX docs, check out the `docs_nnx` folder.

# Where to find the docs

The FLAX documentation can be found here:
https://flax.readthedocs.io/en/latest/
The FLAX Linen documentation can be found here: https://flax-linen.readthedocs.io/en/latest/

# How to build the docs

1. Clone the `flax` repository with `git clone https://github.com/google/flax.git`.
2. In the main `flax` folder, install the required dependencies using `pip install -r docs/requirements.txt`.
3. Install [`pandoc`](https://pandoc.org): `pip install pandoc`.
4. [Optional] If you need to make any local changes to the docs, create and switch to a branch. Make your changes to the docs in that branch.
5. To build the docs, in the `flax/docs` folder run the make script: `make html`. Alternatively, install [`entr`](https://github.com/eradman/entr/), which helps run arbitrary commands when files change. Then run `find ../ ! -regex '.*/[\.|\_].*' | entr -s 'make html'`.
6. If the build is successful, you should get the `The HTML pages are in _build/html.` message. You can preview the docs in `flax/docs/_build/html`.
1. In the main `flax` folder, install the required dependencies using `uv pip install -e .[docs]`.
1. [Optional] If you need to make any local changes to the docs, create and switch to a branch. Make your changes to the docs in that branch.
1. To build the docs, in the `flax/docs` folder run the make script: `make html`. Alternatively, install [`entr`](https://github.com/eradman/entr/), which helps run arbitrary commands when files change. Then run `find ../ ! -regex '.*/[\.|\_].*' | entr -s 'make html'`.
1. If the build is successful, you should get the `The HTML pages are in _build/html.` message. You can preview the docs in `flax/docs/_build/html`.

# How to run embedded code tests

Expand Down
9 changes: 4 additions & 5 deletions docs_nnx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ https://flax.readthedocs.io/en/latest/
# How to build the docs

1. Clone the `flax` repository with `git clone https://github.com/google/flax.git`.
2. In the main `flax` folder, install the required dependencies using `pip install -r docs/requirements.txt`.
3. Install [`pandoc`](https://pandoc.org): `pip install pandoc`.
4. [Optional] If you need to make any local changes to the docs, create and switch to a branch. Make your changes to the docs in that branch.
5. To build the docs, in the `flax/docs` folder run the make script: `make html`. Alternatively, install [`entr`](https://github.com/eradman/entr/), which helps run arbitrary commands when files change. Then run `find ../ ! -regex '.*/[\.|\_].*' | entr -s 'make html'`.
6. If the build is successful, you should get the `The HTML pages are in _build/html.` message. You can preview the docs in `flax/docs/_build/html`.
1. In the main `flax` folder, install the required dependencies using `uv pip install -e .[docs]`.
1. [Optional] If you need to make any local changes to the docs, create and switch to a branch. Make your changes to the docs in that branch.
1. To build the docs, in the `flax/docs_nnx` folder run the make script: `make html`. Alternatively, install [`entr`](https://github.com/eradman/entr/), which helps run arbitrary commands when files change. Then run `find ../ ! -regex '.*/[\.|\_].*' | entr -s 'make html'`.
1. If the build is successful, you should get the `The HTML pages are in _build/html.` message. You can preview the docs in `flax/docs/_build/html`.

# How to run embedded code tests

Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ classifiers = [
dynamic = ["version", "readme"]

[project.optional-dependencies]
all = [
"matplotlib", # only needed for tensorboard export
]
testing = [
"clu",
"clu<=0.0.9; python_version<'3.10'",
Expand Down
Loading