10000 Upgrade development dependencies, fix some types by evgenymarkov · Pull Request #865 · prometheus/client_python · GitHub
[go: up one dir, main page]

Skip to content

Upgrade development dependencies, fix some types #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2022
Merged

Upgrade development dependencies, fix some types #865

merged 1 commit into from
Dec 6, 2022

Conversation

evgenymarkov
Copy link
Contributor

Hello ✋🏻 I decided to fix one problem in the library, but along the way I ran into another problem - flake8 did not work.

Traceback here
evgenymarkov@hellroot python-prometheus % python -m tox -e flake8
flake8 recreate: /Users/evgenymarkov/Personal/python-prometheus/.tox/flake8
flake8 installdeps: flake8==3.7.8, flake8-docstrings==1.5.0, flake8-import-order==0.18.1
flake8 installed: entrypoints==0.3,flake8==3.7.8,flake8-docstrings==1.5.0,flake8-import-order==0.18.1,mccabe==0.6.1,pycodestyle==2.5.0,pydocstyle==6.1.1,pyflakes==2.1.1,snowballstemmer==2.2.0
flake8 run-test-pre: PYTHONHASHSEED='1913327212'
flake8 run-test: commands[0] | flake8 prometheus_client/ tests/ setup.py
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
File "/Users/evgenymarkov/.pyenv/versions/3.10.6/lib/python3.10/multiprocessing/pool.py", line 125, in worker
  result = (True, func(*args, **kwds))
File "/Users/evgenymarkov/.pyenv/versions/3.10.6/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
  return list(map(*args))
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/checker.py", line 666, in _run_checks
  return checker.run_checks()
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/checker.py", line 598, in run_checks
  self.run_ast_checks()
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/checker.py", line 502, in run_ast_checks
  for (line_number, offset, text, check) in runner:
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8_import_order/flake8_linter.py", line 91, in run
  for error in self.check_order():
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8_import_order/checker.py", line 55, in check_order
  style_entry_point = self.options['import_order_style']
TypeError: 'NoneType' object is not subscriptable
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/bin/flake8", line 8, in <module>
  sys.exit(main())
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/main/cli.py", line 18, in main
  app.run(argv)
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/main/application.py", line 393, in run
  self._run(argv)
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/main/application.py", line 381, in _run
  self.run_checks()
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/main/application.py", line 300, in run_checks
  self.file_checker_manager.run()
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/checker.py", line 329, in run
  self.run_parallel()
File "/Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/lib/python3.10/site-packages/flake8/checker.py", line 293, in run_parallel
  for ret in pool_map:
File "/Users/evgenymarkov/.pyenv/versions/3.10.6/lib/python3.10/multiprocessing/pool.py", line 451, in <genexpr>
  return (item for chunk in result for item in chunk)
File "/Users/evgenymarkov/.pyenv/versions/3.10.6/lib/python3.10/multiprocessing/pool.py", line 873, in next
  raise value
TypeError: 'NoneType' object is not subscriptable
ERROR: InvocationError for command /Users/evgenymarkov/Personal/python-prometheus/.tox/flake8/bin/flake8 prometheus_client/ tests/ setup.py (exited with code 1)
____________________________________________________________ summary _____________________________________________________________
ERROR:   flake8: commands failed

I managed to fix this by updating Flake8 to the latest version. I also updated Mypy to the latest version and it found some typing errors. I fixed it.

Signed-off-by: Evgeny Markov <evgenymarkov@yandex.com>
@evgenymarkov
Copy link
Contributor Author
evgenymarkov commented Dec 4, 2022

Sorry, I can't start CI pipeline because of CircleCI restrictions. I was on the territory of the Russian Federation at the time of registration of the CircleCI account. Now they don't let me use CI even though I left Russia 😥

@evgenymarkov evgenymarkov marked this pull request as ready for review December 4, 2022 15:21
Copy link
Member
@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I ran the tests locally and everything worked well, annoying that CircleCI isn't possible to run though :(. I didn't find any options for me to run it either without duplicating your branch.

@csmarchbanks csmarchbanks merged commit d6e08e3 into prometheus:master Dec 6, 2022
@evgenymarkov evgenymarkov deleted the upgrade-deps branch December 6, 2022 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0