1 |
On Tue, Feb 26, 2013 at 08:47:14AM -0800, Brian Dolbec wrote: |
2 |
> Also I've rebased everything on current master |
3 |
|
4 |
That should make things easier to merge :). |
5 |
|
6 |
It looks like some of my earlier comments were addressed by this |
7 |
reroll, but some are still applicable. Apologies if we'd resolved any |
8 |
of this earlier and I just missed the reference in my mailbox. |
9 |
|
10 |
I map my old comments onto the rebased commits below, but the bulk of |
11 |
the outstanding suggestions revolve around: |
12 |
|
13 |
* ConfigParser-based configuration |
14 |
* Argparse-based command line parsing |
15 |
* Logging-based debugging output |
16 |
* os.path.join(), normpath(), … for path manipulation |
17 |
|
18 |
These are mostly “take advantage of Python's standard library” |
19 |
changes, and I'd be happy to help implement them on top of the current |
20 |
master if folks feel like that has a chance of getting merged ;). |
21 |
|
22 |
On Thu, Jan 31, 2013 at 01:39:22PM -0500, W. Trevor King wrote: |
23 |
> 38cd3bb add more configured defaults |
24 |
> |
25 |
> List the new settings (distdir, repo_name, packagedir, port_tmpdir, |
26 |
> options, snapshot_name) in the commit message so I don't have to read |
27 |
> the diff. Probably explain why you think they should be configurable |
28 |
> as well. `options` is also a pretty ambiguous name. |
29 |
|
30 |
This still applies to 0a25452. I made a few comments about using |
31 |
separate boolean options instead of an aggregate `options` set. |
32 |
Fixing this should be part of the ConfigParser transition. |
33 |
|
34 |
> 016704a use the new configured snapshot_name and portdir settings |
35 |
> |
36 |
> Rather than a separate add (38cd3bb) and use (016704a), I think it |
37 |
> would be better if new options had their addition and use rolled into |
38 |
> a single commit (e.g. add snapshot_name and use it as one commit, add |
39 |
> portdir and use it as another commit). |
40 |
> |
41 |
> This might also be a good place to move the path construction over to |
42 |
> use os.path.join(). |
43 |
|
44 |
This still applies to be2f820. |
45 |
|
46 |
> 63a25eb Remove self.mounts and self.mountmap's use of paths for keys and paths. Migrate more hardcoded paths to use settings. |
47 |
> |
48 |
> That's a long commit summary ;). Perhaps the “Migrate…” portion |
49 |
> should go into the commit message body, or that could be split out |
50 |
> into a separate commit. |
51 |
|
52 |
This splitting happened in 77eece8, but… |
53 |
|
54 |
> This might also be a good time to transition from `CatalystError, …` |
55 |
> to `CatalystError(…)` where you're touching lines. |
56 |
> |
57 |
> I'm not sure which versions of Python Catalyst is trying to support, |
58 |
> but I'd be happy to see the beginings of a migration to '{}'.format() |
59 |
> for building strings (vs. the current `'' + ''` concatenation) |
60 |
|
61 |
… this still applies. |
62 |
|
63 |
> 7a909b9 cleanup long lines, improve useage() output formatting slightly |
64 |
> |
65 |
> Can we just switch from getopt to argparse (Python ≥2.7)? |
66 |
|
67 |
Still applies to 7870959. |
68 |
|
69 |
> 5eeb8b1 new minimal start script |
70 |
> |
71 |
> I think __version__ and __maintainer__ should live in |
72 |
> catalyst/__init__.py. |
73 |
|
74 |
Still applies to baae19f. |
75 |
|
76 |
> 299e35d update the module loading paths for the new locations |
77 |
> |
78 |
> Can we just drop this import manipulation and use __all__? |
79 |
|
80 |
Still applies to 79f73a3. |
81 |
|
82 |
> a7206bb rename files directory to etc to better reflect the directories contents |
83 |
> |
84 |
> Actually, files/ is also used for other things (e.g. built man pages, |
85 |
> see MAN_PAGES in the Makefile). If we keep the rename to etc/, we |
86 |
> might to just build the man pages under doc/. |
87 |
|
88 |
Still applies to 25f6f1b. |
89 |
|
90 |
> f9f18be update gitignore |
91 |
> |
92 |
> The Scratch, catalystc, *.geany, and test* entries would appear to be |
93 |
> specific to your local installation and usage. I'd drop them from the |
94 |
> reroll. |
95 |
|
96 |
They're still in 7fdecf4, but it will be easy to drop this before the |
97 |
merge with master. |
98 |
|
99 |
On Thu, Jan 31, 2013 at 02:46:53PM -0500, W. Trevor King wrote: |
100 |
> 968d818 Initial creation of a defaults file. Split out hash and contents to their own classes, files |
101 |
> |
102 |
> After this, it's not clear to me what the difference is between |
103 |
> catalyst.support and catalyst.util. Perhaps they should be merged. |
104 |
> |
105 |
> I'd also use catalyst.targets.__all__ instead of coding a list of |
106 |
> targets in the apparently unrelated |
107 |
> catalyst.defaults.valid_build_targets. |
108 |
|
109 |
Still applies to c97dc3d. |
110 |
|
111 |
> 9d752a7 move confdefaults out of main.py |
112 |
> |
113 |
> Looks good, except, I'm not sure why you changed from |
114 |
> `confdefaults.keys()` to `list(confdefaults)` in parse_config() (which |
115 |
> should probably be living in catalyst.config anyway). |
116 |
|
117 |
Still applies to 0c2302a. Additional discussion from a sub-thread: |
118 |
|
119 |
On Sun, Feb 03, 2013 at 07:44:36AM -0500, W. Trevor King wrote: |
120 |
> On Sat, Feb 02, 2013 at 12:41:32PM -0800, Brian Dolbec wrote: |
121 |
> > As for list(confdefaults), py3 compatibility. dict.keys() isn't usable |
122 |
> > and 2to3 converts it to list(dict)... something about needing to specify |
123 |
> > the return type. So is a preemptive change. One less thing to change |
124 |
> > later. |
125 |
> |
126 |
> Really? |
127 |
> |
128 |
> $ python3.3 -c "a = {1:2, 3:4}; print([x for x in a.keys()])" |
129 |
> [1, 3] |
130 |
> |
131 |
> On the other hand, it might be cleaner to just say: |
132 |
> |
133 |
> for x in confdefaults: |
134 |
> |
135 |
> But this should still go into a separate commit. |
136 |
|
137 |
I still think this is true ;). |
138 |
|
139 |
On Thu, Jan 31, 2013 at 02:46:53PM -0500, W. Trevor King wrote: |
140 |
> c303dae some options cleanup, unifying their use, reducing redundancy. |
141 |
> |
142 |
> While I like the general thrust of this, I'd be happier with explicit |
143 |
> boolean options instead of a set of boolean options. For example: |
144 |
> |
145 |
> confdefaults = { |
146 |
> 'autoresume': False, |
147 |
> 'ccache': False, |
148 |
> … |
149 |
> } |
150 |
|
151 |
Still applies to ca85cd4. Like I said above, I'm happy to work up a |
152 |
ConfigParser-based solution. |
153 |
|
154 |
> 04068a1 massive pyflakes import cleanup and broken CatalystError calls |
155 |
> |
156 |
> A lot of this is great stuff (Hooray no `import *`!). However, I'd |
157 |
> split the `print_traceback=True` changes out into their own commit (or |
158 |
> just change the default value for CatalystError while you're testing). |
159 |
> |
160 |
> It looks like an unrelated change to |
161 |
> catalyst.defaults.required_build_targets snuck into this commit. |
162 |
> |
163 |
> The hash_map changes should probably be squashed into the earlier hash |
164 |
> reorganization, rather than going into this commit. |
165 |
|
166 |
Still applies to eed08b1. |
167 |
|
168 |
> 5c689a8 update module loading for the new python structure, rename snapshot_target to snapshot |
169 |
> |
170 |
> I think I like this. It's good to use __import__. You're missing a |
171 |
> blank line after your import_module docstring summary [1]. |
172 |
> |
173 |
> I think that the import_module API should match Python 3's |
174 |
> importlib.import_module [2]. |
175 |
|
176 |
Still applies to still applies to f733b3f. |
177 |
|
178 |
> 669451d fix options being reset by a config file |
179 |
> |
180 |
> See my comments on c303dae. We should really be using ConfigParser's |
181 |
> defaults here, instead of rolling our own default system. |
182 |
|
183 |
ConfigParser :). |
184 |
|
185 |
> c5eb7f7 fix mounts, mountmap hardcoding removal, use normpath to fix paths, add some debug print statements, remove clear & purge code from support.py, |
186 |
> |
187 |
> Split the long commit summary. |
188 |
|
189 |
This was fixed in 9fabaae, but… |
190 |
|
191 |
> Can we use logging instead of print? |
192 |
> |
193 |
> The except (Failure loading " + x + " plugin) should be squashed into |
194 |
> the commit that caused it and be restricted to only catch |
195 |
> ImportErrors. |
196 |
> |
197 |
> The mountmap fix for 'proc' → '/proc' should be squashed into the |
198 |
> commit that caused it. |
199 |
> |
200 |
> - mypath=self.settings["chroot_path"] |
201 |
> + #mypath=self.settings["chroot_path"] |
202 |
> |
203 |
> Just remove this entirely, don't comment it out. |
204 |
|
205 |
… these were not. |
206 |
|
207 |
> a847803 Use normpath from support |
208 |
> |
209 |
> Why are we not using os.path.normpath? |
210 |
> |
211 |
> Also, remove instead of commenting out. |
212 |
|
213 |
Still applies to be413a4. |
214 |
|
215 |
> 242c17d rename all target .py file and classes without the "_target" so they are the same as the .sh files and work with teh simplified module loading. |
216 |
> |
217 |
> Move “so they …” into the commit message body and s/teh/the/. |
218 |
|
219 |
With 6a86874, the commit body has “This is so they are the named the |
220 |
same as the target…”, which should probably be “This is so they are |
221 |
named the same as the target…” (removing an extra “the”). |
222 |
|
223 |
> e05cc34 Break out a few more repeated (path1 + path2)'s to doing it once and using the temp variable. comment out some debug print's |
224 |
> |
225 |
> Long commit summary. |
226 |
|
227 |
This is fixed in 4dd2cb2, but… |
228 |
|
229 |
> os.path.join! Also, convert debug prints to use the logging module |
230 |
> ;). |
231 |
|
232 |
… these are not. |
233 |
|
234 |
> e0738c0 rename a make.conf key to make_conf due to bash variable name restrictions |
235 |
> |
236 |
> Squash into causing commit. |
237 |
|
238 |
Still applies to 253dab7. |
239 |
|
240 |
> ae61e4a reduce 2 operations into one simpler one |
241 |
> |
242 |
> Just switch to ConfigParser ;). |
243 |
|
244 |
Still applies to 92c6745. |
245 |
|
246 |
> b08a757 extend ParserBase to do variable substitution. |
247 |
> |
248 |
> ConfigParser does that to ;). |
249 |
|
250 |
Still applies to 104c387. |
251 |
|
252 |
> 265c8ed add a "shdir" setting to make moving the bash code around easier and have less hardcoded paths in the bash scripts |
253 |
> |
254 |
> Long commit summary. |
255 |
|
256 |
This is fixed in b433a82, but… |
257 |
|
258 |
> Your comment claims catalyst runtime executables for both sharedir and |
259 |
> shdir. |
260 |
|
261 |
… this is not. |
262 |
|
263 |
> 55a58ee Add a forced debug print statement in cmd() for better debug output |
264 |
> |
265 |
> Python logging. |
266 |
|
267 |
Still applies to 3791efc. |
268 |
|
269 |
> 24d69bd Commit my testpath file with instructions to run the git checkout code directly without being installed. |
270 |
> |
271 |
> s/caatalyst/catalyst/ |
272 |
> |
273 |
> It would also probably be a good idea to add an example test.conf with |
274 |
> relative paths. |
275 |
|
276 |
Still applies to 786a01c. |
277 |
|
278 |
Cheers, |
279 |
Trevor |
280 |
|
281 |
-- |
282 |
This email may be signed or encrypted with GnuPG (http://www.gnupg.org). |
283 |
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy |