Move Botsbuildbots to contrib
Closes #678. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
parent
b38ec6b92d
commit
7db0fcdafb
33
hy/contrib/botsbuildbots.hy
Normal file
33
hy/contrib/botsbuildbots.hy
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
;; Copyright (c) 2014, 2015 Gergely Nagy
|
||||||
|
|
||||||
|
;; 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, 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 AUTHORS OR 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.
|
||||||
|
|
||||||
|
(defun Botsbuildbots () (Botsbuildbots))
|
||||||
|
|
||||||
|
(defmacro Botsbuildbots []
|
||||||
|
"Build bots, repeatedly.^W^W^WPrint the AUTHORS, forever."
|
||||||
|
`(try
|
||||||
|
(do
|
||||||
|
(import [requests])
|
||||||
|
|
||||||
|
(let [[r (requests.get
|
||||||
|
"https://raw.githubusercontent.com/hylang/hy/master/AUTHORS")]]
|
||||||
|
(repeat r.text)))
|
||||||
|
(catch [e ImportError]
|
||||||
|
(repeat "Botsbuildbots requires `requests' to function."))))
|
@ -391,8 +391,6 @@
|
|||||||
(read :from-file (StringIO input)))
|
(read :from-file (StringIO input)))
|
||||||
|
|
||||||
|
|
||||||
(defun Botsbuildbots () (Botsbuildbots))
|
|
||||||
|
|
||||||
(defn zipwith [func &rest lists]
|
(defn zipwith [func &rest lists]
|
||||||
"Zip the contents of several lists and map a function to the result"
|
"Zip the contents of several lists and map a function to the result"
|
||||||
(do
|
(do
|
||||||
@ -425,8 +423,7 @@
|
|||||||
(hyify (. value __name__))
|
(hyify (. value __name__))
|
||||||
(catch [] (string value))))))
|
(catch [] (string value))))))
|
||||||
|
|
||||||
(def *exports* '[Botsbuildbots
|
(def *exports* '[butlast calling-module-name coll? cons cons? cycle
|
||||||
butlast calling-module-name coll? cons cons? cycle
|
|
||||||
dec distinct disassemble drop drop-last drop-while empty? even?
|
dec distinct disassemble drop drop-last drop-while empty? even?
|
||||||
every? first filter filterfalse flatten float? fraction gensym
|
every? first filter filterfalse flatten float? fraction gensym
|
||||||
identity inc input instance? integer integer? integer-char?
|
identity inc input instance? integer integer? integer-char?
|
||||||
|
@ -220,19 +220,6 @@
|
|||||||
`(setv ~name ~main)))
|
`(setv ~name ~main)))
|
||||||
ret))
|
ret))
|
||||||
|
|
||||||
(defmacro Botsbuildbots []
|
|
||||||
"Build bots, repeatedly.^W^W^WPrint the AUTHORS, forever."
|
|
||||||
`(try
|
|
||||||
(do
|
|
||||||
(import [requests])
|
|
||||||
|
|
||||||
(let [[r (requests.get
|
|
||||||
"https://raw.githubusercontent.com/hylang/hy/master/AUTHORS")]]
|
|
||||||
(repeat r.text)))
|
|
||||||
(catch [e ImportError]
|
|
||||||
(repeat "Botsbuildbots requires `requests' to function."))))
|
|
||||||
|
|
||||||
|
|
||||||
(defreader @ [expr]
|
(defreader @ [expr]
|
||||||
(let [[decorators (slice expr nil -1)]
|
(let [[decorators (slice expr nil -1)]
|
||||||
[fndef (get expr -1)]]
|
[fndef (get expr -1)]]
|
||||||
|
@ -20,6 +20,7 @@ from .native_tests.contrib.meth import * # noqa
|
|||||||
from .native_tests.contrib.walk import * # noqa
|
from .native_tests.contrib.walk import * # noqa
|
||||||
from .native_tests.contrib.multi import * # noqa
|
from .native_tests.contrib.multi import * # noqa
|
||||||
from .native_tests.contrib.curry import * # noqa
|
from .native_tests.contrib.curry import * # noqa
|
||||||
|
from .native_tests.contrib.botsbuildbots import * # noqa
|
||||||
|
|
||||||
if PY3:
|
if PY3:
|
||||||
from .native_tests.py3_only_tests import * # noqa
|
from .native_tests.py3_only_tests import * # noqa
|
||||||
|
5
tests/native_tests/contrib/botsbuildbots.hy
Normal file
5
tests/native_tests/contrib/botsbuildbots.hy
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
(import [hy.contrib.botsbuildbots [*]])
|
||||||
|
(require hy.contrib.botsbuildbots)
|
||||||
|
|
||||||
|
(defn test-botsbuildbots []
|
||||||
|
(assert (> (len (first (Botsbuildbots))) 50)))
|
@ -257,9 +257,6 @@
|
|||||||
(yield 4))))
|
(yield 4))))
|
||||||
(assert (= (list (yield-from-test)) [0 1 2 1 2 3 4])))
|
(assert (= (list (yield-from-test)) [0 1 2 1 2 3 4])))
|
||||||
|
|
||||||
(defn test-botsbuildbots []
|
|
||||||
(assert (> (len (first (Botsbuildbots))) 50)))
|
|
||||||
|
|
||||||
|
|
||||||
(defn test-defmain []
|
(defn test-defmain []
|
||||||
"NATIVE: make sure defmain is clean"
|
"NATIVE: make sure defmain is clean"
|
||||||
|
Loading…
Reference in New Issue
Block a user