Skip to content

Commit

Permalink
Merge pull request #1 from Yupeek/develop
Browse files Browse the repository at this point in the history
merge develop: add flake8 and isort
  • Loading branch information
darius committed May 4, 2017
2 parents 78b8ff7 + 5b6b594 commit 3b73560
Show file tree
Hide file tree
Showing 22 changed files with 1,216 additions and 1,036 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Expand Up @@ -8,11 +8,14 @@ python:
- "3.4"
- "3.5"
- "3.6"
before_script:
- isort --recursive --check-only --diff src
- flake8 src


# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- pip install tox-travis
- pip install python-coveralls
- pip install tox-travis python-coveralls flake8 isort
- travis_retry pip install "virtualenv<14.0.0" "tox>=1.9"

# Command to run tests, e.g. python setup.py test
Expand Down
118 changes: 118 additions & 0 deletions CONTRIBUTING.rst
@@ -0,0 +1,118 @@
============
Contributing
============

Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.

You can contribute in many ways:

Types of Contributions
----------------------

Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/Yupeek/booleano/issues.

If you are reporting a bug, please include:

* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
* maybe some fixture to reproduce the bug

Fix Bugs
~~~~~~~~

Look through the GitHub issues for bugs. Anything tagged with "bug"
is open to whoever wants to implement it.

Implement Features
~~~~~~~~~~~~~~~~~~

Look through the GitHub issues for features. Anything tagged with "feature"
is open to whoever wants to implement it.

Write Documentation
~~~~~~~~~~~~~~~~~~~

booleano could always use more documentation, whether as part of the
official booleano docs, in docstrings, or even on the web in blog posts,
articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/Yupeek/booleano/issues.

If you are proposing a feature:

* Explain in detail how it would work.
* Keep the scope as narrow as possible, to make it easier to implement.
* Remember that this is a volunteer-driven project, and that contributions
are welcome :)

Get Started!
------------

Ready to contribute? Here's how to set up `booleano` for local development.

1. Fork the `booleano` repo on GitHub.
2. Clone your fork locally::

$ git clone https://github.com/your_username_here/booleano.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::

$ mkvirtualenv booleano
$ cd booleano/
$ pip install -r requirements.txt
$ python setup.py develop

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::

$ flake8 src tests
$ isort src
$ tox

To get flake8, isort and tox, just pip install them into your virtualenv.

6. Build the doc::

$ python setup doc

check the resulting html in docs/build/html/

7. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the GitHub website.



Pull Request Guidelines
-----------------------

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.3, 3.4, 3.5. Check
https://travis-ci.org/Yupeek/booleano/pull_requests
and make sure that the tests pass for all supported Python versions.



43 changes: 43 additions & 0 deletions README.rst
@@ -1,3 +1,4 @@
=========================================
Booleano: Boolean Expressions Interpreter
=========================================

Expand Down Expand Up @@ -47,8 +48,50 @@ in pure Python. These filters are particularly useful to build reusable
conditions from objects provided by a third party library.


The Fun Use Case
----------------

Booleano allow to safely evaluate an expression into something usable.

``user:name is "john" and user:surname in {"doe", "shepard"}``

+

``{"user": {"name": "katara", "surname"}}`` => False
``{"user": {"name": "john", "doe"}}`` => True

with some code, you can provide any type you want, and the expression can still be in text:

``user:birthdate > "03-07-1987"``
``duration > 1m30s``



Documentation
-------------

The full documentation is at http://django-rest-models.readthedocs.org/en/latest/.


Contribute
----------

this project was not created by the current maintainer. in fact, the knowlege of this project from us is fare from
perfect, but with 100% of test coverages, it's not hard to keep it running.

if you find a bug, or want some feature, feel free to create a issues, or a Pull Request, but keep in mind that
it can be hard for us to work on it. the best way to have it fixed, it's to write a Pull Request with passing tests,
and we will merge it if it's a good piece of code.

see CONTRIBUTING.rst to know how work with ease on this project.


Credit
------

**forked** from Gustavo Narea's booleano project on `launchpad.net <https://launchpad.net/booleano>`_.

**maintened** by yupeek


Links
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
@@ -1 +1 @@
1.0a2
1.1a1
10 changes: 10 additions & 0 deletions docs/source/index.rst
Expand Up @@ -23,6 +23,16 @@ Booleano: Boolean Expressions Interpreter
conditions from objects provided by a third party library.


The Fun Use Case
----------------

Booleano allow to safely evaluate an expression into something usable.

``user:name is "john" and user:surname in {"doe", "shepard"}``
+
``{"user": {"name": "katara", "surname"}}`` => False
``{"user": {"name": "john", "doe"}}`` => True

The Three Use Cases
-------------------

Expand Down
14 changes: 14 additions & 0 deletions setup.cfg
Expand Up @@ -4,6 +4,20 @@ description-file = README.rst
universal = 1


[coverage:run]
omit = docs

[isort]
line_length=119
default_section=THIRDPARTY
import_heading_firstparty=
known_first_party=booleano,tests
not_skip = __init__.py

[flake8]

ignore = E402

[nosetests]
where = tests
verbose = 1
Expand Down
24 changes: 22 additions & 2 deletions setup.py
Expand Up @@ -27,17 +27,33 @@
# use or other dealings in this Software without prior written authorization.

import os
import sys

try:
from setuptools import setup
except ImportError:
from distutils.core import setup



HERE = os.path.abspath(os.path.dirname(__file__))
VERSION = open(os.path.join(HERE, "VERSION.txt")).readline().rstrip()
README = open(os.path.join(HERE, "README.rst")).read()


if sys.argv[-1] == 'publish':
# os.system('cd docs && make html')
os.system('python setup.py sdist bdist_wheel upload')
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'version %s'" % (VERSION, VERSION))
print(" git push --tags")
sys.exit()

if sys.argv[-1] == 'doc':
os.system('cd docs && make html')
sys.exit()


setup(name="booleano",
version=VERSION,
description="Boolean Expressions Interpreter",
Expand All @@ -49,15 +65,19 @@
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
"Topic :: Scientific/Engineering :: Human Machine Interfaces",
"Topic :: Software Development :: Libraries",
"Topic :: Text Processing :: Linguistic",
],
keywords="boolean expression natural language condition conditions",
author="Gustavo Narea",
author_email="me@gustavonarea.net",
url="http://code.gustavonarea.net/booleano/",
download_url="https://launchpad.net/booleano/+download",
url="https://github.com/Yupeek/booleano",
download_url="https://github.com/Yupeek/booleano",
license="MIT X License (http://www.opensource.org/licenses/mit-license.php)",
namespace_packages=["booleano"],
package_dir={'': "src"},
Expand Down
17 changes: 9 additions & 8 deletions src/booleano/__init__.py
@@ -1,36 +1,37 @@
# -*- coding: utf-8 -*-
#

# Copyright (c) 2009 by Gustavo Narea <http://gustavonarea.net/>.
#

# This file is part of Booleano <http://code.gustavonarea.net/booleano/>.
#

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, distribute with
# modifications, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following
# conditions:
#

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
# IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the sale,
# use or other dealings in this Software without prior written authorization.

# Namespace package here! See:
# http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
from __future__ import unicode_literals
try: #pragma: no cover

try: # pragma: no cover
__import__('pkg_resources').declare_namespace(__name__)
except ImportError: #pragma: no cover
except ImportError: # pragma: no cover
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

0 comments on commit 3b73560

Please sign in to comment.