From 7514454137c80ac3c52ee79bac23f77b8ae2de1a Mon Sep 17 00:00:00 2001 From: Hemil Desai Date: Tue, 25 Mar 2025 11:36:35 -0700 Subject: [PATCH 1/2] fix: Change optional-dependencies to dependency-groups Signed-off-by: Hemil Desai --- .github/workflows/cicd-main.yml | 18 +++++++++--------- docs/documentation.md | 6 +++--- pyproject.toml | 6 +++--- tests/run_unit_in_docker.sh | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml index 7902c02146..0952896ea6 100644 --- a/.github/workflows/cicd-main.yml +++ b/.github/workflows/cicd-main.yml @@ -16,8 +16,8 @@ name: "CICD Reinforcer" on: pull_request: branches: - - 'main' - - 'r**' + - "main" + - "r**" types: [labeled] merge_group: types: [checks_requested] @@ -81,14 +81,14 @@ jobs: # Some output that's helpful for debugging echo "Docs changed: $CHANGED_DOCS" echo "Src changed: $CHANGED_SRC" - + # echo "DOCS_ONLY: $DOCS_ONLY" echo "LABEL: $LABEL" echo "IS_PULLREQUEST: $IS_PULLREQUEST" - + # Run CI only (on main or if label is attached) and if it's not only docs echo run_ci=$([[ ("$LABEL" = "true" || "$IS_PULLREQUEST" = "false" || "$MERGE_GROUP" = "true") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" - + lint-check: name: Lint check needs: [pre-flight] @@ -102,7 +102,7 @@ jobs: pip install pre-commit pre-commit install pre-commit run --all-files --show-diff-on-failure --color=always - + sphinx-build: name: Sphinx build needs: [pre-flight] @@ -115,7 +115,7 @@ jobs: run: | pip install uv cd docs/ - uv run --extra docs sphinx-build . _build/html + uv run --group docs sphinx-build . _build/html build-container: if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} @@ -140,7 +140,7 @@ jobs: TIMEOUT: 10 SCRIPT: | cd ${REINFORCER_REPO_DIR}/docs - uv run --extra docs sphinx-build -b doctest . _build/doctest + uv run --group docs sphinx-build -b doctest . _build/doctest secrets: HF_TOKEN: ${{ secrets.HF_TOKEN }} @@ -186,4 +186,4 @@ jobs: # cd ${REINFORCER_REPO_DIR} # uv run bash ./tests/functional/${{ matrix.test_case }} # secrets: - # HF_TOKEN: ${{ secrets.HF_TOKEN }} \ No newline at end of file + # HF_TOKEN: ${{ secrets.HF_TOKEN }} diff --git a/docs/documentation.md b/docs/documentation.md index 668056b13b..c94239f213 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -15,7 +15,7 @@ Switch to the documentation source folder and generate HTML output. ```sh cd docs/ -uv run --extra docs sphinx-build . _build/html +uv run --group docs sphinx-build . _build/html ``` * The resulting HTML files are generated in a `_build/html` folder that is created under the project `docs/` folder. @@ -29,7 +29,7 @@ To do so run: ```sh cd docs/ -uv run --extra docs sphinx-autobuild . _build/html --port 12345 --host 0.0.0.0 +uv run --group docs sphinx-autobuild . _build/html --port 12345 --host 0.0.0.0 ``` Open a web browser and go to `http://${HOST_WHERE_SPHINX_COMMAND_RUN}:12345` to view the output. @@ -41,7 +41,7 @@ We also run tests in our python docstrings. You can run them with: ```sh cd docs/ -uv run --extra docs sphinx-build -b doctest . _build/doctest +uv run --group docs sphinx-build -b doctest . _build/doctest ``` ## Writing Tests in Python Docstrings diff --git a/pyproject.toml b/pyproject.toml index 8397211ce6..752f25047d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,10 +36,10 @@ packages = ["nemo_reinforcer"] version = {attr = "nemo_reinforcer.__version__"} # any module attribute compatible with ast.literal_eval readme = {file = "README.md", content-type = "text/markdown"} -[project.optional-dependencies] +[dependency-groups] build = [ - "torch==2.6.0", - "setuptools", + "torch==2.6.0", + "setuptools", "packaging", "einops" ] diff --git a/tests/run_unit_in_docker.sh b/tests/run_unit_in_docker.sh index 1190e3d8ec..cdcd3a2ed2 100755 --- a/tests/run_unit_in_docker.sh +++ b/tests/run_unit_in_docker.sh @@ -36,4 +36,4 @@ fi # We have found that 111 does not always work and can leave the filesystem permissions in a bad state. # Run the script inside the Docker container with GPU support -docker run -u root $INTERACTIVE_FLAG --ulimit memlock=-1 --ulimit stack=67108864 --rm --gpus '"device=0,1"' -v "$(realpath $SCRIPT_DIR/..):/workspace" -v $HF_HOME:/hf_home -e HF_TOKEN -e HF_HOME=/hf_home -e HOME=/tmp/ -w /workspace/tests "$CONTAINER" -- bash -x -c "umask 000 && uv run --extra test bash -x ./run_unit.sh $@" +docker run -u root $INTERACTIVE_FLAG --ulimit memlock=-1 --ulimit stack=67108864 --rm --gpus '"device=0,1"' -v "$(realpath $SCRIPT_DIR/..):/workspace" -v $HF_HOME:/hf_home -e HF_TOKEN -e HF_HOME=/hf_home -e HOME=/tmp/ -w /workspace/tests "$CONTAINER" -- bash -x -c "umask 000 && uv run --group test bash -x ./run_unit.sh $@" From d88daa76acb636c956535d4fd2f75fad3fc0f81e Mon Sep 17 00:00:00 2001 From: Hemil Desai Date: Mon, 31 Mar 2025 18:03:04 -0700 Subject: [PATCH 2/2] Fix Signed-off-by: Hemil Desai --- .github/workflows/cicd-main.yml | 2 +- docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml index 0952896ea6..4f20b77cda 100644 --- a/.github/workflows/cicd-main.yml +++ b/.github/workflows/cicd-main.yml @@ -154,7 +154,7 @@ jobs: TIMEOUT: 15 SCRIPT: | cd ${REINFORCER_REPO_DIR} - uv run --extra test bash -x ./tests/run_unit.sh + uv run --group test bash -x ./tests/run_unit.sh FINAL_SCRIPT_EXTERNAL: | cat <