From f069a04345ecd3c1040c82711da214f9d239a146 Mon Sep 17 00:00:00 2001 From: Dennis Lamm Date: Tue, 15 Sep 2020 20:43:58 +0200 Subject: dev-python/autoprop: new package Signed-off-by: Dennis Lamm Closes: https://github.com/gentoo/gentoo/pull/17559 Signed-off-by: Dennis Lamm --- dev-python/autoprop/Manifest | 1 + dev-python/autoprop/autoprop-1.0.2.ebuild | 18 ++++++++++++++++++ dev-python/autoprop/metadata.xml | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 dev-python/autoprop/Manifest create mode 100644 dev-python/autoprop/autoprop-1.0.2.ebuild create mode 100644 dev-python/autoprop/metadata.xml (limited to 'dev-python/autoprop') diff --git a/dev-python/autoprop/Manifest b/dev-python/autoprop/Manifest new file mode 100644 index 000000000000..6ca9ddbb7324 --- /dev/null +++ b/dev-python/autoprop/Manifest @@ -0,0 +1 @@ +DIST autoprop-1.0.2.tar.gz 11040 BLAKE2B b53bdbf79947002a0c319fa84c6033908948365d18a85dd2fd4139bff2125752e0bc3fc8f19e5d38c06cdc089f423cc8a720b8040593cfbda9c04c84b7cd4ffd SHA512 281c30fded6d79ed3bbb0de5b7a37c2cc5b985a4980974503b5bbb5940cd22f3c09c3b3d9d513d5cb95239519519b277bf43536407fedb593a43122ee32a8db6 diff --git a/dev-python/autoprop/autoprop-1.0.2.ebuild b/dev-python/autoprop/autoprop-1.0.2.ebuild new file mode 100644 index 000000000000..03d8f7babb8a --- /dev/null +++ b/dev-python/autoprop/autoprop-1.0.2.ebuild @@ -0,0 +1,18 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6..9} ) + +inherit distutils-r1 + +DESCRIPTION="Infer properties from accessor methods" +HOMEPAGE="https://github.com/kalekundert/autoprop https://pypi.org/project/autoprop/" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" +LICENSE="MIT" + +KEYWORDS="~amd64" +SLOT="0" + +distutils_enable_tests pytest diff --git a/dev-python/autoprop/metadata.xml b/dev-python/autoprop/metadata.xml new file mode 100644 index 000000000000..3b6fefbcfe32 --- /dev/null +++ b/dev-python/autoprop/metadata.xml @@ -0,0 +1,24 @@ + + + + + 3dprint@gentoo.org + Gentoo 3D Printer Project + + + Properties are a feature in python that allow accessor functions (i.e. getters and setters) to masquerade as + regular attributes. This makes it possible to provide transparent APIs for classes that need to cache results, + lazily load data, maintain invariants, or react in any other way to attribute access. + + Unfortunately, making a property requires an annoying amount of boilerplate code. There are a few ways to + do it, but the most common and most succinct requires you to decorate two functions + (with two different decorators) and to type the name of the attribute three times. + + The autoprop module simplifies this process by searching your class for accessor methods and adding properties + corresponding to any such methods it finds. + + + kalekundert/autoprop + autoprop + + -- cgit v1.2.3-65-gdbad