Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Hyrule 0.7.0 #102

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.. default-role:: code

Unreleased
0.7.0 (released 2024-09-22; uses Hy ≥ 1)
======================================================

New Features
------------------------------
* New macros `meth` and `ameth`.

Bug Fixes
------------------------------
* `match-fn-params` now raises an error for syntactically invalid
parameter lists.

0.6.0 (released 2024-05-20; uses Hy 0.29.*)
======================================================

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
copyright = '%s the authors' % time.strftime('%Y')
html_title = f'Hyrule {hyrule.__version__} manual'

hy_version = 'v0.29.0'
hy_version = 'v1.0.0'

exclude_patterns = ['_build']

Expand Down
6 changes: 3 additions & 3 deletions hyrule/macrotools.hy
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@
"A subroutine for `defmacro-kwargs` and `match-params`."
(import
funcparserlib.parser [maybe many]
hy.model-patterns [SYM FORM sym brackets pexpr])
hy.model-patterns [SYM FORM sym brackets pexpr whole])

(setv msym (>> SYM hy.mangle))
(defn pvalue [root wanted]
(>> (pexpr (+ (sym root) wanted)) (fn [x] (get x 0))))
(setv [ps p-rest p-kwargs] (.parse
(+
(whole [
(many (| msym (brackets msym FORM)))
(maybe (pvalue "unpack-iterable" msym))
(maybe (pvalue "unpack-mapping" msym)))
(maybe (pvalue "unpack-mapping" msym))])
params))
(setv ps (dfor
p ps
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run(self):
# both setup_requires and install_requires
# since we need to compile .hy files during setup
requires = [
'hy'
'hy >= 1'
]


Expand Down
7 changes: 6 additions & 1 deletion tests/test_macrotools.hy
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@
(with [(pytest.raises TypeError :match "^unpacking is not allowed in `args`$")]
(f '[1 2 3 #* [1 2]]))
(with [(pytest.raises TypeError :match "^unpacking is not allowed in `args`$")]
(f '[1 2 3 #** {"qq" 1 "xx" 2}])))
(f '[1 2 3 #** {"qq" 1 "xx" 2}]))

; A syntactically invalid parameter list
(with [(pytest.raises hy.I.funcparserlib/parser.NoParseError)]
(match-fn-params [1] '[a 3]))
(assert (= (match-fn-params [1] '[a]) (dict :a 1))))


(defn test-slash-import []
Expand Down