Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp Python build system to fix multiple build problems (#6)
* Revamp Python build system to fix multiple build problems Use `pyproject.toml` to define build metadata. This enables the following improvements: * `pycocotools.mask` previously failed to load if the NumPy version was downgraded after `pycocotools` was installed, due to an ABI mismatch. This is fixed by using the oldest supported NumPy version for the current environment as the build dependency. * Installing `pycocotools` no longer installs Cython as a dependency (it's not needed at runtime). * `pycocotools` can now be installed without having `setuptools` in your environment. All this is accomplished at the price of more strict system requirements: * Required Python version is now 3.5+, primarily because that is what `oldest-supported-numpy` requires. Notably, this means that Python 2 support is dropped. * pip 10 or higher is required to install `pycocotools` from an sdist. The setuptools requirement is bumped to 43, because setuptools includes pyproject.toml in the sdist starting with this version. However, this has no impact on users, since pip will automatically fetch the correct version. Additionally, update the documentation to recommend using `pip` to install the project, instead of running `setup.py` directly. This ensures that the build result is the same as you would get by installing from an sdist. pip 21.1+ is required for this, because it uses the `in-tree-build` feature. * Add tests to both installation methods * Undo my change as CI is not running for PRs Co-authored-by: Yuxin Wu <[email protected]>
- Loading branch information