Skip to content

Commit

Permalink
feat: implements initial sync for v2 APIs (#3)
Browse files Browse the repository at this point in the history
This commit implements the initial sync client that will form the base of the SDK.
  • Loading branch information
guptadev21 authored Oct 28, 2024
1 parent 8d15592 commit 8eefdae
Show file tree
Hide file tree
Showing 21 changed files with 968 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @rapyuta-robotics/io-cli-owner @rapyuta-robotics/io-first-reviewer
20 changes: 20 additions & 0 deletions .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 💬 Check Commit Hygiene

on:
pull_request:
branches:
- main
- devel

jobs:
verify:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout code

- uses: rapyuta-robotics/[email protected]
name: Check if commit messages are compliant
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: ✅ Quality Checks
on: [ push ]

jobs:
code-quality-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Run checks
uses: astral-sh/ruff-action@v1
with:
args: "check"
23 changes: 23 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 📦️ Upload to PyPi
on:
release:
types:
- published

jobs:
upload:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Publish to pypi
run: |
uv build
uv publish --trusted-publishing always
22 changes: 22 additions & 0 deletions .github/workflows/python-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 🐍 Python Compatibility Check
on: [push]

jobs:
python-compatibility:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8.10', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Try import
run: |
uv run python -c "import rapyuta_io_sdk_v2"
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 🎉 Release
on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
token: ${{ secrets.GH_TOKEN }}

- name: Run semantic-release
run: |
npm install --save-dev [email protected]
npm install @semantic-release/git -D
npm install @semantic-release/changelog -D
npm install @semantic-release/exec -D
npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# python generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# venv
.venv*/
.ruff_cache
.idea
.vscode
main_test.py
test_config.json

ignore/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12.5
29 changes: 29 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{"type": "docs", "scope": "README", "release": "patch"},
{"type": "release", "release": "minor"},
{"scope": "no-release", "release": false}
]
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/exec",
{
"prepareCmd": "scripts/bump-version.sh ${nextRelease.version}"
}
]
]
}
Empty file added CHANGELOG.md
Empty file.
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contribution Guidelines
## 🌟 Setup Your Development Environment

The project uses [uv](https://docs.astral.sh/uv/) for development. It needs to be installed to set up the development environment.

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

> Note: In case of installation error, please refer to this [installation documentation](https://docs.astral.sh/uv/getting-started/installation/).
Once `uv` is installed, a Python virtual environment can be quickly bootstrapped by running the following commands in the root of the repository:

```bash
uv venv
source .venv/bin/activate
```

This will create a virtual environment in the `.venv` directory and activate it.

Next, install all dependencies using the following command:

```bash
uv sync
```

New dependencies can be installed directly using `uv`. This modifies the `pyproject.toml` and `uv.lock`.

```bash
uv add <package-name>
```

### 🛠️ Linting and Formatting

You can check and fix the code style by running the following commands:

```bash
uvx ruff check --fix
uvx ruff format
```
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Rapyuta IO SDK v2
Rapyuta IO SDK v2 provides a comprehensive set of tools and functionalities to interact with the rapyut.io platform.

## Installation
```bash
pip install rapyuta-io-sdk-v2
```

### Quick Start
```python
from rapyuta_io_sdk_v2 import Configuration, Client

config = Configuration(email="[email protected]",
password="password",
organization_guid="organization_guid",
project_guid="project_guid")

client = Client(config)
client.login()

# Get current project
project = client.get_project()
```

## Contributing

We welcome contributions! Please read our [contributing guidelines](CONTRIBUTING.md) to get started.
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[project]
name = "rapyuta-io-sdk-v2"
dynamic = ["version"]
description = "Python SDK for rapyuta.io v2 APIs"
dependencies = [
"httpx>=0.27.2",
"mock>=5.1.0",
"munch>=4.0.0",
"pytest-mock>=3.14.0",
"pytest>=8.3.3",
"tenacity>=9.0.0",
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">= 3.8"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = []

[tool.hatch.version]
path = "rapyuta_io_sdk_v2/__init__.py"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["rapyuta_io_sdk_v2"]
5 changes: 5 additions & 0 deletions rapyuta_io_sdk_v2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ruff: noqa
from rapyuta_io_sdk_v2.config import Configuration
from rapyuta_io_sdk_v2.client import Client

__version__ = "0.0.1"
Loading

0 comments on commit 8eefdae

Please sign in to comment.