Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2ba1034
Update CHANGELOG.md
Nov 9, 2020
445d51d
Update CHANGELOG.md
Nov 9, 2020
ad551bf
Update setup.py
Nov 9, 2020
2eba3e8
add python_version to backports-datetime-fromisoformat
Jan 8, 2021
3241470
Fix build GitHub action
Jan 19, 2021
85e6097
Remove parallel testing during build
Jan 19, 2021
c4fae6f
Modify files for sphinx auto docs (#91)
alexandracota Jan 19, 2021
45852a5
Remove trailing whitespace (#97)
Jan 20, 2021
d359402
Add .readthedocs.yml (#96)
alexandracota Jan 20, 2021
07a7d3f
Fix minor bugs and tidy tests up (#98)
Jan 25, 2021
03f2952
added sdk version to headers (#100)
msokoloff1 Feb 5, 2021
77bf526
User agent (#101)
msokoloff1 Feb 5, 2021
3c5266f
Revert "Update setup.py"
Feb 8, 2021
b9f5881
Revert "Update CHANGELOG.md"
Feb 8, 2021
3fbc2ec
Revert "Update CHANGELOG.md"
Feb 8, 2021
6215b04
Merge branch 'develop'
Feb 8, 2021
0a503d5
fixed tests (#106)
msokoloff1 Feb 12, 2021
ca68fcb
Merge branch 'develop' of https://github.com/Labelbox/labelbox-python…
Feb 12, 2021
9ba63b7
remove timout test
Feb 14, 2021
97cf7e0
stop tests on fail
Feb 14, 2021
37c5a9d
remove local changes
Feb 14, 2021
dd32324
wait for tool be created
Feb 14, 2021
0f7338b
format
Feb 14, 2021
dead18b
change frontend
Feb 14, 2021
719174e
format
Feb 14, 2021
36b772c
add missing test back
Feb 14, 2021
dc4d8ef
remove comment
Feb 14, 2021
5172055
format
Feb 14, 2021
1f0cb55
decrease request size
Feb 14, 2021
2c71a0f
update query
Feb 14, 2021
44dab08
tiny query
Feb 14, 2021
07373b1
add sleep
Feb 14, 2021
b98441b
different query
Feb 14, 2021
4314b53
remove extra import
Feb 14, 2021
c7d74de
wait longer
Feb 14, 2021
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
12 changes: 5 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
max-parallel: 1
matrix:
# TODO: unlock parallel testing by using more API keys
python-version: [3.6]
python-version: [3.6, 3.7, 3.8]

steps:

Expand All @@ -27,11 +27,10 @@ jobs:
- name: set environment for branch
run: |
if [[ "${{github.base_ref}}" == "master" || "${{github.ref}}" == "refs/heads/master" ]]; then
echo "::set-env name=LABELBOX_TEST_ENVIRON::prod"
echo "LABELBOX_TEST_ENVIRON=prod" >> $GITHUB_ENV
else
echo "::set-env name=LABELBOX_TEST_ENVIRON::staging"
echo "LABELBOX_TEST_ENVIRON=staging" >> $GITHUB_ENV
fi

- uses: actions/checkout@v2
with:
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
Expand All @@ -58,8 +57,7 @@ jobs:
mypy -p labelbox --pretty --show-error-codes
- name: Install package and test dependencies
run: |
pip install tox==3.18.1 tox-gh-actions==1.3.0 pytest-parallel==0.1.0

pip install tox==3.18.1
# TODO: replace tox.ini with what the Makefile does
# to make sure local testing is
# identical to github actions which uses tox.ini
Expand All @@ -73,4 +71,4 @@ jobs:
# randall+staging-python@labelbox.com
LABELBOX_TEST_API_KEY_STAGING: ${{ secrets.STAGING_LABELBOX_API_KEY }}
run: |
pytest --workers 2 -svv
tox -e py -- -svvx
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ dmypy.json

# macos files
.DS_STORE

# Sphinx Docs build
docs/build/
# and source files
docs/source/_static
docs/source/_templates
23 changes: 23 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Read the docs config file version (Required)
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Build all formats (epub, pdf, htmlzip)
formats:
- pdf

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
- method: setuptools
path: .
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Changelog

## In progress
### Fix
* Custom queries with bad syntax now raise adequate exceptions (InvalidQuery)
* Comparing a Labelbox object (e.g. Project) to None doesn't raise an exception
* Adding `order_by` to `Project.labels` doesn't raise an exception

## Version 2.4.10 (2021-01-05)
### Added
* SDK version added to request headers

## Version 2.4.9 (2020-11-09)
### Fix
* 2.4.8 was broken for > Python 3.6
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
42 changes: 42 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Labelbox Python SDK API Documentation

The Labelbox Python API documentation is generated from source code comments
using Sphinx (https://www.sphinx-doc.org/).

## Preparing the Sphinx environment

To generate the documentation install Sphinx and Sphinxcontrib-Napoleon. The
easiest way to do it is using a Python virtual env and pip:

```
# create a virtual environment
python3 -m venv labelbox_docs_venv

# activate the venv
source ./labelbox_docs_venv/bin/activate

# upgrade venv pip and setuptools
pip install --upgrade pip setuptools

# install Sphinx and necessary contrib from requriements
pip install -r labelbox_root/docs/requirements.txt

# install Labelbox dependencies
pip install -r labelbox_root/requirements.txt
```

There are other ways to do prepare the environment, but we highly recommend
using a Python virtual environment.

## Generating Labelbox SDK API documentation

With the Sphinx environment prepared, enter the docs folder:

```
cd labelbox_root/docs/
```

Run the make build tool, instructing it to build docs as HTML:
```
make html
```
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Sphinx==3.4.3
sphinxcontrib-napoleon==0.7
sphinx-rtd-theme==0.5.1
51 changes: 51 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))

# -- Project information -----------------------------------------------------

project = 'Labelbox Python API reference'
copyright = '2021, Labelbox'

release = '2.4'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
Loading