Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport Python 3 #23607
Support Python 3 #23607
Comments
|
What is left to do here? I am willing to help if needed |
|
Ok, so pieces that I know about:
I think that's probably the full set of dependencies. |
|
Thanks! I've updated most of the pieces i knew of to be python3 compatible but ultimately ended up fighting with Traceback (most recent call last):
File "./mach", line 103, in <module>
main(sys.argv)
File "./mach", line 33, in main
mach = mach_bootstrap.bootstrap(topdir)
File "/home/adema/code/servo/python/mach_bootstrap.py", line 288, in bootstrap
import mach.main
File "/home/adema/code/servo/python/_virtualenv/lib/python3.6/site-packages/mach/main.py", line 34, in <module>
from .config import ConfigSettings
File "/home/adema/code/servo/python/_virtualenv/lib/python3.6/site-packages/mach/config.py", line 166
raise AttributeError().__class__, exc, tb On the |
|
I think we can be progressive and first do some syntactic changes, even if it doesn't work on Py3 yet. |
Done by #23748 |
I recommend reaching out to @ahal in that bug directly. |
|
Here is my WIP branch for Python3: https://github.com/marmeladema/servo/pull/new/issue-23607/python3 |
|
I checked the upstream |
|
Is anybody still working on this? |
|
I am regularly looking for upstream mach updates. Things are landing but still no new release at this point so we are stuck for the time being. |
|
Mach supports Python 3 now, but I had no idea anyone was using the pypi package. I'll see if I can get a new version uploaded.. though we haven't been super careful about keeping Mozilla central specifics out, so it might not work out of the box anymore. (This is something I wish it supported) It's been over three years since the last release. |
|
I think it might be viable to vendor a copy from |
|
Yeah that would work too. Either way I'm happy to version and release as needed. Just let me know next time you need an update :). Tbh I'm happy to learn of out of tree consumers. |
|
By default, it runs on Python2.7. I'd love to work on it if this issue is still open. |
|
Bug to bump + release mach: |
|
@mvashishth I already started, I am just waiting for a mach release to go forward. This should happens soon thanks to @ahal :-) |
|
@ahal do you plan to release version 1.0.0 on pypi soon? In the mean time, i'll try to vendor it in servo directly as proposed by @SimonSapin |
|
Done. |
|
Thank you very much! I made some progress in the past few days but i wonder if I should keep compatibility with Python2.7 or if i can migrate everything to Python 3? Right now most things work, but to properly finish migration it will require some work in |
I'm not from official Servo team, but I think support for Python 2 is not needed anymore. Python 2.7 will not be suported in 2020 so it would be insecure to use it. |
|
It would be unfortunate IMO to require both Python 2.7 and 3.x in order to build Servo (or some other task like running tests). Therefore, it would be nice if we could maintain compatibility with 2.7 until we are confident that everything supports 3.x. If such compat proves difficult or costly to implement or maintain, we can reconsider. |
|
We already require 2.7 and 3.x to build servo - mozjs won't build without pyhthon 3 available in your path. |
|
oh no |
Enable some mach commands to be run with python3 This change finally enable the following commands to be run with python3: * `build` * `test-unit` * `package` As previously explained, `test-tidy` will require more work in the wpt repository directly. Maybe `test-tidy --no-wpt` is achievable relatively quickly though. For possible remaining bits that might need to be worked on, see #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Enable some mach commands to be run with python3 This change finally enable the following commands to be run with python3: * `build` * `test-unit` * `package` As previously explained, `test-tidy` will require more work in the wpt repository directly. Maybe `test-tidy --no-wpt` is achievable relatively quickly though. For possible remaining bits that might need to be worked on, see #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Enable some mach commands to be run with python3 This change finally enable the following commands to be run with python3: * `build` * `test-unit` * `package` As previously explained, `test-tidy` will require more work in the wpt repository directly. Maybe `test-tidy --no-wpt` is achievable relatively quickly though. For possible remaining bits that might need to be worked on, see #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Make `mach test-tidy --no-wpt` compatible with Python3 Make `mach test-tidy --no-wpt` compatible with Python3 See also #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Make `mach test-tidy --no-wpt` compatible with Python3 Make `mach test-tidy --no-wpt` compatible with Python3 See also #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Make `mach test-tidy --no-wpt` compatible with Python3 Make `mach test-tidy --no-wpt` compatible with Python3 See also #23607 After this pull request, all python files (except WPT) will be checked for Python3 syntax compatibility. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Make `mach test-tidy --no-wpt` compatible with Python3 Make `mach test-tidy --no-wpt` compatible with Python3 See also #23607 After this pull request, all python files (except WPT) will be checked for Python3 syntax compatibility. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…=<try> Make `mach test-tidy --self-test` compatible with Python3 It now runs in CI to avoid future regressions. See #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…=jdm Make `mach test-tidy --self-test` compatible with Python3 It now runs in CI to avoid future regressions. See #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…=jdm Make `mach test-tidy --self-test` compatible with Python3 It now runs in CI to avoid future regressions. See #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…=jdm Make `mach test-tidy --self-test` compatible with Python3 It now runs in CI to avoid future regressions. See #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…=jdm Make `mach test-tidy --self-test` compatible with Python3 It now runs in CI to avoid future regressions. See #23607 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
Current support for Python3 is partially complete in the sense that most of servo itself is compatible with Python3 but WPT itself is not. The following commands are tested in CI under linux;
But for example, this does not work yet:
Maybe the readme should be updated for guidance on how to build using python3? |
Make tests/jquery/run_jquery.py Python3 compatible Attempt to make it py3 compatible. Ran the "python-migrate" tool, and did a couple of manual adjustments, which are directly noted with comments below. re: #23607 ``` (.env) [dalley@localhost servo]$ python3 ./mach test-jquery Already up to date. Testing jQuery on Servo! selector OK: element - jQuery only OK: id OK: class - jQuery only OK: name OK: selectors with comma OK: child and adjacent OK: attributes OK: disconnected nodes OK: disconnected nodes - jQuery only OK: attributes - jQuery.attr OK: jQuery.contains OK: jQuery.uniqueSort OK: Sizzle cache collides with multiple Sizzles on a page FAIL: Iframe dispatch should not affect jQuery (#13936): WAS ok=0 fail=1 total=1 NOW ok=1 fail=0 total=1 Ran 14 test groups. 1 unexpected results. 163 tests succeeded of 167 (97.60%) ``` Not sure if the test failure on the last one is an issue.
|
Something's wrong with pip in the virtual environment. I've tried using mach but it complains about no virtualenv being installed; which is false (Fedora 32 here). In any case, after activating the virtualenv; I tried to install the requirements. It fails:
|
|
You need to run |
|
This is the next error. I've deleted the incomplete virtualenv and did
|
|
OK, now, its eems it wants the devel package for python:
|
|
OK, after installing
So, it seems I need a bunch of devel libraries. Will stop posting until I get it right. Sorry for the SPAM.
|
|
Is there a specific branch/repo out there for python3 support/work? I'm getting the following error when building the master branch. Compiling ws v0.9.1 Caused by: |
|
There is not. We don't yet support python3 for the script crate code generation. |
We'll probably want to migrate to Python 3 because Python 2 will die next year.