BSD Ports

devel/py-makefun 1.15.4_1 DragonFly

Dynamically create python functions with a proper signature

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
License
BSD3CLAUSE
Categories
devel, python
Package size
37.5 KiB, 216.7 KiB installed

Description

Makefun helps you create functions dynamically, with the signature of your choice. It was largely inspired by decorator and functools, and created mainly to cover some of their limitations.

The typical use cases are: * creating signature-preserving function wrappers - just like functools.wraps but with accurate TypeError exception raising when user-provided arguments are wrong, and with a very convenient way to access argument values.

* creating function wrappers that have more or less arguments that the function they wrap. A bit like functools.partial but a lot more flexible and friendly for your users. For example, I use it in my pytest plugins to add a requests parameter to users' tests or fixtures when they do not already have it.

* more generally, creating functions with a signature derived from a reference signature, or even creating functions with a signature completely defined at runtime.

In the other systems

SystemPortVersion
DragonFlydevel/py-makefun1.15.4_1
FreeBSDdevel/py-makefun1.16.0_1
OpenBSDdevel/py-makefun1.16.0
NetBSDdevel/py-makefun1.16.0nb1
HardenedBSDdevel/py-makefun1.16.0_1
GhostBSDdevel/py-makefun1.16.0_1

Install

Binary package:

pkg install py311-makefun

From DPorts:

cd /usr/dports/devel/py-makefun && make install clean

Dependencies

Run dependencies 2

Configuration

No options to configure.

Service scripts
none

Message after installing

===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

Depends on expired devel/py-pytest-runner.

It is scheduled to be removed on or after 2025-03-31.