Skip to content

Commit

Permalink
chore: Reorganized directory structure and cleaned up packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kgriffs committed Jan 22, 2013
1 parent 04a4598 commit 2b91261
Show file tree
Hide file tree
Showing 49 changed files with 93 additions and 2,264 deletions.
1 change: 1 addition & 0 deletions AUTHORS
@@ -1,4 +1,5 @@
Falcon is written by various contributors (by date of contribution):

Kurt Griffiths (kgriffs)
Alejandro Cabrera (cabrera)

19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -19,6 +19,25 @@ Falcon is a *really* fast, light-weight framework for building cloud APIs. It tr

**Cloud-friendly.** Falcon uses the web-friendly Python language, and speaks WSGI, so you can deploy it on your favorite stack. The framework is designed from the ground up to embrace HTTP, not work against it. Plus, diagnostics are built right in to make it easier to track down sneaky bugs and frustrating performance problems.


### Install ###

```bash
$ pip install falcon
```

### Test ###

```bash
$ python setup.py test
```

To test across all supported Python versions:

```bash
$ pip install tox && tox
```

### Usage ###

More/better docs are on our TODO list, but in the meantime, here is a simple example showing how to create a Falcon-based API.
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions falcon/bench/bench.py → bench/bench.py
Expand Up @@ -6,8 +6,8 @@

from create import *

sys.path.append('../..')
import falcon.test.helpers as helpers
sys.path.append('..')
import tests.helpers as helpers
del sys.path[-1]


Expand All @@ -16,7 +16,7 @@ def avg(array):


def bench(name):
iterations = 10000
iterations = 100000

func = create_bench(name)
results = repeat(func, number=iterations)
Expand Down Expand Up @@ -63,7 +63,7 @@ def bench():
ms_per_req = sec_per_req * 1000
factor = int(baseline / sec_per_req)

print('{3}. {0:.<15s}{1:.>06,.0f} req/sec or {2:0.2f} ms/req ({4}x)'.
print('{3}. {0:.<15s}{1:.>06,.0f} req/sec or {2:0.3f} ms/req ({4}x)'.
format(name, req_per_sec, ms_per_req, i + 1, factor))

print('')
2 changes: 1 addition & 1 deletion falcon/bench/create.py → bench/create.py
Expand Up @@ -13,7 +13,7 @@
import app as nuts
del sys.path[-1]

sys.path.append('../..')
sys.path.append('..')
import falcon
del sys.path[-1]

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
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.
21 changes: 5 additions & 16 deletions falcon/__init__.py
Expand Up @@ -16,20 +16,9 @@
"""

version_tuple = (0, 0, 1, '-dev')


def get_version_string():
if version_tuple[-1] is not None:
return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]

return '.'.join(map(str, version_tuple))

version = get_version_string()
"""Current version of Falcon."""

# Hoist classes and functions into the falcon namespace
from .api import API
from .status_codes import *
from .exceptions import *
from .http_error import HTTPError
from falcon.version import version
from falcon.api import API
from falcon.status_codes import *
from falcon.exceptions import *
from falcon.http_error import HTTPError
2,212 changes: 0 additions & 2,212 deletions falcon/bench/results.txt

This file was deleted.

4 changes: 2 additions & 2 deletions falcon/exceptions.py
Expand Up @@ -19,8 +19,8 @@
"""

from .http_error import HTTPError
from .status_codes import *
from falcon.http_error import HTTPError
from falcon.status_codes import *


class HTTPBadRequest(HTTPError):
Expand Down
4 changes: 2 additions & 2 deletions falcon/http_error.py
Expand Up @@ -16,10 +16,10 @@
"""

import json
from collections import OrderedDict

from .status_codes import *
import json
from falcon.status_codes import *


class HTTPError(Exception):
Expand Down
4 changes: 2 additions & 2 deletions falcon/request.py
Expand Up @@ -19,8 +19,8 @@
import sys
from datetime import datetime

from .request_helpers import *
from .exceptions import *
from falcon.request_helpers import *
from falcon.exceptions import *


class Request(object):
Expand Down
2 changes: 1 addition & 1 deletion falcon/responders.py
Expand Up @@ -16,7 +16,7 @@
"""

from .status_codes import *
from falcon.status_codes import *


def path_not_found(req, resp):
Expand Down
22 changes: 22 additions & 0 deletions falcon/version.py
@@ -0,0 +1,22 @@
"""Falcon version
Copyright 2013 by Rackspace Hosting, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

VERSION_TUPLE = (0, 0, 1, '-dev')

version = '.'.join(map(str, VERSION_TUPLE[:-1])) + VERSION_TUPLE[-1]
"""Current version of Falcon."""
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[egg_info]
tag_build = dev
45 changes: 23 additions & 22 deletions setup.py
@@ -1,37 +1,38 @@
from setuptools import setup, find_packages
import os

import falcon
import falcon.version

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
NEWS = open(os.path.join(here, 'NEWS.md')).read()

# install_requires = [
# 'python-statsd>=1.5.7'
# ]

setup(
name='falcon',
version=falcon.version,
description="Falcon is a fast micro-framework for building cloud APIs.",
long_description=README + '\n\n' + NEWS,
description='A fast micro-framework for building cloud APIs.',
long_description=None,
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Topic :: Software Development :: Libraries :: Application Frameworks"
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Natural Language :: English',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Topic :: Internet :: WWW/HTTP :: WSGI',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Application Frameworks'
],
keywords='wsgi web api framework rest http',
keywords='wsgi web api framework rest http cloud',
author='Kurt Griffiths',
author_email='kgriffs@me.com',
author_email='mail@kgriffs.com',
url='https://github.com/racker/falcon',
license='Apache 2.0',
packages=find_packages('falcon'),
package_dir={'': 'falcon'},
packages=find_packages(exclude=['bench', 'tests']),
include_package_data=True,
zip_safe=False,
install_requires=[]
install_requires=[],

test_suite='nose.collector',
tests_require='nose'
)
1 change: 0 additions & 1 deletion spam

This file was deleted.

1 change: 0 additions & 1 deletion spam.txt

This file was deleted.

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.
File renamed without changes.
9 changes: 9 additions & 0 deletions tox.ini
@@ -0,0 +1,9 @@
[tox]
envlist = py27

[testenv]
deps = nose
nose-progressive
testtools

commands = nosetests --with-progressive

0 comments on commit 2b91261

Please sign in to comment.