This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Meta-data XML output
Type: Stage:
Components: Distutils Versions:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, amosl
Priority: normal Keywords: patch

Created on 2001-03-10 01:31 by amosl, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
distutils.patch amosl, 2001-03-10 21:58 distutils meta-data patch
diff akuchling, 2001-03-20 15:03 PEP 241 patch
diff akuchling, 2001-03-21 02:52 Final PEP 241 patch
Messages (7)
msg36028 - (view) Author: Amos Latteier (amosl) Date: 2001-03-10 01:31
This patch improves the DistributionMetadata class. It 
adds the
ability to save and load meta-data to and from simple 
XML files. This is needed since my experience shows 
that it
is often impossible to extract meta-data from setup.py 
files.
This patch will enable programs like the catalog to 
read 
distribution metadata without running setup.py.

It also beefs up the DistributionMetadata class so 
that it now
functions like a dictionary, rather than an empty 
class. This means
that getting data is more intuitive and meta-data 
names no longer need
to be legal Python identifiers.

Finally the patch fixes the sdist and bdist_wininst 
modules to work
correctly with the new DistributionMetadata class. 
Note: IMHO, using
DistributionMetadata instances in now more pleasant.

The next step is to make meta-data be written to a 
file (metadata.xml)
when a distribution is created. I wasn't sure where 
the right place to
do this was, so I haven't included a patch for it. All 
that is needed
though is something like the following:

  m=distribution.metadata
  f=open('metadata.xml', 'wb')
  m.write_data(f)
  f.close()

The distutils themselves won't have any need to read 
meta-data files,
but other programs such as the catalog will. Those 
programs can do the
following:

  from distutils.dist import DistributionMetadata
  m=DistributionMetadata()
  f=open('metadata.xml', 'rb')
  m.read_data(f)
  f.close()
  # At this point m is a dictionary mapping meta-data 
names to values

msg36029 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-10 19:51
Logged In: YES 
user_id=11375

You seem to have run into the SourceForge file upload bug,
because there isn't a patch attached.  You may want to try
again, or put it on the Web somewhere.
msg36030 - (view) Author: Amos Latteier (amosl) Date: 2001-03-10 21:58
Logged In: YES 
user_id=157880

I am attempting to upload the patch again.
msg36031 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-10 22:25
Logged In: YES 
user_id=11375

That worked.  The patch looks reasonable.  

There's little point in checking it in
at this point, though, until we settle on the metadata
fields and decide the XML-vs-other-formats question.
msg36032 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-20 15:03
Logged In: YES 
user_id=11375

Here's a different patch, not really derived from Amos's,
that writes a PKG-INFO file when generating a source
distribution.

Still to resolve:
   * Is there a finalize_options() on the Distribution class
where the keywords and platforms values can be converted 
from strings to lists?

   * Documentation.
msg36033 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-21 02:52
Logged In: YES 
user_id=11375

Final version, and believed ready to check in.  
write_pkg_info() 
is now a method on the DistributionMetadata class as
suggested by Amos, and a finalize_options() method has been
added to Distribution.
msg36034 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2001-03-22 16:24
Logged In: YES 
user_id=11375

Checked in.
History
Date User Action Args
2022-04-10 16:03:51adminsetgithub: 34128
2001-03-10 01:31:09amoslcreate