From 12a8384f80d1df2ec46610bbb7acefba3615a00f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 2 Feb 2018 15:14:52 -0200 Subject: [PATCH] Add recipes for trio and async_generator --- recipes/async_generator/meta.yaml | 64 +++++++++++++++++++++++++++++ recipes/trio/meta.yaml | 67 +++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 recipes/async_generator/meta.yaml create mode 100644 recipes/trio/meta.yaml diff --git a/recipes/async_generator/meta.yaml b/recipes/async_generator/meta.yaml new file mode 100644 index 0000000000000..2cca27f0be699 --- /dev/null +++ b/recipes/async_generator/meta.yaml @@ -0,0 +1,64 @@ +{% set name = "async_generator" %} +{% set version = "1.9" %} +{% set hash_type = "sha256" %} +{% set hash_value = "b7d5465c6174fe86dba498ececb175f93a6097ffb7cc91946405e1f05b848371" %} + +package: + name: '{{ name|lower }}' + version: '{{ version }}' + +source: + fn: '{{ name }}-{{ version }}.tar.gz' + url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz + '{{ hash_type }}': '{{ hash_value }}' + +build: + number: 0 + script: python setup.py install --single-version-externally-managed --record=record.txt + noarch: python + +requirements: + build: + - python + - setuptools + run: + - python + +test: + imports: + - async_generator + - async_generator._tests + +about: + home: https://github.com/python-trio/async_generator + license: MIT + license_family: MIT + license_file: '' + summary: Async generators and context managers for Python 3.5+ + description: ".. image:: https://img.shields.io/badge/chat-join%20now-blue.svg\n :target: https://gitter.im/python-trio/general\n :alt: Join chatroom\n\n.. image:: https://img.shields.io/badge/docs-read%20now-blue.svg\n\ + \ :target: https://async-generator.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://travis-ci.org/njsmith/async_generator.svg?branch=master\n :target:\ + \ https://travis-ci.org/njsmith/async_generator\n :alt: Automated test status\n\n.. image:: https://ci.appveyor.com/api/projects/status/af4eyed8o8tc3t0r/branch/master?svg=true\n :target: https://ci.appveyor.com/project/python-trio/trio/history\n\ + \ :alt: Automated test status (Windows)\n\n.. image:: https://codecov.io/gh/njsmith/async_generator/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/njsmith/async_generator\n :alt:\ + \ Test coverage\n\nThe async_generator library\n===========================\n\nPython 3.6 added `async generators\n`__. (What's an async\ngenerator? `Check\ + \ out my 5-minute lightning talk demo from PyCon 2016\n`__.) Python 3.7 adds some more\ntools to make them usable, like ``contextlib.asynccontextmanager``.\n\n\ + This library gives you all that back to Python 3.5.\n\nFor example, this code only works in Python 3.6+:\n\n.. code-block:: python3\n\n async def load_json_lines(stream_reader):\n async for\ + \ line in stream_reader:\n yield json.loads(line)\n\nBut this code does the same thing, and works on Python 3.5+:\n\n.. code-block:: python3\n\n from async_generator import async_generator,\ + \ yield_\n\n @async_generator\n async def load_json_lines(stream_reader):\n async for line in stream_reader:\n await yield_(json.loads(line))\n\nOr in Python 3.7, you can write:\n\ + \n.. code-block:: python3\n\n from contextlib import asynccontextmanager\n\n @asynccontextmanager\n async def background_server():\n async with trio.open_nursery() as nursery:\n \ + \ value = await nursery.start(my_server)\n try:\n yield value\n finally:\n # Kill the server when the scope exits\n nursery.cancel_scope.cancel()\n\ + \nThis is the same, but back to 3.5:\n\n.. code-block:: python3\n\n from async_generator import async_generator, yield_, asynccontextmanager\n\n @asynccontextmanager\n @async_generator\n async\ + \ def background_server():\n async with trio.open_nursery() as nursery:\n value = await nursery.start(my_server)\n try:\n await yield_(value)\n finally:\n\ + \ # Kill the server when the scope exits\n nursery.cancel_scope.cancel()\n\n(And if you're on 3.6, you can use ``@asynccontextmanager`` with\nnative generators.)\n\n\nLet's\ + \ do this\n=============\n\n* Install: ``python3 -m pip install -U async_generator`` (or on Windows,\n maybe ``py -3 -m pip install -U async_generator``\n\n* Manual: https://async-generator.readthedocs.io/\n\ + \n* Bug tracker and source code: https://github.com/python-trio/async_generator\n\n* Real-time chat: https://gitter.im/python-trio/general\n\n* License: MIT or Apache 2, your choice\n\n* Contributor\ + \ guide: https://trio.readthedocs.io/en/latest/contributing.html\n\n* Code of conduct: Contributors are requested to follow our `code of\n conduct\n `__\ + \ in\n all project spaces.\n\n\nHow come some of those links talk about \"trio\"?\n===============================================\n\n`Trio `__ is a new async concurrency\n\ + library for Python that's obsessed with usability and correctness \u2013 we\nwant to make it *easy* to get things *right*. The ``async_generator``\nlibrary is maintained by the Trio project as part\ + \ of that mission, and\nbecause Trio uses ``async_generator`` internally.\n\nYou can use ``async_generator`` with any async library. It works great\nwith ``asyncio``, or Twisted, or whatever you like.\ + \ (But we think Trio\nis pretty sweet.)\n\n\n" + doc_url: '' + dev_url: '' + +extra: + recipe-maintainers: + - nicoddemus diff --git a/recipes/trio/meta.yaml b/recipes/trio/meta.yaml new file mode 100644 index 0000000000000..7ca9499bd66af --- /dev/null +++ b/recipes/trio/meta.yaml @@ -0,0 +1,67 @@ +{% set name = "trio" %} +{% set version = "0.3.0" %} +{% set hash_type = "sha256" %} +{% set hash_value = "d54fcfb12305bbdaa11843efe22c130acdbc72fa7dafb9c5d777051de3fbd72e" %} + +package: + name: '{{ name|lower }}' + version: '{{ version }}' + +source: + fn: '{{ name }}-{{ version }}.tar.gz' + url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz + '{{ hash_type }}': '{{ hash_value }}' + +build: + skip: True # [py27] + number: 0 + script: python setup.py install --single-version-externally-managed --record=record.txt + +requirements: + build: + - python + - setuptools + run: + - python + - attrs + - sortedcontainers + - async_generator >=1.6 + - idna + - cffi # [win] + +test: + imports: + - trio + - trio._core + - trio._core.tests + - trio._core.tests.test_multierror_scripts + - trio.testing + - trio.tests + +about: + home: https://github.com/python-trio/trio + license: MIT + license_family: MIT + license_file: '' + summary: An async/await-native I/O library for humans and snake people + description: ".. image:: https://cdn.rawgit.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg\n :width: 200px\n :align: right\n\nThe Trio project's goal is\ + \ to produce a production-quality, `permissively\nlicensed `__,\nasync/await-native I/O library for Python. Like all async libraries,\nits main\ + \ purpose is to help you write programs that do **multiple\nthings at the same time** with **parallelized I/O**. A web spider that\nwants to fetch lots of pages in parallel, a web server that needs\ + \ to\njuggle lots of downloads and websocket connections at the same time, a\nprocess supervisor monitoring multiple subprocesses... that sort of\nthing. Compared to other libraries, Trio attempts to\ + \ distinguish\nitself with an obsessive focus on **usability** and\n**correctness**. Concurrency is complicated; we try to make it *easy*\nto get things *right*.\n\nTrio was built from the ground up\ + \ to take advantage of the `latest\nPython features `__, and\ndraws inspiration from `many sources\n`__,\ + \ in\nparticular Dave Beazley's `Curio `__.\nThe resulting design is radically simpler than older competitors like\n`asyncio `__\ + \ and\n`Twisted `__, yet just as capable. Trio is\nthe Python I/O library I always wanted; I find it makes building\nI/O-oriented programs easier, less error-prone, and just\ + \ plain more\nfun. Perhaps you'll find the same.\n\nThis project is young and still somewhat experimental: the overall\ndesign is solid and the existing features are fully tested and\ndocumented, but\ + \ you may encounter missing functionality or rough\nedges. We *do* encourage you do use it, but you should `read and\nsubscribe to issue #1\n`__ to get\ + \ warning and a\nchance to give feedback about any compatibility-breaking changes.\n\nVital statistics:\n\n* Supported environments: Linux, MacOS, or Windows running some kind of Python\n 3.5-or-better\ + \ (either CPython or PyPy3 is fine). \\*BSD and illumus likely\n work too, but are not tested.\n\n* Install: ``python3 -m pip install -U trio`` (or on Windows, maybe\n ``py -3 -m pip install -U trio``).\ + \ No compiler needed.\n\n* Tutorial and reference manual: https://trio.readthedocs.io\n\n* Bug tracker and source code: https://github.com/python-trio/trio\n\n* License: MIT or Apache 2, your choice\n\ + \n* Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html\n\n* Code of conduct: Contributors are requested to follow our `code of\n conduct\n `_\n\ + \ in all project spaces.\n\n\n" + doc_url: '' + dev_url: '' + +extra: + recipe-maintainers: + - nicoddemus