Open Bug 1714690 Opened 4 years ago Updated 5 months ago

[meta] Remove usages of "six"

Categories

(Firefox Build System :: Mach Core, task, P3)

task

Tracking

(firefox104 affected)

104 Branch
Tracking Status
firefox104 --- affected

People

(Reporter: mhentges, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: good-first-bug, leave-open, meta)

Attachments

(3 files, 3 obsolete files)

Mach always runs with Python 3, so we should be able to remove six usages.

Future contributors 👋
Before jumping in to this ticket, see the list of six usages and decide on a specific section of code that you'd like to improve (e.g.: tools/tryselect). Then, leave a comment here or chat with a build member in the #build channel on Matrix, and we'll create a sub-bug that can be assigned to you. Looking forward to meeting you!

Keywords: good-first-bug
Priority: -- → P3
Blocks: goodbye-py2

this bug also can be converted into meta :)

Summary: Remove usages of "six" → [meta] Remove usages of "six"

Nice, thanks Shivam!
Note: this might be able to be automated with pyupgrade: https://github.com/asottile/pyupgrade

Removed six library, added str and bytes to values in Any()

Assignee: nobody → seanpedigo
Status: NEW → ASSIGNED

Hi, I've already written code to update toolkit/components/featuregates/gen_feature_definitions.py

This was a trivial change because I wanted to ensure that my first commit was small while I am still learning.

I'm not working right now, so while I have the time off I'd like to contribute a lot more here. Once I figure out what I need to do, or where I screwed up I think it would be pretty easy to knock most of this out pretty quickly. So please let me know where there are any mistakes, or anything that needs to be revised.

Thank you!

Depends on: 1751990

Hey, thanks for the patches!
A couple notes:

  1. Let's break up this work into separate sub-bugs, and associate patches with them accordingly. For example, for the first two patches you've provided here, I've created a bug for 'em here. You can do this by editing the commit message for your patches to refer to "Bug 1751990" instead, then re-moz-phab them to have them automatically update to point to the new bug.
    • In general, I'd recommend splitting this up by directory in python/* directory in testing/*, and otherwise by top-level directory.
  2. As part of this work, heads up in advance that code in third_party/python and testing/web-platform/tests/tools/third_party are third-party, and shouldn't be modified :)
  3. If you get the ERROR: Reformat python error in Phabricator, you can resolve that by running ./mach lint -l black --fix

Looking forward to working with you to have this six stuff cleaned up 😁

Depends on: 1752004
Attachment #9260420 - Attachment description: Bug 1714690 - Removed usages of six from components directory. r?mhentges → Bug 1714690 - Removed usages of six from /toolkit/components directory. r?mhentges
Attachment #9260420 - Attachment description: Bug 1714690 - Removed usages of six from /toolkit/components directory. r?mhentges → Bug 1714690 - Removed usages of six from components directory. r?mhentges
Attachment #9260891 - Attachment is obsolete: true

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: seanpedigo → nobody
Status: ASSIGNED → NEW
See Also: → 1763930

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Mach Core' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Mach Core
Assignee: nobody → ahochheiden
Status: NEW → ASSIGNED
Attachment #9260420 - Attachment is obsolete: true
Pushed by ahochheiden@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/029e0b6bd2ad Remove usages of "six" from gen_features_definitions r=mhentges,nalexander
Pushed by ahochheiden@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8af3093ff121 Removed usages of six from components directory. r=firefox-build-system-reviewers,nalexander
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: ahochheiden → nobody
Status: REOPENED → NEW

Hello I am new to contributing firefox nightly, I want to take one of the file in this issue as my first attempt
Can I get the chance?
Also I want to choose fix build/RunCbindgen.py

Hi Richard, go for it! I'll review any patch you submit.

Here's a link to help get you started: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#to-write-a-patch

Severity: -- → S3

(In reply to Alex Hochheiden [:ahochheiden] from comment #17)

Hi Richard, go for it! I'll review any patch you submit.

Here's a link to help get you started: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#to-write-a-patch

Hello I have a little question, after I get the source code and run it as the tutorial in https://firefox-source-docs.mozilla.org/setup/windows_build.html
I couldn't find the .git or .hg file in my directory
I asked people in https://chat.mozilla.org/#/room/#introduction:mozilla.org
Looks like I have to use git clone to clone the repo down
But the tutorial use wget

Do I need to git clone and re-build the whole project again?

Assignee: nobody → aj7499579
Status: NEW → ASSIGNED

Hochheiden [:ahochheiden]

Depends on D178515

(In reply to Alex Hochheiden [:ahochheiden] from comment #17)

Hi Richard, go for it! I'll review any patch you submit.

Here's a link to help get you started: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html#to-write-a-patch

Hello Alex, I've submit my patches and asked for your code review.
I am not sure If I did send the code review to you or not, If you didn't receive it pls let me know and I'll try to correct it.

Attachment #9334961 - Attachment is obsolete: true

Alex Hochheiden [:ahochheiden]
I've submit a patch and pass the auto review bot test, I would be thankful if you can review it for me.

Flags: needinfo?(ahochheiden)

I was on vacation, but also did not get the notification. If you want to add me specifically as a reviewer you need to add r?ahochheiden, but adding r?#build is usually preferred anyway (that goes to all build system reviewers).

I agree with Glandium's review comment, take care of that and we can move forward.

Also, please update the summary stating what you're doing.

Flags: needinfo?(ahochheiden)
Attachment #9334960 - Attachment description: Bug 1714690 - Remove usages of "six" in build/RunCbindgen.py. r?Alex → Bug 1714690 - Remove usages of "six" in build/RunCbindgen.py. r?#build
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/fb52e6ee18c6 Remove usages of "six" in build/RunCbindgen.py. r=firefox-build-system-reviewers,glandium

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.

Assignee: aj7499579 → nobody
Status: ASSIGNED → NEW
Depends on: 1848570
Depends on: 1870213
Depends on: 1884325
Depends on: 1884392
Depends on: 1884540
Depends on: 1885202
Depends on: 1891785
Depends on: 1891786
Depends on: 1891787
Depends on: 1892448
Depends on: 1894156
Depends on: 1934111
Depends on: 1935686

Excluding 'third_party' directory, there's 197 usages of 'import six' in 192 files left in mozilla-unified.
I want to add some patches to remove them. Do we need create separate tickets/bugs for each directory before raising patches? Or can I just start making patches?

Depends on: 1948502
Depends on: 1953603
Depends on: 1954222
Depends on: 1954875
Depends on: 1955787
Depends on: 1957129
Depends on: 1959188
Depends on: 1959849
Depends on: 1959942

Glad that https://bugzilla.mozilla.org/show_bug.cgi?id=1959849 has landed.
About 35-40% files containing import six no longer use it.

Is there something similar(and automated) planned for the rest(roughly, 100-120 files to go)?

Additionally, we can also create a task ticket to replace all instances of isinstance(s, (str,)) with isinstance(s, str) maybe. There's only about 45-50 of them.

Depends on: 1961909

(In reply to [:anutrix] from comment #29)

Is there something similar(and automated) planned for the rest(roughly, 100-120 files to go)?

There's nothing else planned as far as automatically doing migrations. I'm not aware of any pre-existing tools other than pyupgrade that have this feature, but if you find one (or want to try implementing your own) feel free to try and apply it.

Depends on: 1962959
Depends on: 1965505
Depends on: 1965692
Depends on: 1966404
Depends on: 1967109
Depends on: 1967982
Depends on: 1968046
No longer depends on: 1968046
No longer depends on: 1967982
Depends on: 1966413
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: