Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyPI release needed #4

Closed
icemac opened this issue Jun 14, 2018 · 8 comments
Closed

PyPI release needed #4

icemac opened this issue Jun 14, 2018 · 8 comments
Assignees

Comments

@icemac
Copy link
Member

icemac commented Jun 14, 2018

After Python 3 support was added to this package a new release to PyPI is needed.

Could someone please cut a release or give me (icemac) the needed rights on PyPI?

@garyposter
Copy link
Contributor

I gave you privileges. Thank you!

@icemac
Copy link
Member Author

icemac commented Jun 15, 2018

I just released https://pypi.org/project/zc.relation/1.1/. But something went wrong with the long_description it seems to contain the whole PKG-INFO. I'll fix this in #6.

@icemac icemac closed this as completed Jun 15, 2018
@mgedmin
Copy link
Member

mgedmin commented Jun 15, 2018

That is a very peculiar long_description. How did you do the upload?

@icemac
Copy link
Member Author

icemac commented Jun 15, 2018

@mgedmin I used zest.releaser. I never had problems like this with this tool.

@jamadden
Copy link
Member

jamadden commented Jun 15, 2018

I think this is an unfortunate interaction stemming from when .txt files were renamed to .rst.

It all goes back to this line from setup.py:

setup(
   ...
   description=text("README.rst"),
   ...
)

The text helper function inserts newlines at the end of .rst files:

# simplified
def text(*args, **kwargs):
    # note: distutils explicitly disallows unicode for setup values :-/
    # http://docs.python.org/dist/meta-data.html
    tmp = []
    for a in args:
        if a.endswith('.rst'):
            f = open(os.path.join(*a.split('/')))
            tmp.append(f.read())
            f.close()
            tmp.append('\n\n')
        else:
             ...
    if len(tmp) == 1: # NEVER TRUE for .rst files, see above!
        res = tmp[0]
    else:
        res = ''.join(tmp)
    return res

So the description ends up being 'Index intransitive and transitive n-ary relationships.\n\n\n'

Which translates to PKG_INFO as

Metadata-Version: 2.1
Name: zc.relation
Version: 1.1
Summary: Index intransitive and transitive n-ary relationships.



Home-page: https://github.com/zopefoundation/zc.relation
Author: Gary Poster
Author-email: [email protected]
License: ZPL 2.1
Description: ================
        Relation Catalog
        ================

I know that wheel used the email libraries for dealing with metadata, leading to breakage, and I suspect PKG_INFO parsers did or do likewise, so the extra newlines after Summary would be interpreted as the end of the headers and beginning of the body. (EDIT: That's specified by metadata 2.1) The body is what gets rendered if there's no Description key, and the body isn't valid reST (unexpected indentation on line 6, Relation Catalog), so...mangled page on PyPI.

@icemac
Copy link
Member Author

icemac commented Jun 18, 2018

@jamadden Thank you for your deep analysis. I fixed the PyPI page although I needed two releases to achieve this. I should have read your analysis more care fully. Sorry.

@mgedmin
Copy link
Member

mgedmin commented Jun 18, 2018

Oh wow! This is also a setuptools bug IMHO: it should reject newlines in the description field.

@mgedmin
Copy link
Member

mgedmin commented Jun 18, 2018

Filed pypa/setuptools#1390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants