Skip to content

Commit 8f2ee5c

Browse files
Merge pull request #15 from DevoInc/BREAKING-CHANGE/Update_API
First deployment
2 parents 0627677 + e694558 commit 8f2ee5c

35 files changed

+525
-239
lines changed

.github/workflows/documentation.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
echo "RELEASE_VERSION=${POETRY_VERSION}" >> $GITHUB_ENV
3737
- name: Install dependencies
3838
run: |
39-
pip install sphinx sphinx_rtd_dark_mode
39+
pip install sphinx
40+
pip install sphinx-autodoc-typehints
41+
pip install furo
4042
- name: Sphinx build
4143
run: |
4244
sphinx-build docs/source _build

.github/workflows/publish-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name: Publish Python Package to TestPypi
1111
# After bumping version (when closed Pull Requests to main) and tests are passed
1212
on:
1313
workflow_run:
14-
workflows: ["Bump version", "Test with tox"]
14+
workflows: ["Bump version"]
1515
types:
1616
- completed
1717

CHANGELOG.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
#### 0.0.1
2-
- Remake of Makeijan Python Client > ML Model Manager
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [1.0.0] - 2022-10-25
8+
#### Added
9+
* First release.

CONTRIBUTING.md

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,87 @@
1-
# Contributing
1+
# Contributing to Devo
2+
3+
There are many ways to contribute to Devo. Here are some of them:
4+
5+
6+
1. [Report bugs](#reporting-bugs) or request features in the [issue tracker](https://github.com/DevoInc/python-mlmodelmanager-client/issues).
7+
2. [Submit patches](#submit-patch) for bug fixes and/or new features.
8+
9+
## Reporting bugs
10+
11+
Well-written bug reports are very helpful, keep in mind this guideline when
12+
reporting a new bug.
13+
14+
* Check the open issues to see if it has already been reported.
15+
* Write complete, reproducible, specific bug reports: the smaller the test case,
16+
better.
17+
* Includes the output of the library with all the error information
18+
19+
20+
## Submit patch
21+
To be able to make a fork and the corresponding MR you have to accept Devo's CLA
22+
The process to modify one package or script is the next:
23+
24+
1. Create your fork from main
25+
2. Create a branch that determines the change. The branch name determines the versioning, if it starts with:
26+
- BREAK or MAJOR ⟶ MAJOR (1.2.3 ⟶ 2.0.0)
27+
- FEAT or MINOR ⟶ MINOR (1.2.3 ⟶ 1.3.0)
28+
- Anything else ⟶ PATCH (1.2.3 ⟶ 1.2.4)
29+
3. Add to the `CHANGELOG.md`, in
30+
[`Unreleased`](#How_can_I_minimize_the_effort_required?) the tasks
31+
that you are going to take or are carrying out to be able to review at a quick
32+
glance the objective of the branch.
33+
4. Make your awesome code
34+
5. Never forget to **change the changelog**.
35+
4.1 [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
36+
6. Create a Pull Request to master with correct version and tests passed.
37+
38+
39+
## Keep a CHANGELOG
40+
##### What’s a change log?
41+
A change log is a file which contains a curated, chronologically ordered list of
42+
notable changes for each version of a project.
43+
44+
##### What’s the point of a change log?
45+
To make it easier for users and contributors to see precisely what notable
46+
changes have been made between each release (or version) of the project.
47+
48+
##### Why should I care?
49+
Because software tools are for people. If you don’t care, why are you
50+
contributing? Right, Devo pay you for it, but surely, there must be a kernel
51+
(ha!) of care somewhere in that lovely little brain of yours.
52+
53+
##### What makes a good change log?
54+
A good change log sticks to these principles:
55+
56+
* It’s made for humans, not machines, so legibility is crucial.
57+
* Easy to link to any section (hence Markdown over plain text).
58+
* One sub-section per version.
59+
* List releases in reverse-chronological order (newest on top).
60+
* Write all dates in `YYYY-MM-DD` format. (Example: `2012-06-02`
61+
for `June 2nd, 2012`.) It’s international, sensible, and language-independent.
62+
* Explicitly mention whether the project follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
63+
* Each version should:
64+
* List its release date in the above format.
65+
* Group changes to describe their impact on the project, as follows:
66+
* `Added` for new features.
67+
* `Changed` for changes in existing functionality.
68+
* `Deprecated` for once-stable features removed in upcoming releases.
69+
* `Removed` for deprecated features removed in this release.
70+
* `Fixed` for any bug fixes.
71+
* `Security` to invite users to upgrade in case of vulnerabilities.
72+
73+
##### How can I minimize the effort required?
74+
75+
Always have an `Unreleased` section at the top for keeping track of any changes.
76+
77+
This serves two purposes:
78+
* People can see what changes they might expect in upcoming releases
79+
* At release time, you just have to change "Unreleased" to the version number and add a new "Unreleased"
80+
header at the top.
81+
82+
**Feel free for update and improve this document content or format.**<br/>
83+
284

3-
If someone is contributing to any Devo open source repository (internal or external), a Contributor License Agreement should be signed: https://cla-assistant.io/DevoInc/
485

586
## Development
687

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2022 Engineering / Core Services / Machine Learning / api
3+
Copyright (C) 2022 Devo, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,41 @@
11
# python-mlmodelmanager
22

3-
A client for Devo's ML model manager
3+
An easy-to-use client for Devos’s Machine Learning Model Manager.
44

5-
## Install
5+
Built on top of the widely used Requests library, it takes advantage of all the
6+
features it provides and exposes a simplified interface for manage models.
7+
8+
The main purpose of this library is to allow you to focus in the machine learning
9+
workflows and not worry about the integration with Devo’s ML Model Manager.
10+
11+
## A simple example
12+
13+
``` python
14+
from devo_ml.modelmanager import create_client_from_token
615

16+
url = "<model-manager-server-url>"
17+
token = "<valid-access-token>"
718

8-
## Usage
19+
client = create_client_from_token(url, token)
920

21+
client.add_model(
22+
"pokemon_onnx_regression", # model name
23+
"ONNX", # model engine
24+
"~/models/pokemon.onnx", # model file
25+
description="A funny Pokemon prediction"
26+
)
27+
```
28+
29+
## Requirements
30+
31+
* Python 3.7+
32+
33+
## Install
1034

11-
## Licence
35+
``` console
36+
$ pip install devo-mlmodelmanager
37+
```
1238

39+
## Documentation
1340

41+
Explore the [documentation](https://devoinc.github.io/python-mlmodelmanager-client/) to learn more.

devo_ml/modelmanager/__init__.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
# flake8: noqa
1+
"""Easy-to-use ML Model Manager interface."""
22

3-
from .client import Client, LegacyClient
4-
from .client_factory import create_client_from_token, create_client_from_profile
5-
from .func_facade import get_models, get_model, find_model, add_model
3+
from ._client import Client, LegacyClient
4+
from ._client_factory import create_client_from_token
5+
from ._client_factory import create_client_from_profile
6+
from ._func_facade import get_models, get_model, find_model, add_model
7+
8+
9+
__all__ = [
10+
"Client",
11+
"LegacyClient",
12+
"create_client_from_token",
13+
"create_client_from_profile",
14+
"get_models",
15+
"get_model",
16+
"find_model",
17+
"add_model",
18+
]

devo_ml/modelmanager/client.py renamed to devo_ml/modelmanager/_client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""Clients for ML Model Manager server."""
2-
31
from __future__ import annotations
42

53
import os
@@ -9,8 +7,8 @@
97
from .auth import AuthCallable
108
from .api import Api
119
from .downloader import DownloaderCallable, get_default_downloader
12-
from .endpoint import EndpointRenderer
13-
from .endpoint import LatestEndpointRenderer, LegacyEndpointRenderer
10+
from ._endpoint import EndpointRenderer
11+
from ._endpoint import LatestEndpointRenderer, LegacyEndpointRenderer
1412
from .error import ModelManagerError, ModelNotFound, ModelAlreadyExists
1513

1614

devo_ml/modelmanager/client_factory.py renamed to devo_ml/modelmanager/_client_factory.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"""A set of convenient client factories."""
2-
31
from .auth import create_auth_from_token, get_default_auth_type
4-
from .client import Client
2+
from ._client import Client
53
from .downloader import FileSystemDownloader
64
from .profile import read_profile_from_file
75

@@ -22,7 +20,8 @@ def create_client_from_token(
2220
:param auth_type: The type of authentication to use;
2321
:const:`STANDALONE <devo_ml.modelmanager.auth.STANDALONE>` or
2422
:const:`BEARER <devo_ml.manager.auth.BEARER>`.
25-
:func:`get_default_auth_type() <devo_ml.manager.auth.get_default_auth_type>`
23+
:func:`get_default_auth_type()
24+
<devo_ml.manager.auth.get_default_auth_type>`
2625
is used if is not provided
2726
:param download_path: The path where model files will be downloaded. The
2827
current directory ``.`` is used if not provided.

devo_ml/modelmanager/endpoint.py renamed to devo_ml/modelmanager/_endpoint.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
"""The ways that endpoints of ML Model Manager can be render."""
2-
31
from __future__ import annotations
42

53
import abc

0 commit comments

Comments
 (0)