Ticket #1287: fix-1287.darcs.patch

File fix-1287.darcs.patch, 11.4 KB (added by davidsarah, at 2011-01-01T20:37:33Z)
  • allmydata/init.py: don't use pkg_resources.require to get versions and paths. Also change pyOpenSSL to pyopenssl since that is the package name. fixes #1287 * allmydata/_auto_deps.py: add a comment reminding to change init.py when dependencies are added or removed. Clarify a comment in init.py. refs #1287
Line 
12 patches for repository davidsarah@dev.allmydata.org:/home/darcs/tahoe/trunk:
2
3Sat Jan  1 11:01:41 GMT Standard Time 2011  david-sarah@jacaranda.org
4  * allmydata/__init__.py: don't use pkg_resources.require to get versions and paths. Also change pyOpenSSL to pyopenssl since that is the package name. fixes #1287
5
6Sat Jan  1 20:05:02 GMT Standard Time 2011  david-sarah@jacaranda.org
7  * allmydata/_auto_deps.py: add a comment reminding to change __init__.py when dependencies are added or removed. Clarify a comment in __init__.py. refs #1287
8
9New patches:
10
11[allmydata/__init__.py: don't use pkg_resources.require to get versions and paths. Also change pyOpenSSL to pyopenssl since that is the package name. fixes #1287
12david-sarah@jacaranda.org**20110101110141
13 Ignore-this: 48593ba449d7453005c9d2683fed6a69
14] {
15hunk ./src/allmydata/__init__.py 178
16     else:
17         return platform.platform()
18 
19-def get_package_versions_from_setuptools():
20-    import pkg_resources
21-    return dict([(p.project_name, (p.version, p.location)) for p in pkg_resources.require(__appname__)])
22-
23 def package_dir(srcfile):
24     return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
25 
26hunk ./src/allmydata/__init__.py 182
27 def get_package_versions_and_locations():
28-    # because there are a few dependencies that are outside setuptools's ken
29-    # (Python and platform, and sqlite3 if you are on Python >= 2.5), and
30-    # because setuptools might fail to find something even though import
31-    # finds it:
32-    import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface
33+    # pkg_resources.require returns the distribution that pkg_resources attempted to put
34+    # on sys.path, which can differ from the one that we actually import due to #1258,
35+    # or any other bug that causes sys.path to be set up incorrectly. Therefore we
36+    # must import the packages in order to check their versions and paths. Note that
37+    # this needs to be updated if dependencies are added.
38+
39+    import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface, Crypto
40     pysqlitever = None
41     pysqlitefile = None
42     sqlitever = None
43hunk ./src/allmydata/__init__.py 208
44         pysqlitefile = package_dir(sqlite3.__file__)
45         sqlitever = sqlite3.sqlite_version
46 
47-    d1 = {
48-        'pyOpenSSL': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
49+    return {
50+        'pyopenssl': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
51         __appname__: (allmydata.__version__, package_dir(allmydata.__file__)),
52         'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)),
53         'Nevow': (nevow.__version__, package_dir(nevow.__file__)),
54hunk ./src/allmydata/__init__.py 221
55         'zope.interface': ('unknown', package_dir(zope.interface.__file__)),
56         'Twisted': (twisted.__version__, package_dir(twisted.__file__)),
57         'zfec': (zfec.__version__, package_dir(zfec.__file__)),
58+        'pycrypto': (Crypto.__version__, package_dir(Crypto.__file__)),
59         'python': (platform.python_version(), sys.executable),
60         'platform': (get_platform(), None),
61         }
62hunk ./src/allmydata/__init__.py 226
63 
64-    # But we prefer to get all the dependencies as known by setuptools:
65-    import pkg_resources
66-    try:
67-        d2 = get_package_versions_from_setuptools()
68-    except pkg_resources.DistributionNotFound:
69-        # See docstring in _auto_deps.require_auto_deps() to explain why it makes sense to ignore this exception.
70-        pass
71-    else:
72-        d1.update(d2)
73-
74-    return d1
75-
76 def get_package_versions():
77     return dict([(k, v) for k, (v, l) in get_package_versions_and_locations().iteritems()])
78 
79}
80[allmydata/_auto_deps.py: add a comment reminding to change __init__.py when dependencies are added or removed. Clarify a comment in __init__.py. refs #1287
81david-sarah@jacaranda.org**20110101200502
82 Ignore-this: edb7059211da0c2ce511680d76731da5
83] {
84hunk ./src/allmydata/__init__.py 186
85     # on sys.path, which can differ from the one that we actually import due to #1258,
86     # or any other bug that causes sys.path to be set up incorrectly. Therefore we
87     # must import the packages in order to check their versions and paths. Note that
88-    # this needs to be updated if dependencies are added.
89+    # this needs to be updated if dependencies are added or removed.
90 
91     import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface, Crypto
92     pysqlitever = None
93hunk ./src/allmydata/_auto_deps.py 8
94 # zetuptoolz, distribute, and perhaps in the future distutils2, for
95 # the require_auto_deps() function.)
96 
97+# If you add or remove dependencies, please remember to update
98+# get_package_versions_and_locations() in src/allmydata/__init__.py.
99+
100 install_requires=[
101                   # we require newer versions of setuptools (actually
102                   # zetuptoolz) to build, but can handle older versions to run
103}
104
105Context:
106
107[test_storage.py: fix a pyflakes unused import warning.
108david-sarah@jacaranda.org**20101231220756
109 Ignore-this: df08231540cb7dff9d2b038e47ab30ee
110]
111[test_storage.py: leave at least 512 MiB free when running test_large_share. refs #1195
112david-sarah@jacaranda.org**20101231203215
113 Ignore-this: b2144c0341c3452b5d4ba219e284ea0e
114]
115[storage: use fileutil's version of get_disk_stats() and get_available_space(), use mockery/fakery in tests, enable large share test on platforms with sparse files and if > 4 GiB of disk space is currently available
116zooko@zooko.com**20100910173629
117 Ignore-this: 1304f1164c661de6d5304f993eb9b27b
118]
119[fileutil: copy in the get_disk_stats() and get_available_space() functions from storage/server.py
120zooko@zooko.com**20100910173520
121 Ignore-this: 8b15569715f710f4fc5092f7ca109253
122]
123[Update foolscap version requirement to 0.6.0, to address http://foolscap.lothar.com/trac/ticket/167
124david-sarah@jacaranda.org**20101231060039
125 Ignore-this: 98d2b8086a1a500b9f4565bca5a3810
126]
127[docs/webapi.rst: typos.
128david-sarah@jacaranda.org**20101230034422
129 Ignore-this: d1f5166d72cc711f7e0d9981eac9105e
130]
131[docs/webapi.rst: capitalization, formatting of section on URL character encoding, and a correction about Internet Explorer.
132david-sarah@jacaranda.org**20101230034049
133 Ignore-this: b3b9819d2fb264b4cdc5c8afd4e8c48d
134]
135[docs: corrections and clarifications.
136david-sarah@jacaranda.org**20101227051056
137 Ignore-this: e33202858c7644c58f3f924b164294b6
138]
139[docs: more formatting cleanups and corrections. Spell webapi and wapi as web-API.
140david-sarah@jacaranda.org**20101227050533
141 Ignore-this: 18b23cbfb780df585d8a722a1ec63e94
142]
143[docs/debian.rst: bring description of building dependencies from source up-to-date, and change hostname from allmydata.com to tahoe-lafs.org.
144david-sarah@jacaranda.org**20101212222912
145 Ignore-this: f38462afc88b4475195610385a28391c
146]
147[docs/architecture.rst: correct rst syntax.
148david-sarah@jacaranda.org**20101212202003
149 Ignore-this: 3fbe12feb28bec6f1c63aedbc79aad21
150]
151[docs/architecture.rst: formatting.
152david-sarah@jacaranda.org**20101212201719
153 Ignore-this: 305fa5dfc2939355eaf6d0d2161eb1ff
154]
155[docs: linkification, wording improvements.
156david-sarah@jacaranda.org**20101212201234
157 Ignore-this: 4e67287f527a8bc728cfbd93255d2aae
158]
159[docs: formatting.
160david-sarah@jacaranda.org**20101212201115
161 Ignore-this: 2e0ed394ac7726651d3a4f2c4b0d3798
162]
163[docs/configuration.rst: more formatting tweaks; which -> that.
164david-sarah@jacaranda.org**20101212195522
165 Ignore-this: a7becb7021854ca5a90edd892b36fdd7
166]
167[docs/configuration.rst: more changes to formatting.
168david-sarah@jacaranda.org**20101212194511
169 Ignore-this: 491aac33e5f5268d224359f1447d10be
170]
171[docs/configuration.rst: changes to formatting (mainly putting commands and filenames in monospace).
172david-sarah@jacaranda.org**20101212181828
173 Ignore-this: 8a1480e2d5f43bee678476424615b50f
174]
175[scripts/backupdb.py: more accurate comment about path field.
176david-sarah@jacaranda.org**20101212170320
177 Ignore-this: 50e47a2228a85207bbcd188a78a0d4e6
178]
179[scripts/cli.py: fix missing 'put' in usage example for 'tahoe put'.
180david-sarah@jacaranda.org**20101212170207
181 Ignore-this: 2cbadf066fff611fc03d3c0ff97ce6ec
182]
183[docs/frontends/CLI.rst: changes to formatting (mainly putting commands and filenames in monospace), and to command syntax to reflect that DIRCAP/... is accepted. Clarify the syntax of 'tahoe put' and other minor corrections. Tahoe -> Tahoe-LAFS.
184david-sarah@jacaranda.org**20101212165800
185 Ignore-this: a123ef6b564aa8624d1e79c97068ea12
186]
187[docs/frontends/CLI.rst: Unicode arguments to 'tahoe' work on Windows as of v1.7.1.
188david-sarah@jacaranda.org**20101212063740
189 Ignore-this: 3977a99dfa86ac33a44171deaf43aaab
190]
191[docs/known_issues.rst: fix title and linkify another URL. refs #1225
192david-sarah@jacaranda.org**20101212062817
193 Ignore-this: cc91287f7fb51c23440b3d2fe79c449c
194]
195[docs/known_issues.rst: fix an external link. refs #1225
196david-sarah@jacaranda.org**20101212062435
197 Ignore-this: b8cbf12f353131756c358965c48060ec
198]
199[Fix a link from uri.rst to dirnodes.rst. refs #1225
200david-sarah@jacaranda.org**20101212054502
201 Ignore-this: af6205299f5c9a33229cab259c00f9d5
202]
203[Fix a link from webapi.rst to FTP-and-SFTP.rst. refs #1225
204david-sarah@jacaranda.org**20101212053435
205 Ignore-this: 2b9f88678c3447ea860d6b61e8799858
206]
207[More specific hyperlink to architecture.rst from helper.rst. refs #1225
208david-sarah@jacaranda.org**20101212052607
209 Ignore-this: 50424c768fca481252fabf58424852dc
210]
211[Update hyperlinks between docs, and linkify some external references. refs #1225
212david-sarah@jacaranda.org**20101212051459
213 Ignore-this: cd43a4c3d3de1f832abfa88d5fc4ace1
214]
215[docs/specifications/dirnodes.rst: fix references to mutable.rst. refs #1225
216david-sarah@jacaranda.org**20101212012720
217 Ignore-this: 6819b4b4e06e947ee48b365e840db37d
218]
219[docs/specifications/mutable.rst: correct the magic string for v1 mutable containers. refs #1225
220david-sarah@jacaranda.org**20101212011400
221 Ignore-this: 99a5fcdd40cef83dbb08f323f6cdaaca
222]
223[Move .txt files in docs/frontends and docs/specifications to .rst. refs #1225
224david-sarah@jacaranda.org**20101212010251
225 Ignore-this: 8796d35d928370f7dc6ad2dafdc1c0fe
226]
227[Convert docs/frontends and docs/specifications to reStructuredText format (not including file moves).
228david-sarah@jacaranda.org**20101212004632
229 Ignore-this: e3ceb2d832d73875abe48624ddbb5622
230]
231[scripts/cli.py: remove the disclaimer in the help for 'tahoe cp' that it does not handle non-ASCII filenames well. (At least, we intend to handle them.)
232david-sarah@jacaranda.org**20101130002145
233 Ignore-this: 94c003efaa20b9eb4a83503d79844ca
234]
235[relnotes.txt: fifth -> sixth labor-of-love release
236zooko@zooko.com**20101129045647
237 Ignore-this: 21c245015268b38916e3a138d256c09d
238]
239[Makefile: BB_BRANCH is set to the empty string for trunk, not the string 'trunk'.
240david-sarah@jacaranda.org**20101128233512
241 Ignore-this: 5a7ef8eb10475636d21b91e25b56c369
242]
243[relnotes.txt: eleventh -> twelfth release.
244david-sarah@jacaranda.org**20101128223321
245 Ignore-this: 1e26410156a665271c1170803dea2c0d
246]
247[relnotes.tst: point to known_issues.rst, not known_issues.txt.
248david-sarah@jacaranda.org**20101128222918
249 Ignore-this: 60194eb4544cac446fe4f60b3e34b887
250]
251[quickstart.html: fix link to point to allmydata-tahoe-1.8.1.zip.
252david-sarah@jacaranda.org**20101128221728
253 Ignore-this: 7b3ee86f8256aa12f5d862f689f3ee29
254]
255[TAG allmydata-tahoe-1.8.1
256david-sarah@jacaranda.org**20101128212336
257 Ignore-this: 9c18bdeaef4822f590d2a0d879e00621
258]
259Patch bundle hash:
260d218933ea4e0767ca6adb8ad9bbc511b1f3ccac2