Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46edf10e9d | ||
|
|
354ce2e307 | ||
|
|
98ebd5b40e | ||
|
|
c1924f3630 | ||
|
|
b579683287 | ||
|
|
ccdeea9ccf | ||
|
|
027665d9eb |
@@ -273,4 +273,5 @@ docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
*.pypirc
|
||||
*.pypirc
|
||||
MANIFEST
|
||||
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 58 KiB |
@@ -1,14 +0,0 @@
|
||||
# HumbleMatch
|
||||
Will **Sanitize your type-checks and duck-checks** for you
|
||||
|
||||
Available at [HumbleMatch@pypi]()
|
||||
|
||||
|
||||
## What the heck is it?
|
||||
|
||||
HumbleMatch is made to *add a zing* to your mundane type-checking and duck-checking code.
|
||||
|
||||
* Check your function arguments reliably, add *more flexible signatures* and most of all, have a lovely API.
|
||||
* Or just *sprinkle some assert* checks to ensure the data is what you expect it to be at any point.
|
||||
* Provide helpful debugging errors, *dont just fail with cryptic errors*
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
Title: HumbleMatch - Go sanitize your type-checking
|
||||
Date: 2015-06-19 16:56
|
||||
Authors: bendtherules
|
||||
Category: Projects
|
||||
Tags: HumbleMatch, Launch stuff, Projects
|
||||
Slug: HumbleMatch_Launch
|
||||
|
||||
## Intro
|
||||
|
||||
Hi, I am [Abhas](blog.codesp.in) and personally, I love Python mostly for its intuitive, flexible and beautiful API. But some things, I really hate doing. HumbleMatch is my attempt at solving that pain.
|
||||
Hi, I am [Abhas](http://blog.codesp.in) and personally, I love Python mostly for its intuitive, flexible and beautiful API. But some things, I really hate doing. HumbleMatch is my attempt at solving that pain.
|
||||
|
||||
|
||||
## The Pain Point #1
|
||||
|
Before Width: | Height: | Size: 521 KiB After Width: | Height: | Size: 521 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
@@ -0,0 +1,28 @@
|
||||
# HumbleMatch
|
||||
Will **Sanitize your type-checks and duck-checks** for you
|
||||
|
||||
")
|
||||
|
||||
Available at [HumbleMatch@pypi](https://pypi.python.org/pypi/humblematch)
|
||||
|
||||
|
||||
## What the heck is it?
|
||||
|
||||
HumbleMatch is made to *add a zing* to your mundane type-checking and duck-checking code.
|
||||
|
||||
* Check your function arguments reliably, add *more flexible signatures* and most of all, have a lovely API.
|
||||
* Or just *sprinkle some assert* checks to ensure the data is what you expect it to be at any point.
|
||||
* Provide helpful debugging errors, *dont just fail with cryptic errors*
|
||||
|
||||
## Impress me
|
||||
|
||||
Lets say we want a Point class with two __init__ signatures - `Point(x,y)` and `Point([x,y])`.
|
||||
|
||||
Assume its `__init__` signature looks like `def __init__(self, x, y=None)`
|
||||
|
||||
This is the only typechecking code you'll need for valid arguments.
|
||||
|
||||
from humblematch import w
|
||||
assert( w([int, int]) == [x, y] or w([[int, int], None]) == [x, y] )
|
||||
|
||||
If you like it, please move to the [Tutorials](./tutorial). Its a bit long, but that all the documentation youll need to know.
|
||||
@@ -109,6 +109,8 @@ save_as in multimatch with list behaviour(done)
|
||||
|
||||
Any and OR save_as (done)
|
||||
|
||||
name change to humblematch (done)
|
||||
|
||||
test if data == Multi branch, raise error doesnt break anything
|
||||
more docs
|
||||
|
||||
@@ -122,4 +124,3 @@ more doctest for other methods and helpers
|
||||
|
||||
test helpers
|
||||
|
||||
name change to humblematch
|
||||
@@ -1,4 +1,4 @@
|
||||
from wrap_obj import WrapObj, Any, OR, w
|
||||
from humblematch import WrapObj, Any, OR, w
|
||||
import collections
|
||||
import pytest
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
site_name: HumbleMatch
|
||||
|
||||
theme: cerulean
|
||||
|
||||
docs_dir: humblematch/docs
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
Run doctest -
|
||||
python -m doctest .\wrap_obj.py
|
||||
|
||||
Run py.test-
|
||||
py.test
|
||||
@@ -0,0 +1,49 @@
|
||||
# HumbleMatch
|
||||
--------------
|
||||
Will **Sanitize your type-checks and duck-checks** for you
|
||||
|
||||
")
|
||||
|
||||
Available at [HumbleMatch@pypi](https://pypi.python.org/pypi/humblematch)
|
||||
|
||||
More Docs at [projects.codesp.in/humblematch](http://humblematch.readthedocs.org/en/latest/)
|
||||
|
||||
## What the heck is it?
|
||||
|
||||
HumbleMatch is made to *add a zing* to your mundane type-checking and duck-checking code.
|
||||
|
||||
* Check your function arguments reliably, add *more flexible signatures* and most of all, have a lovely API.
|
||||
* Or just *sprinkle some assert* checks to ensure the data is what you expect it to be at any point.
|
||||
* Provide helpful debugging errors, *dont just fail with cryptic errors*
|
||||
|
||||
|
||||
## Get Running
|
||||
--------------
|
||||
|
||||
### Run doctest -
|
||||
|
||||
python -m doctest .\wrap_obj.py
|
||||
|
||||
### Run tests-
|
||||
cd humblematch
|
||||
py.test
|
||||
|
||||
### To build code -
|
||||
|
||||
python setup.py sdist bdist_wheel
|
||||
python setup.py build --plat-name=win-amd64 bdist_wininst
|
||||
python setup.py build --plat-name=win32 bdist_wininst
|
||||
|
||||
### To upload to PYPI-
|
||||
|
||||
twine upload dist/*
|
||||
|
||||
### To build or serve docs
|
||||
|
||||
mkdocs build
|
||||
|
||||
or
|
||||
|
||||
mkdocs serve
|
||||
|
||||
-----
|
||||
@@ -1,2 +1,5 @@
|
||||
[metadata]
|
||||
description-file = README
|
||||
description-file = readme.md
|
||||
|
||||
[bdist_wheel]
|
||||
universal=1
|
||||
|
||||
@@ -1,14 +1,43 @@
|
||||
from distutils.core import setup
|
||||
import sys
|
||||
from setuptools import setup
|
||||
from setuptools.command.test import test as TestCommand
|
||||
|
||||
|
||||
class PyTest(TestCommand):
|
||||
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
|
||||
|
||||
def initialize_options(self):
|
||||
TestCommand.initialize_options(self)
|
||||
self.pytest_args = []
|
||||
|
||||
def finalize_options(self):
|
||||
TestCommand.finalize_options(self)
|
||||
self.test_args = []
|
||||
self.test_suite = True
|
||||
|
||||
def run_tests(self):
|
||||
# import here, cause outside the eggs aren't loaded
|
||||
import pytest
|
||||
errno = pytest.main(self.pytest_args)
|
||||
sys.exit(errno)
|
||||
|
||||
|
||||
setup(
|
||||
name='humblematch',
|
||||
packages=['humblematch'], # this must be the same as the name above
|
||||
version='0.1.dev1',
|
||||
version='0.1.dev2',
|
||||
description='Will Sanitize your type-checks and duck-checks for you',
|
||||
author='bendtherules',
|
||||
author_email='bendtherules@codesp.in',
|
||||
url='https://github.com/bendtherules/humblematch', # use the URL to the github repo
|
||||
download_url='https://github.com/bendtherules/humblematch/tarball/0.1.dev1', # I'll explain this in a second
|
||||
download_url='https://github.com/bendtherules/humblematch/tarball/0.1.dev2', # I'll explain this in a second
|
||||
license='WTFPL',
|
||||
keywords=['type-checking', 'testing', 'assert'], # arbitrary keywords
|
||||
classifiers=['Development Status :: 3 - Alpha', ],
|
||||
package_data={
|
||||
# Include all files in all packages
|
||||
# 'humblematch': ['docs/*.md', 'test/*'],
|
||||
},
|
||||
tests_require=['pytest'],
|
||||
cmdclass={'test': PyTest},
|
||||
)
|
||||
|
||||