Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rearrange a codebase, metadata and make it abi3 compatible. (#6)
* Initial attempt to make some changes for abi3-compatibility. * Massive rearrangement. - Put source files in one package. - Add an __init__.py and __init__.pyi to provide a target for type stubs. - Probably too eager; typeshed will probably provide these until 3.12 is EOL. - Change setup configuration to a. Put as much as possible in pyproject.toml. b. Eliminate the need for setup.cfg. c. Don't break everything when attempting to build with `build` — the audioop header file just wasn't being seen. - Most importantly, make it abi3. i.e., the resulting wheel should be compatible for >=3.12 environments. * Account for some type errors and missing braces for an if clause. * Slight bit of cleanup in pyproject.toml and setup.py. * Revert the upgraded requirement to 3.12; it's true and makes it less annoying to publish before 3.13.0. * Fix license name Used the wrong one out of habit. * Don't lie too much for the abi tag. - More of a footgun than anything. * change ci to work on PRs * pin to the 3.13 rc for devcontainer, not a specific patch version * update project meta, name and python version constraints * Based on feedback, do restrict install to >=3.13. - Add a note in setup.py about the limited API compatibility being more permissive but would lead to potential clobbering if requires-python matched it. * Fix typo in comment and expand slightly. * Add a py.typed file. * change ci to work on PRs * pin to the 3.13 rc for devcontainer, not a specific patch version * update project meta, name and python version constraints * Remove setup.cfg again and update project name. * Ugly, but adding this back for a moment might fix the merge conflict? * And now delete it again. * Initial attempt to make some changes for abi3-compatibility. * Massive rearrangement. - Put source files in one package. - Add an __init__.py and __init__.pyi to provide a target for type stubs. - Probably too eager; typeshed will probably provide these until 3.12 is EOL. - Change setup configuration to a. Put as much as possible in pyproject.toml. b. Eliminate the need for setup.cfg. c. Don't break everything when attempting to build with `build` — the audioop header file just wasn't being seen. - Most importantly, make it abi3. i.e., the resulting wheel should be compatible for >=3.12 environments. * Account for some type errors and missing braces for an if clause. * Slight bit of cleanup in pyproject.toml and setup.py. * Revert the upgraded requirement to 3.12; it's true and makes it less annoying to publish before 3.13.0. * Fix license name Used the wrong one out of habit. * Don't lie too much for the abi tag. - More of a footgun than anything. * Based on feedback, do restrict install to >=3.13. - Add a note in setup.py about the limited API compatibility being more permissive but would lead to potential clobbering if requires-python matched it. * Fix typo in comment and expand slightly. * Add a py.typed file. * Implement the limited api and abi3 tag in a less hacky way. Source: https://github.com/pypa/wheel/issues/583 * Hardcode the limited api version on the wheel (both the macro and the tag) to be 3.13. - This should be the final necessary measure to avoid clobbering. * Remove a now unnecessary comment. * Improve types beyond what typeshed has. - Typeshed has argument types as `bytes` to substitute for buffers since buffers didn't have a representation in the type system for a long time. Now that `collections.abc.Buffer` exists, there's a better alternative. - This means that memoryview, bytarray, etc. won't show up as type-checker errors when given as inputs. - Tests actually type-check as a result. No changes to logic were made, just type annotations. - TODO: Consider upstreaming to typeshed? Reference material: - https://docs.python.org/3/library/typing.html#typing.ByteString - https://docs.python.org/3/library/collections.abc.html#collections.abc.Buffer - https://peps.python.org/pep-0688 - "No special meaning for bytes" mentions why these were annotated with `bytes` before. - https://typing.readthedocs.io/en/latest/source/modernizing.html#typing-bytestring --------- Co-authored-by: Alex Nørgaard <umbra@abstractumbra.dev>
- Loading branch information