← 返回首页
SIngle-sourcing the package version: Remove a py2-only option; simplify a py3 option by paulmelnikow · Pull Request #605 · pypa/packaging.python.org · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

SIngle-sourcing the package version: Remove a py2-only option; simplify a py3 option#605

Merged
theacodes merged 3 commits into
pypa:masterfrom
paulmelnikow:patch-2
Mar 30, 2019
Merged

SIngle-sourcing the package version: Remove a py2-only option; simplify a py3 option#605
theacodes merged 3 commits into
pypa:masterfrom
paulmelnikow:patch-2

Conversation

Copy link
Copy Markdown
Contributor

paulmelnikow commented Mar 28, 2019
edited
Loading

Thanks for this guide! I was using this and tried execfile() without realizing it didn't work in Python 3.

I thought about leaving the Python 2 version here with a disclaimer, though this list is already very long, and it seems more helpful to steer people toward a good solution than to exhaustively document an obsolete solution.

I simplified the Python 3 option to a version which seems equally safe without the context handler (it seems the file handle should be closed when it goes out of scope), which should be immediately upon return.

Thanks for this guide! I was using this and tried `execfile()` without realizing it didn't work in Python 3. I thought about leaving the Python 2 version here with a disclaimer, though this list is already very long, and it seems more helpful to steer people toward a good solution than to exhaustively document an obsolete solution.
paulmelnikow changed the title SIngle-sourcing the package version: Remove a py2-only option SIngle-sourcing the package version: Remove a py2-only option; simplify a py3 option Mar 28, 2019
Comment thread source/guides/single-sourcing-package-version.rst Outdated Show resolved Hide resolved
Co-Authored-By: paulmelnikow <github@paulmelnikow.com>
theacodes merged commit 9683e8d into pypa:master Mar 30, 2019
Copy link
Copy Markdown
Member

Thanks, @paulmelnikow!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.