1 |
commit: e2817c354742e42ff0a0e817c29a9787077d1702 |
2 |
Author: Jauhien Piatlicki (jauhien) <piatlicki <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Aug 29 23:30:50 2013 +0000 |
4 |
Commit: Jauhien Piatlicki <piatlicki <AT> gmail <DOT> com> |
5 |
CommitDate: Thu Aug 29 23:30:50 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/g-sorcery.git;a=commit;h=e2817c35 |
7 |
|
8 |
pypi: it works now, but no dependency checking, no python version checking at the moment |
9 |
|
10 |
--- |
11 |
bin/gs-pypi | 3 +++ |
12 |
gs-pypi.json | 3 ++- |
13 |
gs_pypi/backend.py | 2 +- |
14 |
gs_pypi/data/gs-pypi.eclass | 17 +++++++++++++++++ |
15 |
gs_pypi/ebuild.py | 7 +++++-- |
16 |
gs_pypi/gs_pypi_generate_db.py | 5 ++++- |
17 |
gs_pypi/pypi_db.py | 2 +- |
18 |
setup.py | 2 +- |
19 |
8 files changed, 34 insertions(+), 7 deletions(-) |
20 |
|
21 |
diff --git a/bin/gs-pypi b/bin/gs-pypi |
22 |
new file mode 100644 |
23 |
index 0000000..fbaabd4 |
24 |
--- /dev/null |
25 |
+++ b/bin/gs-pypi |
26 |
@@ -0,0 +1,3 @@ |
27 |
+#!/bin/bash |
28 |
+ |
29 |
+g-sorcery gs-pypi $@ |
30 |
|
31 |
diff --git a/gs-pypi.json b/gs-pypi.json |
32 |
index 0491811..a02af23 100644 |
33 |
--- a/gs-pypi.json |
34 |
+++ b/gs-pypi.json |
35 |
@@ -2,7 +2,8 @@ |
36 |
"package": "gs_pypi", |
37 |
"repositories": { |
38 |
"pypi": { |
39 |
- "repo_uri": "https://testpypi.python.org/" |
40 |
+ "repo_uri": "https://testpypi.python.org/", |
41 |
+ "db_uri": "https://github.com/jauhien/gs-pypi-db/archive/master.tar.gz" |
42 |
} |
43 |
} |
44 |
} |
45 |
|
46 |
diff --git a/gs_pypi/backend.py b/gs_pypi/backend.py |
47 |
index 9fd6547..a8e2297 100644 |
48 |
--- a/gs_pypi/backend.py |
49 |
+++ b/gs_pypi/backend.py |
50 |
@@ -29,4 +29,4 @@ class PypiEclassGenerator(EclassGenerator): |
51 |
|
52 |
instance = Backend(PypiDBGenerator, |
53 |
PypiEbuildWithDigestGenerator, PypiEbuildWithoutDigestGenerator, |
54 |
- PypiEclassGenerator, MetadataGenerator) |
55 |
+ PypiEclassGenerator, MetadataGenerator, sync_db=True) |
56 |
|
57 |
diff --git a/gs_pypi/data/gs-pypi.eclass b/gs_pypi/data/gs-pypi.eclass |
58 |
new file mode 100644 |
59 |
index 0000000..4377808 |
60 |
--- /dev/null |
61 |
+++ b/gs_pypi/data/gs-pypi.eclass |
62 |
@@ -0,0 +1,17 @@ |
63 |
+# Copyright 1999-2013 Gentoo Foundation |
64 |
+# Distributed under the terms of the GNU General Public License v2 |
65 |
+# $Header: $ |
66 |
+# automatically generated by gs-pypi |
67 |
+# please do not edit this file |
68 |
+# |
69 |
+# Original Author: Jauhien Piatlicki <piatlicki@×××××.com> |
70 |
+# Purpose: support installation of python packages from PyPI repo |
71 |
+# |
72 |
+# Bugs to piatlicki@×××××.com |
73 |
+# |
74 |
+# @ECLASS: gs-pypi.eclass |
75 |
+# |
76 |
+ |
77 |
+PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} ) |
78 |
+ |
79 |
+inherit distutils-r1 g-sorcery |
80 |
|
81 |
diff --git a/gs_pypi/ebuild.py b/gs_pypi/ebuild.py |
82 |
index bbc0357..1acccae 100644 |
83 |
--- a/gs_pypi/ebuild.py |
84 |
+++ b/gs_pypi/ebuild.py |
85 |
@@ -24,7 +24,8 @@ class PypiEbuildWithoutDigestGenerator(DefaultEbuildGenerator): |
86 |
def __init__(self, package_db): |
87 |
|
88 |
vars_before_inherit = \ |
89 |
- [] |
90 |
+ [("repo_uri", '"http://pypi.python.org/packages/source/${PN:0:1}/${PN}/"'), |
91 |
+ ("sourcefile", '"${P}.tar.gz"')] |
92 |
|
93 |
inherit = ["gs-pypi"] |
94 |
|
95 |
@@ -42,7 +43,9 @@ class PypiEbuildWithDigestGenerator(DefaultEbuildGenerator): |
96 |
def __init__(self, package_db): |
97 |
|
98 |
vars_before_inherit = \ |
99 |
- [] |
100 |
+ [("digest_sources", "yes"), |
101 |
+ ("repo_uri", '"http://pypi.python.org/packages/source/${PN:0:1}/${PN}/"'), |
102 |
+ ("sourcefile", '"${P}.tar.gz"')] |
103 |
|
104 |
inherit = ["gs-pypi"] |
105 |
|
106 |
|
107 |
diff --git a/gs_pypi/gs_pypi_generate_db.py b/gs_pypi/gs_pypi_generate_db.py |
108 |
index a4f8395..52585f3 100644 |
109 |
--- a/gs_pypi/gs_pypi_generate_db.py |
110 |
+++ b/gs_pypi/gs_pypi_generate_db.py |
111 |
@@ -48,7 +48,10 @@ def main(): |
112 |
db_name = sys.argv[1] |
113 |
temp_dir = TemporaryDirectory() |
114 |
pkg_db = generator(temp_dir.name, "pypi", config=config["repositories"]["pypi"]) |
115 |
- os.mkdir(db_name) |
116 |
+ if os.path.exists(db_name): |
117 |
+ os.system('rm -rf ' + db_name + '/*') |
118 |
+ else: |
119 |
+ os.mkdir(db_name) |
120 |
copy_all(os.path.join(temp_dir.name, "pypi/db"), db_name) |
121 |
os.system('tar cvzf ' + db_name + '.tar.gz ' + db_name) |
122 |
|
123 |
|
124 |
diff --git a/gs_pypi/pypi_db.py b/gs_pypi/pypi_db.py |
125 |
index f614c4a..56b4f1c 100644 |
126 |
--- a/gs_pypi/pypi_db.py |
127 |
+++ b/gs_pypi/pypi_db.py |
128 |
@@ -219,7 +219,7 @@ class PypiDBGenerator(DBGenerator): |
129 |
filtered_version = pseudoversion |
130 |
|
131 |
dependencies = serializable_elist(separator="\n\t") |
132 |
- eclasses = ['gs-pypi'] |
133 |
+ eclasses = ['g-sorcery', 'gs-pypi'] |
134 |
maintainer = [{'email' : 'piatlicki@×××××.com', |
135 |
'name' : 'Jauhien Piatlicki'}] |
136 |
|
137 |
|
138 |
diff --git a/setup.py b/setup.py |
139 |
index ea7070f..4da0991 100644 |
140 |
--- a/setup.py |
141 |
+++ b/setup.py |
142 |
@@ -11,7 +11,7 @@ setup(name = 'g-sorcery', |
143 |
package_data = {'gs_elpa': ['data/*'], |
144 |
'gs_ctan': ['data/*']}, |
145 |
scripts = ['bin/g-sorcery', 'bin/gs-db-tool', 'bin/gs-elpa', |
146 |
- 'bin/gs-ctan', 'bin/gs-pypi-generate-db'], |
147 |
+ 'bin/gs-ctan', 'bin/gs-pypi-generate-db', 'bin/gs-pypi'], |
148 |
data_files = [('/etc/g-sorcery/', ['gs-elpa.json']), |
149 |
('/etc/g-sorcery/', ['gs-ctan.json']), |
150 |
('/etc/g-sorcery/', ['gs-pypi.json']), |