diff options
author | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-08-30 01:30:50 +0200 |
---|---|---|
committer | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-08-30 01:30:50 +0200 |
commit | e2817c354742e42ff0a0e817c29a9787077d1702 (patch) | |
tree | 3c854403d45f1982d1a799f41b579eb66827e325 | |
parent | gs_pypi/pypi_db: undo accidentially commited debug restriction (diff) | |
download | g-sorcery-e2817c354742e42ff0a0e817c29a9787077d1702.tar.gz g-sorcery-e2817c354742e42ff0a0e817c29a9787077d1702.tar.bz2 g-sorcery-e2817c354742e42ff0a0e817c29a9787077d1702.zip |
pypi: it works now, but no dependency checking, no python version checking at the moment
-rw-r--r-- | bin/gs-pypi | 3 | ||||
-rw-r--r-- | gs-pypi.json | 3 | ||||
-rw-r--r-- | gs_pypi/backend.py | 2 | ||||
-rw-r--r-- | gs_pypi/data/gs-pypi.eclass | 17 | ||||
-rw-r--r-- | gs_pypi/ebuild.py | 7 | ||||
-rw-r--r-- | gs_pypi/gs_pypi_generate_db.py | 5 | ||||
-rw-r--r-- | gs_pypi/pypi_db.py | 2 | ||||
-rw-r--r-- | setup.py | 2 |
8 files changed, 34 insertions, 7 deletions
diff --git a/bin/gs-pypi b/bin/gs-pypi new file mode 100644 index 0000000..fbaabd4 --- /dev/null +++ b/bin/gs-pypi @@ -0,0 +1,3 @@ +#!/bin/bash + +g-sorcery gs-pypi $@ diff --git a/gs-pypi.json b/gs-pypi.json index 0491811..a02af23 100644 --- a/gs-pypi.json +++ b/gs-pypi.json @@ -2,7 +2,8 @@ "package": "gs_pypi", "repositories": { "pypi": { - "repo_uri": "https://testpypi.python.org/" + "repo_uri": "https://testpypi.python.org/", + "db_uri": "https://github.com/jauhien/gs-pypi-db/archive/master.tar.gz" } } } diff --git a/gs_pypi/backend.py b/gs_pypi/backend.py index 9fd6547..a8e2297 100644 --- a/gs_pypi/backend.py +++ b/gs_pypi/backend.py @@ -29,4 +29,4 @@ class PypiEclassGenerator(EclassGenerator): instance = Backend(PypiDBGenerator, PypiEbuildWithDigestGenerator, PypiEbuildWithoutDigestGenerator, - PypiEclassGenerator, MetadataGenerator) + PypiEclassGenerator, MetadataGenerator, sync_db=True) diff --git a/gs_pypi/data/gs-pypi.eclass b/gs_pypi/data/gs-pypi.eclass new file mode 100644 index 0000000..4377808 --- /dev/null +++ b/gs_pypi/data/gs-pypi.eclass @@ -0,0 +1,17 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ +# automatically generated by gs-pypi +# please do not edit this file +# +# Original Author: Jauhien Piatlicki <piatlicki@gmail.com> +# Purpose: support installation of python packages from PyPI repo +# +# Bugs to piatlicki@gmail.com +# +# @ECLASS: gs-pypi.eclass +# + +PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} ) + +inherit distutils-r1 g-sorcery diff --git a/gs_pypi/ebuild.py b/gs_pypi/ebuild.py index bbc0357..1acccae 100644 --- a/gs_pypi/ebuild.py +++ b/gs_pypi/ebuild.py @@ -24,7 +24,8 @@ class PypiEbuildWithoutDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - [] + [("repo_uri", '"http://pypi.python.org/packages/source/${PN:0:1}/${PN}/"'), + ("sourcefile", '"${P}.tar.gz"')] inherit = ["gs-pypi"] @@ -42,7 +43,9 @@ class PypiEbuildWithDigestGenerator(DefaultEbuildGenerator): def __init__(self, package_db): vars_before_inherit = \ - [] + [("digest_sources", "yes"), + ("repo_uri", '"http://pypi.python.org/packages/source/${PN:0:1}/${PN}/"'), + ("sourcefile", '"${P}.tar.gz"')] inherit = ["gs-pypi"] diff --git a/gs_pypi/gs_pypi_generate_db.py b/gs_pypi/gs_pypi_generate_db.py index a4f8395..52585f3 100644 --- a/gs_pypi/gs_pypi_generate_db.py +++ b/gs_pypi/gs_pypi_generate_db.py @@ -48,7 +48,10 @@ def main(): db_name = sys.argv[1] temp_dir = TemporaryDirectory() pkg_db = generator(temp_dir.name, "pypi", config=config["repositories"]["pypi"]) - os.mkdir(db_name) + if os.path.exists(db_name): + os.system('rm -rf ' + db_name + '/*') + else: + os.mkdir(db_name) copy_all(os.path.join(temp_dir.name, "pypi/db"), db_name) os.system('tar cvzf ' + db_name + '.tar.gz ' + db_name) diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py index f614c4a..56b4f1c 100644 --- a/gs_pypi/pypi_db.py +++ b/gs_pypi/pypi_db.py @@ -219,7 +219,7 @@ class PypiDBGenerator(DBGenerator): filtered_version = pseudoversion dependencies = serializable_elist(separator="\n\t") - eclasses = ['gs-pypi'] + eclasses = ['g-sorcery', 'gs-pypi'] maintainer = [{'email' : 'piatlicki@gmail.com', 'name' : 'Jauhien Piatlicki'}] @@ -11,7 +11,7 @@ setup(name = 'g-sorcery', package_data = {'gs_elpa': ['data/*'], 'gs_ctan': ['data/*']}, scripts = ['bin/g-sorcery', 'bin/gs-db-tool', 'bin/gs-elpa', - 'bin/gs-ctan', 'bin/gs-pypi-generate-db'], + 'bin/gs-ctan', 'bin/gs-pypi-generate-db', 'bin/gs-pypi'], data_files = [('/etc/g-sorcery/', ['gs-elpa.json']), ('/etc/g-sorcery/', ['gs-ctan.json']), ('/etc/g-sorcery/', ['gs-pypi.json']), |