simion / pip-upgrader

An interactive pip requirements upgrader. It also updates the version in your requirements.txt file.
Apache License 2.0
512 stars 35 forks source link

No section: 'global' #6

Closed hawksight closed 6 years ago

hawksight commented 6 years ago

Getting an issue with what appears to be config-parser. Wondering if anyone else has seen this, its only popping up with pip-upgrade since installing into an existing porject 2 mins ago:

pip-upgrade

Found valid requirements file(s): requirements.txt Traceback (most recent call last): File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1138, in _unify_values sectiondict = self._sections[section] KeyError: 'global'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/pfiddes/PythonProjects/gcloud/bin/pip-upgrade", line 11, in sys.exit(main()) File "/Users/pfiddes/PythonProjects/gcloud/lib/python3.6/site-packages/pip_upgrader/cli.py", line 70, in main packages, options.get('--use-default-index')).detect_available_upgrades(options) File "/Users/pfiddes/PythonProjects/gcloud/lib/python3.6/site-packages/pip_upgrader/packages_status_detector.py", line 47, in init self._update_index_url_from_configs() File "/Users/pfiddes/PythonProjects/gcloud/lib/python3.6/site-packages/pip_upgrader/packages_status_detector.py", line 77, in _update_index_url_from_configs index_url = config.get('global', 'index-url') File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 781, in get d = self._unify_values(section, vars) File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1141, in _unify_values raise NoSectionError(section) configparser.NoSectionError: No section: 'global'

Contents of requirements.txt

appnope==0.1.0 astroid==1.5.3 cachetools==2.0.1 certifi==2017.7.27.1 chardet==3.0.4 decorator==4.1.2 dill==0.2.7.1 future==0.16.0 gapic-google-cloud-datastore-v1==0.15.3 gapic-google-cloud-error-reporting-v1beta1==0.15.3 gapic-google-cloud-logging-v2==0.91.3 gapic-google-cloud-pubsub-v1==0.15.4 gapic-google-cloud-spanner-admin-database-v1==0.15.3 gapic-google-cloud-spanner-admin-instance-v1==0.15.3 gapic-google-cloud-spanner-v1==0.15.3 gapic-google-cloud-speech-v1==0.15.3 google-auth==1.0.2 google-auth-httplib2==0.0.2 google-cloud==0.27.0 google-cloud-bigquery==0.26.0 google-cloud-bigtable==0.26.0 google-cloud-core==0.26.0 google-cloud-datastore==1.2.0 google-cloud-dns==0.26.0 google-cloud-error-reporting==0.26.0 google-cloud-language==0.27.0 google-cloud-logging==1.2.0 google-cloud-monitoring==0.26.0 google-cloud-pubsub==0.27.0 google-cloud-resource-manager==0.26.0 google-cloud-runtimeconfig==0.26.0 google-cloud-spanner==0.26.0 google-cloud-speech==0.28.0 google-cloud-storage==1.3.1 google-cloud-translate==1.1.0 google-cloud-videointelligence==0.25.0 google-cloud-vision==0.26.0 google-gax==0.15.14 google-resumable-media==0.2.3 googleapis-common-protos==1.5.2 grpc-google-iam-v1==0.11.1 grpcio==1.4.0 httplib2==0.10.3 idna==2.6 ipython==6.1.0 ipython-genutils==0.2.0 isort==4.2.15 jedi==0.10.2 lazy-object-proxy==1.3.1 mccabe==0.6.1 monotonic==1.3 oauth2client==4.1.2 pexpect==4.2.1 pickleshare==0.7.4 plumbum==1.6.3 ply==3.10 pprint==0.1 prompt-toolkit==1.0.15 proto-google-cloud-datastore-v1==0.90.4 proto-google-cloud-error-reporting-v1beta1==0.15.3 proto-google-cloud-logging-v2==0.91.3 proto-google-cloud-pubsub-v1==0.15.4 proto-google-cloud-spanner-admin-database-v1==0.15.3 proto-google-cloud-spanner-admin-instance-v1==0.15.3 proto-google-cloud-spanner-v1==0.15.3 proto-google-cloud-speech-v1==0.15.3 protobuf==3.3.0 psutil==5.2.2 ptyprocess==0.5.2 pyasn1==0.3.2 pyasn1-modules==0.0.11 Pygments==2.2.0 pylint==1.7.2 PyYAML==3.12 requests==2.18.4 rsa==3.4.2 simplegeneric==0.8.1 six==1.10.0 tenacity==4.4.0 traitlets==4.3.2 urllib3==1.22 wcwidth==0.1.7 wrapt==1.10.11

Using python3 in a virtual env: Python 3.6.2

Any clues?

simion commented 6 years ago

Yes, i know what's the issue. Will fix soon.

simion commented 6 years ago

Fixed and released v1.4.2.

Run pip-upgrade -p pip-upgrader

hawksight commented 6 years ago

Thanks @simion - really appreciate it. For reference and anyone else, I had to upgrade pip-upgrader with pip and then pip-upgrader worked :-)

pip3 install -U pip-upgrader

BTW - really nice product and awesome response time.

simion commented 6 years ago

Glad it works đŸ˜‰