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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Ignoring shape predictor
app/data/classifiers/*.dat

# redis dump db
dump.rdb

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dist: xenial
language: python

cache: pip
python:
- '3.7'

install:
- pip install -r requirements.txt
- pip freeze

script:
- pytest
138 changes: 131 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,68 @@
# Contributing to CSSI REST API

We would love for you to contribute to CSSI API and help make it even better than it is
today!
We would love for you to contribute to CSSI REST API and help make
it even better than it is today!. As a contributor, here are the
guidelines for you to follow:

### Type
- [Commit Message Guidelines](#commit)
- [Branch Naming Conventions](#branch-naming)

## <a name="commit"></a> Commit Message Guidelines

We have used `semantic git commits` through out the application and would like to keep them consistent. Please follow the following specified rules when committing your code.

### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

The footer should contain a reference to a bug(issue) if any.

Samples:

```
docs(readme): update readme
```
```
ci(travis): update travis config

With this change, trvis will run the unit tests before building the project.

Fixes #125
Closes #168

PR Close #456
```
### Emojis

Feel free to spice up the git messages with `emojis`. Use the [gitmoji](https://gitmoji.carloscuesta.me/) guide by Carlos Cuesta to create awesome commits.

Samples:

```
docs: update README :memo:

refactor(docs): remove RELEASE guidelines :fire:

fix(build): fix bazel build issue :bug:
```

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.

### Type
Must be one of the following:

- **build**: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
Expand All @@ -18,11 +76,9 @@ Must be one of the following:
- **test**: Adding missing tests or correcting existing tests

### Scope
The scope should be the name of the component affected.

The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages.

The following is the list of supported scopes:

Follow these `<scope>` values:
- **core**
- **common**
- **app**
Expand All @@ -34,3 +90,71 @@ The following is the list of supported scopes:
- **deps**
- **migrations**
- **config**
- **scripts**

* none/empty string: useful for `style`, `test` and `refactor` changes that are done across all packages (e.g. `style: add missing semicolons`)

### Subject
The subject contains a clear description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize the first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

## <a name="branch-naming"></a> Branch Naming Convention

Please follow the following convention when creating new branches.

```
<type>/<name>
```

### Types

<table>
<thead>
<tr>
<th>Prefix</th>
<th>Use case</th>
</tr>
</thead>
<tbody>
<tr>
<td>feature</td>
<td>New feature</td>
</tr>
<tr>
<td>fix</td>
<td>Code change linked to a bug</td>
</tr>
<tr>
<td>hotfix</td>
<td>Quick fixes to the codebase</td>
</tr>
<tr>
<td>release</td>
<td>Code-base releases</td>
</tr>
</tbody>
</table>

### Name
Always use dashes to separate words, and keep it short.

##### Examples
```
feature/config-support
hotfix/upload-size
fix/incorrect-upload-progress
release/1.0.x
```
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
<p align="center">
<img style="display:block;text-align:center" src="./docs/logos/cssi-logo-rest-api.svg" alt="logo-text" width="600" />
<p align="center" style="font-size: 1.2rem;">RESTful API for the CSSI Platform</p>
<p align="left">
<img style="display:block;text-align:center" src="./docs/logo/cssi-logo-rest-api.svg" alt="logo-text" width="600" />
<p style="font-size: 1.2rem;">RESTful API for the CSSI Platform</p>
</p>

<!-- Badges -->
<p align="center">
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fproject-cssi%2Fcssi-api?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fproject-cssi%2Fcssi-api.svg?type=shield"/></a>
<p align="left">
<a href="https://travis-ci.org/project-cssi/cssi-api" alt="Travis">
<img src="https://travis-ci.org/project-cssi/cssi-api.svg?branch=master"/>
</a>
<a href="https://github.com/project-cssi/cssi-api/graphs/contributors" alt="Contributors">
<img src="https://img.shields.io/github/contributors/project-cssi/cssi-api.svg?logo=github"/>
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" height="18">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" height="18">
</a>
<a href="https://requires.io/github/project-cssi/cssi-api/requirements/?branch=master">
<img src="https://requires.io/github/project-cssi/cssi-api/requirements.svg?branch=master" alt="Requirements Status" height="18">
</a>
<a href="https://github.com/project-cssi/cssi-api/stargazers">
<img src="https://img.shields.io/github/stars/project-cssi/cssi-api.svg?logo=github" alt="Github stars" height="18">
</a>
<a href="https://github.com/project-cssi/cssi-api/network/members">
<img src="https://img.shields.io/github/forks/project-cssi/cssi-api.svg?logo=github" alt="Github forks" height="18">
</a>
<a href="https://twitter.com/brion_mario">
<img src="https://img.shields.io/twitter/follow/brion_mario.svg?label=brion_mario&style=flat&logo=twitter&logoColor=4FADFF" alt="Twitter" height="18">
</a>
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fproject-cssi%2Fcssi-api?ref=badge_shield" alt="FOSSA Status">
<img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fproject-cssi%2Fcssi-api.svg?type=shield"/>
</a>

</p>

# Getting Started
Expand Down Expand Up @@ -42,14 +63,18 @@ python manage.py runserver

# Built With

<a href="https://www.python.org/" title="Python"><img src="./docs/technologies/python.svg" alt="python" height="30" /></a>&nbsp;&nbsp;
<a href="http://flask.pocoo.org/" title="Flask"><img src="./docs/technologies/flask.svg" alt="flask" height="30" /></a>&nbsp;&nbsp;
<a href="https://flask-socketio.readthedocs.io/en/latest/" title="Flask SocketIO"><img src="./docs/technologies/flask-socketio.png" alt="redux" height="30" /></a>&nbsp;&nbsp;
<a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/" title="Flask SQL Alchemy"><img src="./docs/technologies/flask-sqlalchemy.png" alt="lodash" height="30" /></a>&nbsp;&nbsp;
<a href="http://www.celeryproject.org/" title="Celery"><img src="./docs/technologies/celery.png" alt="celery" height="50" /></a>&nbsp;&nbsp;
<a href="https://marshmallow.readthedocs.io/en/3.0/" title="Marshmallow"><img src="./docs/technologies/marshmallow.png" alt="marshmallow" height="50" /></a>&nbsp;&nbsp;
<a href="https://www.mysql.com/" title="MySQL"><img src="./docs/technologies/mysql.svg" alt="sass" height="50" /></a>&nbsp;&nbsp;
<a href="https://redis.io/" title="Redis"><img src="./docs/technologies/redis.png" alt="redis" height="30" /></a>&nbsp;&nbsp;
<a href="https://www.python.org/" title="Python"><img src="./docs/readme-resources/technologies/python.svg" alt="python" height="30" /></a>&nbsp;&nbsp;
<a href="http://flask.pocoo.org/" title="Flask"><img src="./docs/readme-resources/technologies/flask.svg" alt="flask" height="30" /></a>&nbsp;&nbsp;
<a href="https://flask-socketio.readthedocs.io/en/latest/" title="Flask SocketIO"><img src="./docs/readme-resources/technologies/flask-socketio.png" alt="redux" height="30" /></a>&nbsp;&nbsp;
<a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/" title="Flask SQL Alchemy"><img src="./docs/readme-resources/technologies/flask-sqlalchemy.png" alt="lodash" height="30" /></a>&nbsp;&nbsp;
<a href="http://www.celeryproject.org/" title="Celery"><img src="./docs/readme-resources/technologies/celery.png" alt="celery" height="50" /></a>&nbsp;&nbsp;
<a href="https://marshmallow.readthedocs.io/en/3.0/" title="Marshmallow"><img src="./docs/readme-resources/technologies/marshmallow.png" alt="marshmallow" height="50" /></a>&nbsp;&nbsp;
<a href="https://www.mysql.com/" title="MySQL"><img src="./docs/readme-resources/technologies/mysql.svg" alt="sass" height="50" /></a>&nbsp;&nbsp;
<a href="https://redis.io/" title="Redis"><img src="./docs/readme-resources/technologies/redis.png" alt="redis" height="30" /></a>&nbsp;&nbsp;

# Releases

Please read the [RELEASES.md](./docs/RELEASES.md) guideline to learn about the process for releasing the project.

# Changelog

Expand Down
1 change: 1 addition & 0 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0,1,0,alpha,1,0,0
82 changes: 82 additions & 0 deletions docs/RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Release Instructions

This document contains all the necessary instructions to release the
project and to generate the corresponding changelog.

## Versioning

We follow the [PEP0440](https://www.python.org/dev/peps/pep-0440/)
versioning standard when releasing `cssi` library. Please read the
[versioning](./VERSIONING.md) guidelines document carefully before
attempting any release related tasks.

## Creating a Release

### Install Changelog Generator

We have used the `git-changelog` package to automate the changelog
generation process. Click
[here](https://pypi.org/project/git-changelog/) to learn more about
`git-changelog`. Execute the below command to install the package on
your machine.

```bash
pip install git-changelog
```

### Using the release script

We have created a script to automate the taging and versioning of the
releae pipeline. Follow the bellow guidelines when using the release
script.

NOTE: Execute the release script from the root directory.

```bash
sh ./scripts/release.sh $release_type $release_level
```

Replace the `$release_type` and `$release_level` with the corresponding
values.

#### Examples

1. Major release - From 1.9 to 2.0

<!-- end list -->

```bash
sh ./scripts/release.sh major final
```

2. Minor release - From 1.1.x to 1.2

<!-- end list -->

```bash
sh ./scripts/release.sh minor final
```

3. Patch release - From 1.1.3 to 1.1.4

<!-- end list -->

```bash
sh ./scripts/release.sh patch final
```

4. Major Alpha release - From 1.9.2 to 1.0a0

<!-- end list -->

```bash
sh ./scripts/release.sh major alpha
```

6. Release next beta - From 0.1b2 to 0.1b3

<!-- end list -->

```bash
sh ./scripts/release.sh prenext beta
```
33 changes: 33 additions & 0 deletions docs/VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Versioning Guidelines

Please follow the following
[PEP0440](https://www.python.org/dev/peps/pep-0440/) release version
standard.

## Final Releases

X(.Y)*

Ex: 0.9
0.9.1
0.9.2

## Pre-releases

X.YaN # Alpha release
X.YbN # Beta release
X.YrcN # Release Candidate
X.Y.Z # For bug-fix releases

## Post-releases

X.YaN.postM # Post-release of an alpha release
X.YbN.postM # Post-release of a beta release
X.YrcN.postM # Post-release of a release candidate

## Developmental releases

X.YaN.devM # Developmental release of an alpha release
X.YbN.devM # Developmental release of a beta release
X.YrcN.devM # Developmental release of a release candidate
X.Y.postN.devM # Developmental release of a post-release
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ flask-socketio==3.3.2
PyMySQL==0.9.3
redis==3.2.1
Pillow
numpy>=1.16.2
numpy>=1.16.2
pytest==4.5.0
Loading