Sometimes one needs to retrieve the version of pyclipper installed, but can't rely on mechanisms such as importlib.metadata because the metadata may not be there (e.g. pyclipper is embedded in a native application).
Setuptools_scm allows to generate a _version.py file, that we can import to re-export the conventional __version__ string, like many python modules do.
Until now, pyclipper was a single .pyx extension module; after this PR, it becomes a package directory with the same name, containing a _pyclipper extension module, plus the generated _version.py.
The public API of the top-level pyclipper module continues to work just like before (all symbols from pyclipper._pyclipper are star-imported by the parent module), the fact that the compiled part is moved to a private _pyclipper module is just an implementation detail.
A few tests that were checking that a DeprecationWarning was being raised when the deprecated pyclipper.SCALING_FACTOR global was modified by the user were failing after this change (because the global had been moved to pyclipper._pyclipper.SCALING_FACTOR, thus modifying pyclipper.SCALING_FACTOR made no change).
Since this feature was already no-op and had long been deprecated, I have just removed all references to it, so one won't get any deprecation warning.
Sometimes one needs to retrieve the version of pyclipper installed, but can't rely on mechanisms such as importlib.metadata because the metadata may not be there (e.g. pyclipper is embedded in a native application). Setuptools_scm allows to generate a
_version.py
file, that we can import to re-export the conventional__version__
string, like many python modules do. Until now, pyclipper was a single.pyx
extension module; after this PR, it becomes a package directory with the same name, containing a_pyclipper
extension module, plus the generated_version.py
. The public API of the top-levelpyclipper
module continues to work just like before (all symbols frompyclipper._pyclipper
are star-imported by the parent module), the fact that the compiled part is moved to a private_pyclipper
module is just an implementation detail.A few tests that were checking that a DeprecationWarning was being raised when the deprecated
pyclipper.SCALING_FACTOR
global was modified by the user were failing after this change (because the global had been moved topyclipper._pyclipper.SCALING_FACTOR
, thus modifyingpyclipper.SCALING_FACTOR
made no change). Since this feature was already no-op and had long been deprecated, I have just removed all references to it, so one won't get any deprecation warning.