Skip to content

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

Merged
gaborbernat merged 1 commit intopypa:mainfrom
FredStober:main
May 9, 2024
Merged

Update activate_this.py documentation to use runpy instead of exec#2716
gaborbernat merged 1 commit intopypa:mainfrom
FredStober:main

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

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.

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