Skip to content

Attempt on improving encoding in setuptools.tests#4261

Merged
abravalheri merged 18 commits intopypa:mainfrom
abravalheri:encoding-in-tests
Mar 7, 2024
Merged

Attempt on improving encoding in setuptools.tests#4261
abravalheri merged 18 commits intopypa:mainfrom
abravalheri:encoding-in-tests

Conversation

@abravalheri
Copy link
Copy Markdown
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
Copy Markdown
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
@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.

1 participant