Skip to content

Explain why README.md should be added to sdist - #711

Merged
webknjaz merged 1 commit into
python:mainfrom
pastelmind:packaging-readme-update
Feb 23, 2021
Merged

webknjaz merged 1 commit into
python:mainfrom
pastelmind:packaging-readme-update

Conversation

@pastelmind

@pastelmind pastelmind commented Mar 13, 2020 •

Copy link
Copy Markdown
Contributor

Update sample setup.py to correctly load README.md when cwd is not the same directory that setup.py lives in (discussed in #696). The updated README-loading code is for Python 3+. Since Python 2 has been deprecated, it is probably safe to assume that anyone reading this guide is most likely using Python 3. The guide has been updated significantly since the inception of this PR, which obviates the setup.py changes. Also see #711 (comment)

Also explain why README.md should be added to the package (discussed in #696).

@merwok merwok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good change for setup.py doc.
Would be even simpler with metadata in setup.cfg but I guess that’s a bigger change!

@webknjaz

Copy link
Copy Markdown
Member

@pastelmind hey, do you mind synching this PR with the master? It now has conflicts :(

@pastelmind

Copy link
Copy Markdown
Contributor Author

I'm busy atm. I'll see what I can do after today.

@pastelmind

Copy link
Copy Markdown
Contributor Author

@webknjaz I merged master into my branch and resolved the conflicts

Comment thread source/tutorials/packaging-projects.rst Resolved
@pastelmind

Copy link
Copy Markdown
Contributor Author

@pfmoore Thank you. The file: directive greatly simplifies the code.

Base automatically changed from master to main January 21, 2021 18:44
@webknjaz

Copy link
Copy Markdown
Member

@pastelmind could you please resolve the merge conflict?

Comment thread source/tutorials/packaging-projects.rst Outdated
author_email="author@example.com",
description="A small example package",
long_description=long_description,
long_description="file:README.md",

@webknjaz webknjaz Feb 23, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be reverted: directives like file: only work in declarative config (setup.cfg) and this doesn't work in Python script (setup.py).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right! The document that was linked has most info in setup.cfg and a near-empty setup.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@webknjaz You are right. I checked by uploading a package on TestPyPI...and long_description="file:README.rst" does not do what I thought it would do. I will revert the changes and fix the merge conflicts as well.

@pastelmind

Copy link
Copy Markdown
Contributor Author

Because master/main has advanced significantly since this PR was created, I rebased the original commit (8f7d424) onto the current main. In doing so, I excluded the setup.py changes, leaving only the explanation for README.md. As such, it also drops any changes made in the following commits:

  • 1a739da Use relative path to get module directory
  • 0e1d934 Remove unnecessary os import
  • f7106c9 Use file: directive to specify README path

@pastelmind pastelmind changed the title Update README loading code; explain why README.md should be added to sdist Explain why README.md should be added to sdist Feb 23, 2021

@webknjaz webknjaz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect, thanks!

@webknjaz
webknjaz merged commit b5f05a7 into python:main Feb 23, 2021
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.

4 participants