Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ repos:
- id: markdown-link-check
args: [--config, ".link-check.json", --quiet]
stages: [manual]
exclude: \bATTRIBUTIONS\b
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ To see all available commands, run
just
```

## Releasing

To release, you must be a maintainer of the [cosmos-predict2 package](https://pypi.org/project/cosmos-predict2/).

Run pre-release check:

```shell
just release-check
```

Commit any changes.

Release to PyPI (omit `<pypi_token>` to dry-run):

```shell
just release <pypi_token>
```

Push the new tag to GitHub:

```shell
git push git@github.com:nvidia-cosmos/cosmos-predict2.git "v$(uv version --short)"
```

Merge the new commit to GitHub.

## Code Reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult
Expand Down
3 changes: 1 addition & 2 deletions bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ fi
PYPI_TOKEN="$1"
shift

# Check that there are no uncommitted changes
if [[ $(git status --porcelain) ]]; then
echo "There are uncommitted changes. Please commit or stash them before proceeding."
exit 1
fi

# Bump the version and tag the release
PACKAGE_VERSION=$(uv version --bump patch --short)
just license
just lint
git add .
git commit -m "v$PACKAGE_VERSION"
git tag "v$PACKAGE_VERSION"
Expand Down
14 changes: 12 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ lint: setup
# Run tests
test: lint

# https://spdx.org/licenses/
allow_licenses := "MIT BSD-2-CLAUSE BSD-3-CLAUSE APACHE-2.0 ISC"
ignore_package_licenses := "nvidia-* hf-xet certifi filelock matplotlib typing-extensions"

# Update the license
license: install
uvx licensecheck --show-only-failing --ignore-packages "nvidia-*" "hf-xet" --zero
uvx licensecheck --show-only-failing --only-licenses {{allow_licenses}} --ignore-packages {{ignore_package_licenses}} --zero
uvx pip-licenses --python .venv/bin/python --format=plain-vertical --with-license-file --no-license-path --no-version --with-urls --output-file ATTRIBUTIONS.md
pre-commit run --files ATTRIBUTIONS.md || true

# Pre-release checks
release-check:
just license
pre-commit run --all-files --hook-stage manual

# Release a new version
release pypi_token='dry-run' *args:
Expand All @@ -33,7 +43,7 @@ docker-build cuda_version='12.6.3' *args:
# Run the docker container
docker cuda_version='12.6.3' *args:
# https://github.com/astral-sh/uv-docker-example/blob/main/run.sh
just -f {{justfile()}} docker-build "{{cuda_version}}"
just docker-build "{{cuda_version}}"
docker run --gpus all --rm -v .:/workspace -v /workspace/.venv -it cosmos-predict2:{{cuda_version}} {{args}}

# Run the arm docker container
Expand Down