Skip to content

Fix dropped leading characters c from constraints' packages#3250

Merged
gaborbernat merged 2 commits intotox-dev:mainfrom
jugmac00:fix-3247
Mar 24, 2024
Merged

Fix dropped leading characters c from constraints' packages#3250
gaborbernat merged 2 commits intotox-dev:mainfrom
jugmac00:fix-3247

Conversation

@jugmac00
Copy link
Copy Markdown
Member

lstrip takes a set, not a string, so .lstrip("-c ") did not work as intended.

Until we only support Python 3.9 or higher, we need to use a custom function to remove a prefix. With Python 3.9+ we can use the builtin .removeprefix.

This fixes #3247.

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

`lstrip` takes a set, not a string, so `.lstrip("-c ")` did not work as
intended.

Until we only support Python 3.9 or higher, we need to use a custom
function to remove a prefix. With Python 3.9+ we can use the builtin
`.removeprefix`.

This fixes tox-dev#3247.
@gaborbernat gaborbernat enabled auto-merge (squash) March 24, 2024 14:54
@gaborbernat gaborbernat merged commit 51ce2bc into tox-dev:main Mar 24, 2024
@jugmac00 jugmac00 deleted the fix-3247 branch March 24, 2024 15:41
Copy link
Copy Markdown
Contributor

@masenf masenf left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. I guess that was a day zero oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated constraints.txt eats the first c letter of packages

3 participants