Skip to content
Draft
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
10 changes: 0 additions & 10 deletions .bumpversion.cfg

This file was deleted.

93 changes: 43 additions & 50 deletions .github/workflows/bump_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@ jobs:
should_release: ${{ steps.check.outputs.should_release }}
bump_type: ${{ steps.check.outputs.bump_type }}
pr_number: ${{ steps.check.outputs.pr_number }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get merged PR labels
id: pr_labels
uses: actions/github-script@v7
with:
script: |
const commit = context.sha;

// Find the PR associated with this merge commit
const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: commit
});

if (prs.data.length === 0) {
console.log('No PR found for this commit');
return { bump_type: 'none' };
Expand All @@ -46,22 +46,22 @@ jobs:
// Define valid version labels
const versionLabels = [
'version:major',
'version:minor',
'version:minor',
'version:patch',
'version:none'
];

const pr = prs.data[0];
const firstLabel = pr.labels[0]?.name;
let bump_type = firstLabel.split(':')[1];
return { bump_type, pr_number: pr.number };

- name: Check if release needed
id: check
run: |
BUMP_TYPE="${{ fromJSON(steps.pr_labels.outputs.result).bump_type }}"
PR_NUMBER="${{ fromJSON(steps.pr_labels.outputs.result).pr_number }}"

if [ "$BUMP_TYPE" = "none" ] || [ -z "$BUMP_TYPE" ]; then
echo "No version bump label found - skipping release"
echo "should_release=false" >> $GITHUB_OUTPUT
Expand All @@ -82,106 +82,99 @@ jobs:
pull-requests: read
outputs:
new_version: ${{ steps.bump.outputs.new_version }}

steps:
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.NC_VERSION_BUMPER_APP_ID }}
private-key: ${{ secrets.NC_VERSION_BUMPER_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install bump2version


- name: Bump version
id: bump
run: |
BUMP_TYPE="${{ needs.check-version-bump.outputs.bump_type }}"

echo "Bumping $BUMP_TYPE version"

# Configure git
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
# Use bump2version to bump the version
bump2version $BUMP_TYPE --allow-dirty
NEW_VERSION=$(grep -m 1 '^current_version = ' .bumpversion.cfg | cut -d'=' -f2 | tr -d ' ')

# Use uv version to bump
uv version --bump $BUMP_TYPE
NEW_VERSION=$(uv version)

Comment on lines +116 to +119
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command uv version --bump may not be correct syntax. Based on uv's CLI, version bumping might require a different command format. Verify that uv version --bump major|minor|patch is the correct syntax, as the documentation typically shows commands like uv version to display the current version. This could cause the version bump workflow to fail.

Suggested change
# Use uv version to bump
uv version --bump $BUMP_TYPE
NEW_VERSION=$(uv version)
# Bump version in pyproject.toml using Python
NEW_VERSION=$(BUMP_TYPE="$BUMP_TYPE" python - << 'PY'
import os
import pathlib
import re
import sys
bump_type = os.environ.get("BUMP_TYPE", "").strip().lower()
if bump_type not in {"major", "minor", "patch"}:
print(f"Invalid BUMP_TYPE: {bump_type!r}", file=sys.stderr)
sys.exit(1)
path = pathlib.Path("pyproject.toml")
text = path.read_text(encoding="utf-8")
# Extract [project] section
project_match = re.search(r'(?ms)^\\[project\\]\\s*(.+?)(?=^\\[|\\Z)', text)
if not project_match:
print("Could not find [project] section in pyproject.toml", file=sys.stderr)
sys.exit(1)
project_block = project_match.group(1)
# Find version line like: version = "X.Y.Z"
version_match = re.search(r'(?m)^version\\s*=\\s*"(?P<maj>\\d+)\\.(?P<min>\\d+)\\.(?P<pat>\\d+)"', project_block)
if not version_match:
print("Could not find project version in [project] section", file=sys.stderr)
sys.exit(1)
major = int(version_match.group("maj"))
minor = int(version_match.group("min"))
patch = int(version_match.group("pat"))
if bump_type == "major":
major, minor, patch = major + 1, 0, 0
elif bump_type == "minor":
minor, patch = minor + 1, 0
else: # "patch"
patch += 1
new_version = f"{major}.{minor}.{patch}"
# Replace version line within the project block
new_project_block = re.sub(
r'(?m)^version\\s*=\\s*".*"',
f'version = "{new_version}"',
project_block,
count=1,
)
# Reconstruct full file
new_text = text[:project_match.start(1)] + new_project_block + text[project_match.end(1):]
path.write_text(new_text, encoding="utf-8")
# Print the new version so the shell can capture it
sys.stdout.write(new_version)
PY
)

Copilot uses AI. Check for mistakes.
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT


git add pyproject.toml uv.lock
git commit -m "Bump version to $NEW_VERSION [skip ci]"
git tag "v$NEW_VERSION"

git push origin main --tags

publish-python:
needs: version-bump
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Pull latest changes
run: |
git pull --tags

- name: Set up Python
uses: actions/setup-python@v5
run: git pull --tags

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'

- name: Install build tools
run: |
pip install --upgrade pip
pip install build twine

- name: Build Python package
run: python -m build

- name: Publish to PyPI

- name: Build and publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload --skip-existing dist/*
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
uv build
uv publish

create-release:
needs: [version-bump, publish-python]
runs-on: ubuntu-latest
if: needs.version-bump.outputs.should_release == 'true'
if: needs.version-bump.outputs.new_version != ''
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Pull latest changes
run: git pull --tags

- name: Create GitHub Release
uses: actions/github-script@v7
with:
script: |
const version = '${{ needs.version-bump.outputs.new_version }}';

await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
python-version: ['3.10', '3.11']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- uses: pre-commit/action@v3.0.1
- run: uv run pre-commit run --all-files

test:
needs: pre-commit
Expand All @@ -30,20 +30,16 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev,ml]"


- name: Install dependencies
run: uv sync --extra ml

- name: Run tests with pytest
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pytest tests/unit
run: uv run pytest tests/unit
22 changes: 10 additions & 12 deletions .github/workflows/ml_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
- uses: pre-commit/action@v3.0.1
- run: uv run pre-commit run --all-files

test:
needs: pre-commit
Expand All @@ -27,19 +27,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Pull LFS objects
run: git lfs pull
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev,ml,examples]"

- name: Install dependencies
run: uv sync --extra ml --extra examples

- name: Run Integration Test
env:
Expand All @@ -52,4 +50,4 @@ jobs:
sudo apt-get update
sudo apt-get install -y libxml2-utils xvfb libgl1-mesa-dev libgl1-mesa-glx libosmesa6-dev
Xvfb $DISPLAY -screen 0 1280x1024x24 &
pytest -o log_cli=true --log-cli-level=INFO -v -n 8 tests/integration/test_algorithm.py
uv run pytest -o log_cli=true --log-cli-level=INFO -v -n 8 tests/integration/test_algorithm.py
21 changes: 9 additions & 12 deletions .github/workflows/platform_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: '3.11'
- uses: pre-commit/action@v3.0.1
- run: uv run pre-commit run --all-files

test:
needs: pre-commit
Expand All @@ -27,21 +27,18 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev,ml]"

- name: Install dependencies
run: uv sync --extra ml

- name: Run Integration Test
env:
NEURACORE_API_URL: ${{ matrix.environment == 'staging' && 'https://staging.api.neuracore.app/api' || 'https://api.neuracore.app/api' }}
NEURACORE_API_KEY: ${{ matrix.environment == 'staging' && secrets.STAGING_SERVICE_API_KEY || secrets.PROD_SERVICE_API_KEY }}
NEURACORE_ORG_ID: ${{ matrix.environment == 'staging' && vars.STAGING_SERVICE_ORG_ID || vars.PROD_SERVICE_ORG_ID }}
run: pytest -o log_cli=true --log-cli-level=INFO tests/integration/test_consume_stream.py::test_get_latest_data_from_multiple_nodes
run: uv run pytest -o log_cli=true --log-cli-level=INFO tests/integration/test_consume_stream.py::test_get_latest_data_from_multiple_nodes
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,27 @@ Neuracore is a powerful robotics and machine learning client library for seamles

## Installation

### Using uv (recommended)

```bash
pip install neuracore
uv add neuracore
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command uv add neuracore is for adding dependencies to an existing uv-managed project. For users who want to install neuracore as a standalone package (not as a dependency of another project), they should use uv pip install neuracore or continue using pip. Consider clarifying the installation instructions to distinguish between these use cases.

Copilot uses AI. Check for mistakes.
```

**Note:** for faster video decoding, installing `ffmpeg` via `sudo apt-get install ffmpeg` (for Linux) is recommended.
For training and ML development:
```bash
uv add neuracore[ml]
```

For MuJoCo MJCF support:
```bash
uv add neuracore[mjcf]
```

### Using pip

```bash
pip install neuracore
```

For training and ML development:
```bash
Expand All @@ -31,6 +47,8 @@ For MuJoCo MJCF support:
pip install neuracore[mjcf]
```

**Note:** for faster video decoding, installing `ffmpeg` via `sudo apt-get install ffmpeg` (for Linux) is recommended.

## Quick Start

Ensure you have an account at [neuracore.app](https://www.neuracore.app/)
Expand Down Expand Up @@ -384,14 +402,14 @@ Configure Neuracore behavior with environment variables (case insensitive, prefi
```bash
git clone https://github.com/neuracoreai/neuracore
cd neuracore
pip install -e .[dev,ml]
uv sync --extra ml # Creates .venv and installs all dependencies
```

## Testing

```bash
export NEURACORE_API_URL=http://localhost:8000/api
pytest tests/
uv run pytest tests/
```

If testing on Mac, you may need to set:
Expand Down
Loading
Loading