From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 730D8138200 for ; Tue, 23 Jul 2013 23:13:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D68C9E087D; Tue, 23 Jul 2013 23:13:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 513BBE0966 for ; Tue, 23 Jul 2013 23:13:51 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1408333E997 for ; Tue, 23 Jul 2013 23:13:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id AF66AE5458 for ; Tue, 23 Jul 2013 23:13:48 +0000 (UTC) From: "Jauhien Piatlicki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jauhien Piatlicki" Message-ID: <1374616998.3e4df382f7391e344a9658fbbef84569c25eb4a8.jauhien@gentoo> Subject: [gentoo-commits] proj/g-sorcery:master commit in: /, gs_pypi/ X-VCS-Repository: proj/g-sorcery X-VCS-Files: gs-pypi.json gs_pypi/__init__.py gs_pypi/backend.py gs_pypi/ebuild.py gs_pypi/pypi_db.py X-VCS-Directories: / gs_pypi/ X-VCS-Committer: jauhien X-VCS-Committer-Name: Jauhien Piatlicki X-VCS-Revision: 3e4df382f7391e344a9658fbbef84569c25eb4a8 X-VCS-Branch: master Date: Tue, 23 Jul 2013 23:13:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: bbbd67da-4ea0-4bd7-a2c8-e464ccee0b57 X-Archives-Hash: 14b37dfd23238833c93f3888235bcc92 commit: 3e4df382f7391e344a9658fbbef84569c25eb4a8 Author: Jauhien Piatlicki (jauhien) gmail com> AuthorDate: Tue Jul 23 22:03:18 2013 +0000 Commit: Jauhien Piatlicki gmail com> CommitDate: Tue Jul 23 22:03:18 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=3e4df382 PyPI backend: initial commit --- gs-pypi.json | 8 ++++++++ gs_pypi/__init__.py | 2 ++ gs_pypi/backend.py | 32 ++++++++++++++++++++++++++++++ gs_pypi/ebuild.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ gs_pypi/pypi_db.py | 17 ++++++++++++++++ 5 files changed, 116 insertions(+) diff --git a/gs-pypi.json b/gs-pypi.json new file mode 100644 index 0000000..eb26221 --- /dev/null +++ b/gs-pypi.json @@ -0,0 +1,8 @@ +{ + "package": "gs_pypi", + "repositories": { + "pypi": { + "repo_uri": "https://pypi.python.org/pypi" + } + } +} diff --git a/gs_pypi/__init__.py b/gs_pypi/__init__.py new file mode 100644 index 0000000..cf529d7 --- /dev/null +++ b/gs_pypi/__init__.py @@ -0,0 +1,2 @@ +#!/usr/bin/env python + diff --git a/gs_pypi/backend.py b/gs_pypi/backend.py new file mode 100644 index 0000000..9fd6547 --- /dev/null +++ b/gs_pypi/backend.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" + backend.py + ~~~~~~~~~~ + + PyPI backend + + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. +""" + +import os + +from g_sorcery.backend import Backend +from g_sorcery.metadata import MetadataGenerator +from g_sorcery.eclass import EclassGenerator +from g_sorcery.fileutils import get_pkgpath + +from .pypi_db import PypiDBGenerator +from .ebuild import PypiEbuildWithoutDigestGenerator, PypiEbuildWithDigestGenerator + + +class PypiEclassGenerator(EclassGenerator): + def __init__(self): + super(PypiEclassGenerator, self).__init__(os.path.join(get_pkgpath(__file__), 'data')) + + +instance = Backend(PypiDBGenerator, + PypiEbuildWithDigestGenerator, PypiEbuildWithoutDigestGenerator, + PypiEclassGenerator, MetadataGenerator) diff --git a/gs_pypi/ebuild.py b/gs_pypi/ebuild.py new file mode 100644 index 0000000..bbc0357 --- /dev/null +++ b/gs_pypi/ebuild.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" + ebuild.py + ~~~~~~~~~ + + ebuild generation + + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. +""" + +import collections +import os + +from g_sorcery.ebuild import DefaultEbuildGenerator + +Layout = collections.namedtuple("Layout", + ["vars_before_inherit", "inherit", "vars_after_description", "vars_after_keywords"]) + + +class PypiEbuildWithoutDigestGenerator(DefaultEbuildGenerator): + def __init__(self, package_db): + + vars_before_inherit = \ + [] + + inherit = ["gs-pypi"] + + vars_after_description = \ + [] + + vars_after_keywords = \ + [] + + layout = Layout(vars_before_inherit, inherit, vars_after_description, vars_after_keywords) + + super(PypiEbuildWithoutDigestGenerator, self).__init__(package_db, layout) + +class PypiEbuildWithDigestGenerator(DefaultEbuildGenerator): + def __init__(self, package_db): + + vars_before_inherit = \ + [] + + inherit = ["gs-pypi"] + + vars_after_description = \ + [] + + vars_after_keywords = \ + [] + + layout = Layout(vars_before_inherit, inherit, vars_after_description, vars_after_keywords) + + super(PypiEbuildWithDigestGenerator, self).__init__(package_db, layout) diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py new file mode 100644 index 0000000..938f79c --- /dev/null +++ b/gs_pypi/pypi_db.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" + pypi_db.py + ~~~~~~~~~~ + + PyPI package database + + :copyright: (c) 2013 by Jauhien Piatlicki + :license: GPL-2, see LICENSE for more details. +""" + +from g_sorcery.package_db import DBGenerator + +class PypiDBGenerator(DBGenerator): + pass