Skip to content
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

python.pkgs.django cleanup #26397

Merged
merged 5 commits into from
Jul 2, 2017
Merged

python.pkgs.django cleanup #26397

merged 5 commits into from
Jul 2, 2017

Conversation

FRidh
Copy link
Member

@FRidh FRidh commented Jun 5, 2017

Motivation for this change

Cleaning up old versions. Part of #25375.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member Author

FRidh commented Jun 5, 2017

cc @lsix

@lsix lsix self-assigned this Jun 6, 2017
@lsix
Copy link
Member

lsix commented Jun 6, 2017

Hi @FRidh
deps
I did not go all the way through yet due to all the broken derivations. I think your approach of only using the same django everywhere to build everything is way cleaner, even if some derivations end up broken (because they expect a earlier version). Anyone who needs it should override the python packages set anyway.

I am currently running nox-reivew to see if some derivations should be marked as broken then it will be good for me.

@FRidh
Copy link
Member Author

FRidh commented Jun 7, 2017

@lsix ideally those derivations that rely on Django should specify which Django version they need, either as a comment or in code. We could introduce a djangoOlder like we have with pythonOlder so that dependents could write e.g. disabled = djangoOlder "1.10";.

@lsix
Copy link
Member

lsix commented Jun 7, 2017

Introducing works:

diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d2fa2c38ca3..4aa1988e3a9 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -29,6 +29,9 @@ let
   isPyPy = python.executable == "pypy";
   isPy3k = strings.substring 0 1 python.pythonVersion == "3";
 
+  djangoOlder = versionOlder self.django.version;
+  djangoAtLeast = versionAtLeast self.django.version;
+
   callPackage = pkgs.newScope self;
 
   bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
@@ -68,7 +71,7 @@ let
 
 in {
 
-  inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
+  inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication djangoOlder djangoAtLeast;
   inherit fetchPypi callPackage;
   inherit sharedLibraryExtension;

but I am not sure this should make up to the entire pythonPackage set (most of the set do not care much about django).

Having

{buildPythonPackage,, django, versionAtLeast}:
buildPythonPackage rec {# disable for django-1.10 and later
  disabled = versionAtLeast django.version "1.10";}

could be just fine and readable (the error message presented to the interpreter should show it, the disabled uses assumes the cause is the version of the interpreter). I’ll try to go through it this noon or evening.

@lsix
Copy link
Member

lsix commented Jun 7, 2017

@FRidh lsix@f662478 properly marks the broken derivations. If you are ok with it, you could cherry-pick it.

With it, I can run nox-review wip --against 14413421824a4176bc8a2b29063104796eb0a638 properly.

@FRidh
Copy link
Member Author

FRidh commented Jun 8, 2017

Instead of a disabledReason you could just throw in the expressions.

@lsix
Copy link
Member

lsix commented Jun 9, 2017

Here is an updated version: lsix@1f520bc

@FRidh FRidh merged commit d15e20f into NixOS:master Jul 2, 2017
@FRidh FRidh deleted the django branch July 2, 2017 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants