beetbox / audioread

cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python
MIT License
481 stars 108 forks source link

Remove support for Python 2 and require > 3.6 #114

Closed Bomme closed 2 years ago

Bomme commented 2 years ago

I used pyupgrade to do an automatic upgrade. Then looked through the modules to remove code that explicitly mentioned Python 2.

I don't have any experience with travis, so I guessed how the new configuration could look like :)

Closes #112.

Bomme commented 2 years ago

I found two things that I did not touch yet which are probably not required anymore in py3:

            # In Python 3, result of reading from stderr is bytes.
            if isinstance(line, bytes):
                line = line.decode('utf8', 'ignore')

and

# Python 3.4 added support for 24-bit (3-byte) samples.
SUPPORTED_WIDTHS = (1, 2, 3, 4)

But I didn't want to change too many things at once.

Bomme commented 2 years ago

I replaced travis with GitHub Actions and tests are passing. (I guess the Actions appear in this repo after this is merged. For now you can check them in my fork)

I guess a new major version would be the correct way. This gives the possibility of including other breaking changes and only do one release (if you plan to do any other breaking changes)

sampsyo commented 2 years ago

Nice!! Yes, it does seem just fine to leave some of that stuff to future PRs; picking the low-hanging fruit seems like the way to go.

And thank you for setting up GitHub Actions!!! This is super great! I'll merge this now and bump the version.