Enable installation of pinnacle in environment without 'requests' #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thanks for the clean wrapper library :)
Previously, the setup.py imported the version of the package directory with
from pinnacle import __version__. The issue with this approach is that whensetup.pyimports from pinnacle package, it ends up trying to also importrequests.When installing in a clean python installation,
requestsis not available, thus installing the package is not possible without first installing requests manually.This method of extracting package version (with the drawbacks) is also listed as one of the possible options in https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-version.
This commit changes the versioning to follow a recent note on the same page, by adding the version in the
setup.cfgfile instead.Only more recent versions of
setuptoolssupport this (versions after 46.4 which has been released this spring). With older versions of setuptools, the installation of pinnacle package will fail if requests is not installed, as it has been failing up to this point.Even older versions of setuptools (tested with
setuptools 39.0, which is the default on ubuntu 18.04) are able to correctly set the package version inPKG-INFOduring installation even when it is only specified in thepinnacle.__init__.pyfile and not in thesetup.pyat all.In short, I see no drawbacks, only benefits :).