I've reworked the APIs using all the feedback:
- now using basic types (dict + set) to make the code simpler - renamed the classes using the "Distribution" root name - the global functions are also now sys.path-based and there's no more global variable - egg_info -> egginfo - ...
Please comment !
On Tue, Jun 9, 2009 at 12:07 AM, Kevin Teaguekevin@bud.ca wrote:
Glancing over the EggInfo, EggInfoDirectories, and EggInfoDirectory APIs, it might be interesting if these were able to match with the PEP 3119 interfaces (http://www.python.org/dev/peps/pep-3119/).
For example, the EggInfoDirectories has __iter__, append, clear and remove methods, but the source code comments list them as 'container APIs'. Technically though, that's an Iterable interface and a partial implementation of the MutableSequence interface.
The EggInfoDirectories.get_egg_infos(project_name) is also suggestive of the Mapping interface - if this method was shortened from get_egg_infos() to just get().
Maybe it would be confusing if an EggInfoDirectories was a MutableSequence which could only have paths added to it, but returned an iterable of EggInfoDirectory, but could also be accessed as a Mapping where the keys are project names and those values are EggInfos ... but maybe something along those lines would work? _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
notice that I didn't change the PEP yet, all the changes are located in :
http://bitbucket.org/tarek/pep376/src/tip/pkgutil.py
I'll change the PEP text when the prototype is stabilized
On Thu, Jun 11, 2009 at 2:58 PM, Tarek Ziadéziade.tarek@gmail.com wrote:
I've reworked the APIs using all the feedback:
- now using basic types (dict + set) to make the code simpler
- renamed the classes using the "Distribution" root name
- the global functions are also now sys.path-based and there's no more
global variable
- egg_info -> egginfo
- ...
Please comment !
On Tue, Jun 9, 2009 at 12:07 AM, Kevin Teaguekevin@bud.ca wrote:
Glancing over the EggInfo, EggInfoDirectories, and EggInfoDirectory APIs, it might be interesting if these were able to match with the PEP 3119 interfaces (http://www.python.org/dev/peps/pep-3119/).
For example, the EggInfoDirectories has __iter__, append, clear and remove methods, but the source code comments list them as 'container APIs'. Technically though, that's an Iterable interface and a partial implementation of the MutableSequence interface.
The EggInfoDirectories.get_egg_infos(project_name) is also suggestive of the Mapping interface - if this method was shortened from get_egg_infos() to just get().
Maybe it would be confusing if an EggInfoDirectories was a MutableSequence which could only have paths added to it, but returned an iterable of EggInfoDirectory, but could also be accessed as a Mapping where the keys are project names and those values are EggInfos ... but maybe something along those lines would work? _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | http://ziade.org _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
The code is much more readable with the Distribution root name in the classes now I think.
I've made a small tweak the code and changed the _DistributionMetadata class to a _parse_distribution_metadata function instead. I think the code is a bit simpler this way, since then the DistributionDirectory.metadata attribute is just a straight distutils.dist.DistributionMetadata class.
http://bitbucket.org/wheat/pep376-minor-refactoring/changeset/c71fa8f3bca5/
(and I hope I've got the bit-bucketery going on correctly here ... I'm a bitbucket noob)
(oh, and that changeset also contains a t
On Fri, Jun 12, 2009 at 10:08 PM, Kevin Teaguekevin@bud.ca wrote:
The code is much more readable with the Distribution root name in the classes now I think.
I've made a small tweak the code and changed the _DistributionMetadata class to a _parse_distribution_metadata function instead. I think the code is a bit simpler this way, since then the DistributionDirectory.metadata attribute is just a straight distutils.dist.DistributionMetadata class.
Well, when PEP 376 will be applied in Distutils and pkgutil, I would rather have a DistributionMetadata class that handles writing *and* reading of PKG-INFO files, so it feels more natural to me to add the reading feature within the class rather than in a function wrapper.
Plus, it makes it possible for third-party tools to instanciate DistributionMetadata to work with this file, which would be impossible if the code we add is a private function.
Also, Phillip proposed to move this class to pkgutil and remove it from Distutils, which makes sense, so maybe we should take the whole class and put it in pkgutil, maybe in its own "metadata" module, e.g. make pkgutil become a package so pkgutil.py doesn't grow too much
(oh, and that changeset also contains a t
A cool, that was a bad renaming, I'll apply that change thx
I am adding you as a developer in bitbucket to simplify things
Thanks Tarek
Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig