Skip to content

Commit

Permalink
Fix README and setup.py faults preventing upload to PyPI
Browse files Browse the repository at this point in the history
- `license` should have only a description, not full text
- be explicit about ReST format of long description document
- remove `:ref:` external document references because PyPI doesn't
  support them in a project README, and they also look terrible
  in GitHub.
  • Loading branch information
jmurty committed Mar 9, 2020
1 parent 87210d2 commit 83bc0a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
20 changes: 8 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,8 @@ Let's start with an example XML document::
<... more Film elements here ...>
</MontyPythonFilms>

With *xml4h* you can :ref:`parse the XML file <parser-parse>` and use
:ref:`"magical" element and attribute lookups <magical-node-traversal>`
to read data::
With *xml4h* you can parse the XML file and use "magical" element and attribute
lookups to read data::

>>> import xml4h
>>> doc = xml4h.parse('tests/data/monty_python_films.xml')
Expand All @@ -101,19 +100,17 @@ to read data::
1974 : Monty Python and the Holy Grail
1979 : Monty Python's Life of Brian

You can also use more :ref:`explicit (non-magical) methods <node-traversal>`
to traverse the DOM::
You can also use more explicit (non-magical) methods to traverse the DOM::

>>> for film in doc.child('MontyPythonFilms').children('Film')[:3]:
... print(film.attributes['year'] + ' : ' + film.children.first.text)
1971 : And Now for Something Completely Different
1974 : Monty Python and the Holy Grail
1979 : Monty Python's Life of Brian

The :ref:`*xml4h* builder <builder>` makes programmatic document creation
simple, with a :ref:`method-chaining feature <builder-method-chaining>` that
allows for expressive but sparse code that mirrors the document itself.
Here is the code to build part of the above XML document::
The *xml4h* builder makes programmatic document creation simple, with a
method-chaining feature that allows for expressive but sparse code that mirrors
the document itself. Here is the code to build part of the above XML document::

>>> b = (xml4h.build('MontyPythonFilms')
... .attributes({'source': 'http://en.wikipedia.org/wiki/Monty_Python'})
Expand Down Expand Up @@ -143,9 +140,8 @@ Here is the code to build part of the above XML document::
... )

Pretty-print your XML document with *xml4h*'s writer implementation with
methods to :ref:`write content to a stream <writer-write-methods>` or :ref:`get
the content as text <writer-xml-methods>` with flexible :ref:`formatting
options <writer-formatting>`::
methods to write content to a stream or get the content as text with flexible
formatting options::

>>> print(b.xml_doc(indent=4, newline=True)) # doctest: +ELLIPSIS
<?xml version="1.0" encoding="utf-8"?>
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
version=xml4h.__version__,
description='XML for Humans in Python',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
author='James Murty',
author_email='james@murty.co',
url='https://github.com/jmurty/xml4h',
Expand All @@ -26,7 +27,7 @@
install_requires=[
'six',
],
license=open('LICENSE').read(),
license='MIT License',
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 83bc0a9

Please sign in to comment.