Skip to content
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
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autofix suggestions'

repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.5.5'
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']

- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black
exclude: notebooks|^tests/test_data$
args: ['--config=./pyproject.toml']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: pretty-format-json
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=100']
- id: requirements-txt-fixer
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2024 Autonomi AI, Inc. authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
49 changes: 49 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
default: help;

help:
@echo "🔥 Official VLM Run Python SDK"
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " clean Remove all build, test, coverage and Python artifacts"
@echo " clean-build Remove build artifacts"
@echo " clean-pyc Remove Python file artifacts"
@echo " clean-test Remove test and coverage artifacts"
@echo " lint Format source code automatically"
@echo " test Basic testing"
@echo " dist Builds source and wheel package"
@echo ""

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr site/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +


clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache

lint: ## Format source code automatically
pre-commit run --all-files # Uses pyproject.toml

test: ## Basic CPU testing
pytest -sv tests

dist: clean ## builds source and wheel package
python -m build --sdist --wheel
ls -lh dist
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
# vlmrun-python-sdk
Official Python SDK for VLM Run Client
Python SDK for VLMRun.

## Installation

```bash
pip install vlmrun
```

## Usage

```python
from vlmrun.client import Client

client = Client()
```
32 changes: 32 additions & 0 deletions makefiles/Makefile.admin.mk
Copy link
Contributor

Choose a reason for hiding this comment

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

Package publish will be handled by github CI?

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
VLMRUN_SDK_VERSION := $(shell python -c 'from vlmrun.version import __version__; print(__version__.replace("-", "."))')
PYPI_USERNAME :=
PYPI_PASSWORD :=

WHL_GREP_PATTERN := .*\$(VLMRUN_SDK_VERSION).*\.whl

create-pypi-release-test:
@echo "looking for vlmrun whl file..."
@for file in dist/*; do \
echo "examining file: $$file"; \
if [ -f "$$file" ] && echo "$$file" | grep -qE "$(WHL_GREP_PATTERN)"; then \
echo "Uploading: $$file"; \
twine upload --repository testpypi "$$file"; \
fi; \
done
@echo "Upload completed"


create-pypi-release:
@echo "looking for vlmrun whl file..."
@for file in dist/*; do \
echo "examining file: $$file"; \
if [ -f "$$file" ] && echo "$$file" | grep -qE "$(WHL_GREP_PATTERN)"; then \
echo "Uploading: $$file"; \
twine upload "$$file"; \
fi; \
done
@echo "Upload completed"

create-tag:
git tag -a ${VLMRUN_SDK_VERSION} -m "Release ${VLMRUN_SDK_VERSION}"
git push origin ${VLMRUN_SDK_VERSION}
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

[build-system]
requires = ["setuptools>=40.1.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "vlmrun"
description = "Official Python SDK for VLM Run"
authors = [{name = "VLM Support", email = "[email protected]"}]
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research","Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Processing",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
license = {file = "LICENSE"}
dynamic = ["version", "dependencies"]

[project.optional-dependencies]
test = ["pytest"]
build = ["twine", "build"]

[tool.setuptools.dynamic]
version = {attr = "vlmrun.version.__version__"}
dependencies = {file = ["requirements/requirements.txt"]}

[tool.setuptools.packages.find]
include = ["vlmrun*"]
5 changes: 5 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def test_client():
from vlmrun.client import Client

client = Client()
assert client is not None
1 change: 1 addition & 0 deletions vlmrun/client/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .client import Client # noqa: F401
5 changes: 5 additions & 0 deletions vlmrun/client/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from dataclasses import dataclass


@dataclass
class Client: ...
1 change: 1 addition & 0 deletions vlmrun/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"