zestsoftware / zest.releaser

Python software releasing made easy and repeatable
https://zestreleaser.readthedocs.io
GNU General Public License v2.0
198 stars 62 forks source link

Encoding config option #275

Closed mauritsvanrees closed 6 years ago

mauritsvanrees commented 6 years ago

Fixes issue #264, see discussion there.

I fought a bit with the difference between a few possibilities to read this:

I opted for the second way. That also meant that I found an undocumented option history_file and changed that to use the second way. So I included that in this PR. I kept the commits separate, so you can view them separately if you want.

mauritsvanrees commented 6 years ago

One extra comment: read_text_file() has a fallback_encoding argument. Is that necessary? Or could the function look it up itself? (I assume "it is necessary", though).

Technically, we could call config = pypi.PypiConfig(); fallback_encoding = config.encoding() in read_text_file. But then you instantiate the PypiConfig multiple times, which sounds wrong. It doesn't take long, so it may be okay. But I am also half wondering if utils.py would be able to find the right setup.cfg if we are not in the root directory. Maybe best to leave it this way.

I guess there is room for a more thorough overhaul of the package if we want to clean it up, rethinking decisions that we made in the past, and making it more clear what other packages (especially zest.releaser hooks) can depend on as api.

reinout commented 6 years ago

Ok, clear!