Skip to content

Run pyupgrade on codebase#5726

Merged
auvipy merged 13 commits into
v5-devfrom
pyupgrade
Oct 4, 2019
Merged

Run pyupgrade on codebase#5726
auvipy merged 13 commits into
v5-devfrom
pyupgrade

Conversation

@thedrow

@thedrow thedrow commented Sep 11, 2019

Copy link
Copy Markdown
Contributor

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

pyupgrade is an automatic tool that upgrades codebases to Python 3.
I think it did the trick pretty well.
The unit tests pass so that's something.

@auvipy

auvipy commented Sep 11, 2019

Copy link
Copy Markdown
Member

looks really interesting!!!

Comment thread t/unit/worker/test_worker.py Outdated
Comment thread t/unit/tasks/test_result.py Outdated
Comment thread t/unit/conftest.py
Comment thread t/unit/backends/test_cache.py Outdated
Comment thread t/unit/apps/test_multi.py Outdated
Comment thread t/unit/app/test_schedules.py Outdated
Comment thread t/unit/app/test_control.py
Comment thread t/distro/test_CI_reqs.py
Comment thread t/benchmarks/bench_worker.py Outdated
@thedrow

thedrow commented Sep 12, 2019

Copy link
Copy Markdown
Contributor Author

pyupgrade is very conservative in transforming strings into format strings.
We can do the rest of the work manually.

@codecov

codecov Bot commented Sep 12, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (v5-dev@7d7a062). Click here to learn what that means.
The diff coverage is 87.89%.

Impacted file tree graph

@@            Coverage Diff            @@
##             v5-dev    #5726   +/-   ##
=========================================
  Coverage          ?   83.06%           
=========================================
  Files             ?      144           
  Lines             ?    16394           
  Branches          ?     2048           
=========================================
  Hits              ?    13618           
  Misses            ?     2558           
  Partials          ?      218
Impacted Files Coverage Δ
celery/security/utils.py 100% <ø> (ø)
celery/bin/worker.py 96.42% <ø> (ø)
celery/events/cursesmon.py 100% <ø> (ø)
celery/security/__init__.py 93.75% <ø> (ø)
celery/events/__init__.py 100% <ø> (ø)
celery/bin/beat.py 90.9% <ø> (ø)
celery/app/annotations.py 64.51% <ø> (ø)
celery/security/key.py 100% <ø> (ø)
celery/app/backends.py 63.33% <ø> (ø)
celery/app/trace.py 99.68% <ø> (ø)
... and 117 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d7a062...31c2424. Read the comment docs.

@georgepsarakis georgepsarakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems quite accurate, nice work indeed.

Comment thread celery/app/utils.py
try:
conn = app.connection()
driver_v = '{0}:{1}'.format(conn.transport.driver_name,
driver_v = '{}:{}'.format(conn.transport.driver_name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think now the indentation on line 343 is wrong.

Comment thread celery/bin/graph.py
Comment thread celery/worker/loops.py
Comment thread t/unit/contrib/test_sphinx.py
Comment thread celery/utils/log.py
@thedrow

thedrow commented Sep 16, 2019

Copy link
Copy Markdown
Contributor Author

@auvipy Should we merge this?
You didn't approve the PR yet.

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sorry, my reveiw wasn't complete.

Comment thread celery/app/utils.py Outdated
Comment thread celery/app/utils.py Outdated
Comment thread celery/apps/multi.py Outdated
Comment thread celery/apps/worker.py Outdated
Comment thread celery/apps/worker.py Outdated
Comment thread celery/utils/saferepr.py
Comment thread celery/utils/saferepr.py Outdated
Comment thread celery/utils/saferepr.py Outdated
Comment thread celery/utils/serialization.py Outdated
Comment thread celery/utils/time.py Outdated

@thedrow thedrow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please review again.

@thedrow
thedrow requested a review from a team October 3, 2019 11:28
@auvipy

auvipy commented Oct 3, 2019

Copy link
Copy Markdown
Member

good job. just one suggestion, you could pull from master here, this will keep the v5 PR clean from merge from the master.

@auvipy

auvipy commented Oct 3, 2019

Copy link
Copy Markdown
Member

t/unit/apps/test_multi.py:8: in

from celery.apps.multi import (Cluster, MultiParser, NamespacedOptionParser,

E File "/home/travis/build/celery/celery/celery/apps/multi.py", line 130

E self.cmd = cmd or f'-m {celery_exe('worker', '--detach')}'

E ^

E SyntaxError: invalid syntax

@thedrow