Enable installation of pinnacle in environment without 'requests'#23
Open
miikama wants to merge 1 commit intorozzac90:masterfrom
Open
Enable installation of pinnacle in environment without 'requests'#23miikama wants to merge 1 commit intorozzac90:masterfrom
miikama wants to merge 1 commit intorozzac90:masterfrom
Conversation
Previously, the setup.py imported the version of the package directory with `from pinnacle import __version__`. The issue with this is that when setup.py imports from pinnacle package, it ends up trying to also import 'requests'. When installing in a clean python installation, requests is 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.cfg file instead. Only more recent versions of setuptools support this (versions after 46.4 which has been released this spring). With older versions of setuptools, the installation fails if requests is not installed, as it has been failing up to this point. Even older versions of setuptools (tested with 39.0 default on ubuntu 18.04) are able to extract the package version from the package even though it is not specified in setup.py and store it in PKG-INFO during package installation. Thus, I see no drawbacks, only benefits :).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 :).