mirror of
https://github.com/saymrwulf/zipline.git
synced 2026-05-14 20:58:10 +00:00
61 lines
4 KiB
YAML
61 lines
4 KiB
YAML
{% set name = "python-interface" %}
|
|
{% set version = "1.5.3" %}
|
|
{% set file_ext = "tar.gz" %}
|
|
{% set hash_type = "sha256" %}
|
|
{% set hash_value = "697cdfafc421d7b6919bbc5768730af7b8f27906fd35ecbf40553ec911bdc48f" %}
|
|
|
|
package:
|
|
name: '{{ name|lower }}'
|
|
version: '{{ version }}'
|
|
|
|
source:
|
|
fn: '{{ name }}-{{ version }}.{{ file_ext }}'
|
|
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
|
|
'{{ hash_type }}': '{{ hash_value }}'
|
|
|
|
build:
|
|
number: 0
|
|
script: python setup.py install --single-version-externally-managed --record=record.txt
|
|
|
|
requirements:
|
|
host:
|
|
- python
|
|
- setuptools
|
|
- six
|
|
run:
|
|
- python
|
|
- six
|
|
- funcsigs # [py2k]
|
|
- typing # [py2k or py34]
|
|
|
|
test:
|
|
imports:
|
|
- interface
|
|
- interface.tests
|
|
|
|
about:
|
|
home: https://github.com/ssanderson/interface
|
|
license: Apache Software License
|
|
license_family: APACHE
|
|
license_file: ''
|
|
summary: Pythonic Interface definitions
|
|
description: "``interface``\n=============\n\n|build status|\n\n``interface`` provides facilities for declaring interfaces and for statically\nasserting that classes implement those interfaces. It supports\
|
|
\ Python 2.7 and\nPython 3.4+.\n\n``interface`` improves on Python's ``abc`` module in two ways:\n\n1. Interface requirements are checked at class creation time, rather than at\n instance creation\
|
|
\ time. This means that ``interface`` can tell you if a\n class fails to meet the requirements of an interface even if you never\n create any instances of that class.\n\n2. ``interface`` requires\
|
|
\ that method signatures of interface implementations\n are compatible with the signatures declared in the interface. For example,\n the following code using ``abc`` does not produce an error:\n\
|
|
\n .. code-block:: python\n\n >>> from abc import ABCMeta, abstractmethod\n >>> class Base(metaclass=ABCMeta):\n ... @abstractmethod\n ... def method(self, a, b):\n \
|
|
\ ... pass\n ...\n >>> class Implementation(MyABC):\n ... def method(self):\n ... return \"This shouldn't work.\"\n ...\n >>> impl = Implementation()\n\
|
|
\ >>>\n\n The equivalent code using ``interface`` produces an error indicating that\n the signature of our implementation method is incompatible with the\n signature of our interface declaration:\n\
|
|
\n .. code-block:: python\n\n >>> from interface import implements, Interface\n >>> class I(Interface):\n ... def method(self, a, b):\n ... pass\n ...\n >>>\
|
|
\ class C(implements(I)):\n ... def method(self):\n ... return \"This shouldn't work\"\n ...\n TypeError:\n class C failed to implement interface I:\n\n The\
|
|
\ following methods were implemented but had invalid signatures:\n - method(self) != method(self, a, b)\n\nDefining an Interface\n~~~~~~~~~~~~~~~~~~~~~\n\nTo define an interface, simply subclass\
|
|
\ from ``interface.Interface`` and define\nmethod stubs in your class body.\n\n.. code-block:: python\n\n from interface import Interface\n\n class MyInterface(Interface):\n\n def method1(self):\n\
|
|
\ pass\n\n def method2(self, arg1, arg2):\n pass\n\nImplementing an Interface\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTo declare that a particular class implements an interface ``I``,\
|
|
\ pass\n``implements(I)`` as a base class for your class.\n\n.. code-block:: python\n\n from interface import implements\n\n class MyClass(implements(MyInterface)):\n\n def method1(self):\n\
|
|
\ return \"method1\"\n\n def method2(self, arg1, arg2):\n return \"method2\"\n\nInstallation\n~~~~~~~~~~~~\n\n.. code-block:: shell\n\n $ pip install python-interface\n\n\
|
|
.. |build status| image:: https://travis-ci.org/ssanderson/interface.svg?branch=master\n :target: https://travis-ci.org/ssanderson/interface\n"
|
|
doc_url: ''
|
|
dev_url: ''
|
|
|
|
extra:
|
|
recipe-maintainers: ''
|