Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Apr 25, 2016
1 parent ab6dd82 commit 15086aa
Show file tree
Hide file tree
Showing 64 changed files with 4,682 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
cover/

# Translations
*.mo
Expand All @@ -52,3 +53,6 @@ docs/_build/

# PyBuilder
target/

# Atom
*.cson
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
language: python
sudo: required
services:
- docker
python:
- 2.7
- 3.3
- 3.4
- 3.5
- pypy
- pypy3

env:
global:
- DOCKER_VERSION=1.10.2-0~trusty
- DOCKER_COMPOSE_VERSION=1.7.0

before_install:
# upgrade docker-engine to specific version
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine=${DOCKER_VERSION}

# reinstall docker-compose at specific version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin

install:
- pip install -e .[test]
- pip install coverage coveralls
before_script:
- docker-compose up -d
script:
- nosetests --with-coverage
after_success:
- coveralls --rcfile=coverage.rc

matrix:
allow_failures:
- python: pypy3
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Changelog
=========

Current
-------

- Proper github publication
- Initial S3, GridFS and Swift backend implementations
- Python 3 fixes


0.1 (2015-04-07)
----------------

- Initial release
77 changes: 77 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Contributing
============

Flask-FS is open-source and very open to contributions.

Submitting issues
-----------------

Issues are contributions in a way so don't hesitate
to submit reports on the `official bugtracker`_.

Provide as much informations as possible to specify the issues:

- the flask-fs version used
- a stacktrace
- installed applications list
- a code sample to reproduce the issue
- ...


Submitting patches (bugfix, features, ...)
------------------------------------------

If you want to contribute some code:

1. fork the `official Flask-FS repository`_
2. create a branch with an explicit name (like ``my-new-feature`` or ``issue-XX``)
3. do your work in it
4. rebase it on the master branch from the official repository (cleanup your history by performing an interactive rebase)
5. submit your pull-request

There are some rules to follow:

- your contribution should be documented (if needed)
- your contribution should be tested and the test suite should pass successfully
- your code should be mostly PEP8 compatible with a 120 characters line length
- your contribution should support both Python 2 and 3 (use ``tox`` to test)

You need to install some dependencies to develop on Flask-FS:

.. code-block:: console
$ pip install -e .[test,dev]
An Invoke ``tasks.py`` is provided to simplify the common tasks:

.. code-block:: console
$ inv -l
Available tasks:
all Run tests, reports and packaging
clean Cleanup all build artifacts
cover Run tests suite with coverage
dist Package for distribution
doc Build the documentation
qa Run a quality report
test Run tests suite
tox Run tests against Python versions
To ensure everything is fine before submission, use ``tox``.
It will run the test suite on all the supported Python version
and ensure the documentation is generating.

.. code-block:: console
$ tox
You also need to ensure your code is compliant with the flask-restplus coding standards:

.. code-block:: console
$ inv qa
.. _official Flask-FS repository: https://github.com/noirbizarre/flask-fs
.. _official bugtracker: https://github.com/noirbizarre/flask-fs/issues
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include README.rst CHANGELOG.rst MANIFEST.in LICENSE
recursive-include flask_fs *
recursive-include requirements *

global-exclude *.pyc
4 changes: 0 additions & 4 deletions README.md

This file was deleted.

69 changes: 69 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
========
Flask-FS
========

.. image:: https://secure.travis-ci.org/noirbizarre/flask-fs.png
:target: http://travis-ci.org/noirbizarre/flask-fs
:alt: Build status
.. image:: https://coveralls.io/repos/noirbizarre/flask-fs/badge.png?branch=master
:target: https://coveralls.io/r/noirbizarre/flask-fs?branch=master
:alt: Code coverage
.. image:: https://requires.io/github/noirbizarre/flask-fs/requirements.png?branch=master
:target: https://requires.io/github/noirbizarre/flask-fs/requirements/?branch=master
:alt: Requirements Status
.. image:: https://readthedocs.org/projects/flask-fs/badge/?version=latest
:target: http://flask-fs.readthedocs.org/en/latest/
:alt: Documentation status

Simple and easy file storages for Flask


Compatibility
=============

Flask-FS requires Python 2.7+ and Flask 0.10+.

Amazon S3 support requires Boto3.

GridFS support requires PyMongo 3+.

OpenStack Swift support requires python-swift-client.


Installation
============

You can install Flask-FS with pip:

.. code-block:: console
$ pip install flask-fs
# or
$ pip install flask-fs[s3] # For Amazon S3 backend support
$ pip install flask-fs[swift] # For OpenStack swift backend support
$ pip install flask-fs[gridfs] # For GridFS backend support
$ pip install flask-fs[all] # To include all dependencies for all backends
Quick start
===========

.. code-block:: python
from flask import Flask
from flask.ext import fs
app = Flask(__name__)
fs.init_app(app)
images = fs.Storage('images')
if __name__ == '__main__':
app.run(debug=True)
Documentation
=============

The full documentation is hosted `on Read the Docs <http://flask-fs.readthedocs.org/en/latest/>`_
27 changes: 27 additions & 0 deletions bumpr.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[bumpr]
file = flask_fs/__about__.py
vcs = git
commit = true
tag = true
tests = tox
publish =
python setup.py sdist bdist_wheel register upload
clean =
inv clean
files =
README.rst

[bump]
unsuffix = true

[prepare]
part = patch
suffix = dev

[changelog]
file = CHANGELOG.rst
bump = {version} ({date:%Y-%m-%d})
prepare = Current

[readthedoc]
id = flask-fs
25 changes: 25 additions & 0 deletions coverage.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[run]
source = flask_fs
branch = True
omit =
/tests/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "2"

services:
mongo:
image: mongo:3.2
ports:
- "27017:27017"

s3:
image: minio/minio
environment:
MINIO_ACCESS_KEY: ABCDEFGHIJKLMNOQRSTU
MINIO_SECRET_KEY: abcdefghiklmnoqrstuvwxyz1234567890abcdef
command: /export
ports:
- "9000:9000"

swift:
image: aerofs/swift
ports:
- "8080:8080"

0 comments on commit 15086aa

Please sign in to comment.