-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
matrix-synapse: prepare for python3 switch #48695
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
Conversation
Slight change of plans. With this commit, we can swap python2 for python3 to run synapse using python3 instead. The reason for not making the switch is that a number of CLI tools provided with synapse do not yet work under py3 despite synapse running fine. So this doesn't actually do anything on its own except to prepare for the upcoming py3 switch. |
This, in its current state, looks like a rather harmless refactoring of synapse. OTOH I wonder, why is an override of Anyway, it'll be great when python3 support will be complete! @GrahamcOfBorg test matrix-synapse |
Success on x86_64-linux (full log) Attempted: tests.matrix-synapse Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: tests.matrix-synapse Partial log (click to expand)
|
Because it makes it super easy to build either with python2 or python3 and I was trying to actually override the |
Well, it somehow feels a bit like unneeded complexity, then? Apart from that (feel free to ignore, it's marginal), r+ from me :) Also I'm wondering, you say:
Do you think it'd be possible to add a test / enrich the matrix-synapse test so that the error you initially made could be detected? (I must say I didn't check which tools don't work yet under py3) |
Even without using an override, everything still keys off the same import, no? |
matrix-synapse-ldap3 = python2Packages.buildPythonPackage rec { | ||
pname = "matrix-synapse-ldap3"; | ||
version = "0.1.3"; | ||
src = fetchurl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchPypi
}; | ||
in python2Packages.buildPythonApplication rec { | ||
|
||
in with py.pkgs; buildPythonApplication rec { | ||
name = "matrix-synapse-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "matrix-synapse-${version}"; | |
pname = "matrix-synapse"; |
|
||
checkInputs = with python2Packages; [ ldaptor mock ]; | ||
propagatedBuildInputs = with super; [ service-identity ldap3 twisted ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
propagatedBuildInputs = with super; [ service-identity ldap3 twisted ]; | |
propagatedBuildInputs = with self; [ service-identity ldap3 twisted ]; |
propagatedBuildInputs = with super; [ service-identity ldap3 twisted ]; | ||
|
||
# ldaptor is not ready for py3 yet | ||
doCheck = !super.isPy3k; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doCheck = !super.isPy3k; | |
doCheck = !self.isPy3k; |
even though it doesn't matter in this case
|
||
propagatedBuildInputs = with python2Packages; [ service-identity ldap3 twisted ]; | ||
src = fetchFromGitHub { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not fetchPypi
? Are the tests missing?
version = "0.6.8"; | ||
py = python2.override { | ||
packageOverrides = self: super: { | ||
matrix-angular-sdk = super.buildPythonPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matrix-angular-sdk = super.buildPythonPackage rec { | |
matrix-angular-sdk = self.buildPythonPackage rec { |
rev = "v${version}"; | ||
sha256 = "0ss7ld3bpmqm8wcs64q1kb7vxlpmwk9lsgq0mh21a9izyfc7jb2l"; | ||
}; | ||
matrix-synapse-ldap3 = super.buildPythonPackage rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matrix-synapse-ldap3 = super.buildPythonPackage rec { | |
matrix-synapse-ldap3 = self.buildPythonPackage rec { |
ec9ea75
to
69bf8e4
Compare
With this commit, we *can* swap python2 for python3 to run synapse using python3 instead. The reason for not making the switch is that a number of CLI tools provided with synapse do not yet work under py3 despite synapse running fine. So this doesn't actually do anything on its own except to prepare for the upcoming py3 switch.
So here's the updated version that fetches from Pypi and no longer does any overriding. Instead we choose the py2 or py3 from all-packages.nix. |
Something super strange is going on - GH isn't showing the latest commit after a force push. |
Success on x86_64-linux (full log) Attempted: matrix-synapse Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: matrix-synapse Partial log (click to expand)
|
Motivation for this change
Performance on a low-specced machine is not great, so move to py3 which upstream recommends.
I have not benchmarked it.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)