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

Update activate_this.py documentation to use runpy instead of exec #2716

Merged
merged 1 commit into from
May 9, 2024

Conversation

FredStober
Copy link
Contributor

@FredStober FredStober commented May 8, 2024

runpy.run_path was added in python 2.7 and 3.2 - and every python that is not EOL supports it.

It is arguably nicer to read and the path is only given once in the command.

At least right now, runpy - unlike exec with S102 - is not flagged by bandit or bandit-derived (eg. ruff) checks.
(I guess because it loads from a file instead of a simple string...)

Because of the import, it is also not a one-liner anymore.

Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix - the change only updates documentation
  • added news fragment in docs/changelog folder: This is a tiny change, so I'm not sure it warrants a news fragment
  • updated/extended the documentation

@@ -180,7 +180,7 @@ def get_dependencies(whl, version):
platforms = []
platform_positions = WheelDownloader._marker_at(markers, "sys_platform")
deleted = 0
for pos in platform_positions: # can only be ore meaningfully
for pos in platform_positions: # can only be more meaningfully
Copy link
Member

Choose a reason for hiding this comment

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

"more" doesn't make sense here. Was the typo meant to be "one"? I'm not sure if that makes any more sense, but at least it's a grammatically complete phrase...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tbh - that whole comment didn't make sense to me either - but pre-commit wanted to change it. I'm happy to leave it out, since it's in a file I was not really interested in :)

Copy link
Contributor

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

@gaborbernat gaborbernat merged commit e28dfa7 into pypa:main May 9, 2024
2 checks passed
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.

3 participants