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

Attempt on improving encoding in setuptools.tests #4261

Merged
merged 18 commits into from Mar 7, 2024

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Mar 6, 2024

Summary of changes

Improve encoding warnings in files inside the setuptools/tests directory.

The following approaches were used:

  1. Simply add encoding="utf-8"
  2. Use open(..., "wb").close() instead of open(..., "w").close() when appropriate
  3. Use jaraco.path.build instead of Path.write_text when appropriate.

According to #4234 (review) the changes that use approach (1) should be uncontroversial. I also believe that changes that use approach (2) are very trivial and make sense (because the main objective is to "touch" the file). But this PR does include some less trivial refactoring when going for approach (3).

Working towards the approach discussed in #4234 (review)

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review March 6, 2024 20:14
@abravalheri
Copy link
Contributor Author

abravalheri commented Mar 7, 2024

The non-trivial changes in this PR (like refactoring involving jaraco.path.build, mentioned as "approach (3)" above) are mainly to tests that I have written in the past, so even if they change a little bit the implementation detail, it should be fine.

@abravalheri abravalheri merged commit bac21fd into pypa:main Mar 7, 2024
21 of 23 checks passed
@abravalheri abravalheri deleted the encoding-in-tests branch March 7, 2024 09:02
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.

None yet

1 participant