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

Read README as utf-8 text and set the content_type to text/markdown #26

Merged
merged 2 commits into from Aug 24, 2018

Conversation

florisla
Copy link
Collaborator

@florisla florisla commented Aug 1, 2018

This is an improvement on #24 and fixes #17.

The generated wheel file contains the correct content_type and 'README' content.

ekohl
ekohl previously requested changes Aug 1, 2018
setup.py Outdated
try:
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except FileNotFoundError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exception was introduced in Python 3.something. Sadly it doesn't work on py2.

setup.py Outdated
try:
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
except IOError:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure we should be catching that exception. It should always exist and otherwise it's an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will update.

setup.py Outdated
here = os.path.abspath(os.path.dirname(__file__))
try:
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why start with a newline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just looks nicer in the *.dist-info/METADATA file in the wheel package.

setup.py Outdated
# Import the README and use it as the long-description.
# This requires 'README.md' to be present in MANIFEST.in.
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encoding is not a valid parameter on python 2. It's better to use io.open which should already be present on python 2.7.

@ekohl
Copy link
Collaborator

ekohl commented Aug 1, 2018

Could you rebase on master and see if it fixes the tests on travis with 3.4?

This requires an up-to-date setuptools; older versions will complain about it
(without crashing).
@florisla
Copy link
Collaborator Author

florisla commented Aug 2, 2018

No luck with AppVeyor or Travis... any suggestions?

@c4urself
Copy link
Owner

@florisla -- there's work on the AppVeyor passing tests in this PR: #33 -- don't strictly need that passing for a merge here.

@c4urself c4urself dismissed ekohl’s stale review August 24, 2018 14:30

comments were addressed

@c4urself c4urself merged commit b94faba into c4urself:master Aug 24, 2018
@florisla florisla deleted the readable-readme branch August 28, 2018 12:20
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

Successfully merging this pull request may close these issues.

README on pypi.org not readable
3 participants