Skip to content

Commit

Permalink
travis, pip pck and coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
santinic committed Nov 9, 2018
1 parent a701fe7 commit 6735e7d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
@@ -0,0 +1,2 @@
service_name: travis-pro
repo_token: 57JUvsvYjPKj6CGTU9SywRs7CdnRCOkqS
16 changes: 16 additions & 0 deletions .travis.yml
@@ -0,0 +1,16 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "nightly"
install:
- "pip install coverage"
- "pip install python-coveralls"
script:
- "python -m unittest discover -s tests"
- "coverage run setup.py test"
after_success:
coveralls
18 changes: 7 additions & 11 deletions README.md
@@ -1,10 +1,12 @@
![Pampy logo](imgs/pampy.png "Pampy in Start Wars")
![Pampy in Star Wars](https://raw.githubusercontent.com/santinic/pampy/master/imgs/pampy.png "Pampy in Star Wars")

# Pampy: Pattern Matching for Python
![License MIT](https://go-shields.herokuapp.com/license-MIT-blue.png)

Pampy is pretty small, pretty fast, and often makes your code more readable, and easier to reason about.

<kbd>
<img src="imgs/slide1.png" width="700">
<img src="https://raw.githubusercontent.com/santinic/pampy/master/imgs/slide1.png" width="700">
</kbd>

## You can write many patterns
Expand Down Expand Up @@ -110,10 +112,9 @@ match(pet, { 'details': { 'age': _ } }, lambda age: age) # => 3
match(pet, { _ : { 'age': _ } }, lambda a, b: (a, b)) # => ('details', 3)
```

What about _ ordering inside nested dict ?
It feels like putting multiple _ inside dicts shouldn't work.
It feels like putting multiple _ inside dicts shouldn't work. Isn't ordering in dicts not guaranteed ?
But it does because
[Python 3.7 dict is in an OrderedDict by default](https://mail.python.org/pipermail/python-dev/2017-December/151283.html)
[in Python 3.7, dict is an OrderedDict by default](https://mail.python.org/pipermail/python-dev/2017-December/151283.html)

## All the things you can match

Expand Down Expand Up @@ -143,19 +144,14 @@ Types and Classes are matched via `instanceof(value, pattern)`.




<!--

## Install

It works for both python2 and python3. To install it:
Currently it works only in Python3. To install it:

```$ pip install pampy```

or
```$ pip3 install pampy```

or
```$ easy_install pampy```-->


21 changes: 21 additions & 0 deletions setup.py
@@ -0,0 +1,21 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="pampy",
version="0.1.1",
author="Claudio Santini",
author_email="hireclaudio@gmail.com",
description="The Pattern Matching for Python you always dreamed of",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/santinic/pampy",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)

0 comments on commit 6735e7d

Please sign in to comment.