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

pythonPackages.django-raster: Improve django version support #47484

Merged
merged 1 commit into from Oct 1, 2018

Conversation

lsix
Copy link
Member

@lsix lsix commented Sep 28, 2018

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@xeji
Copy link
Contributor

xeji commented Sep 28, 2018

@GrahamcOfBorg build django-raster

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: django-raster

Partial log (click to expand)

Cannot nix-instantiate `django-raster' because:
error: attribute 'django-raster' in selection path 'django-raster' not found

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: django-raster

Partial log (click to expand)

Cannot nix-instantiate `django-raster' because:
error: attribute 'django-raster' in selection path 'django-raster' not found

@xeji
Copy link
Contributor

xeji commented Sep 28, 2018

oops 😄
@GrahamcOfBorg build python36Packages.django-raster

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: django-raster

Partial log (click to expand)

Cannot nix-instantiate `django-raster' because:
error: attribute 'django-raster' in selection path 'django-raster' not found

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:108:35, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/top-level/python-packages.nix:4700:19:
while evaluating 'makeOverridable' at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:67:24, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:112:8:
while evaluating anonymous function at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:69:12:
assertion failed at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/python-modules/django-raster/default.nix:6:3

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/lib/customisation.nix:108:35, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/pkgs/top-level/python-packages.nix:4700:19:
while evaluating 'makeOverridable' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/lib/customisation.nix:67:24, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/lib/customisation.nix:112:8:
while evaluating anonymous function at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/lib/customisation.nix:69:12:
assertion failed at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/builder-0-gustav.ewr1.nix.ci/pkgs/development/python-modules/django-raster/default.nix:6:3

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/customisation.nix:108:35, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/top-level/python-packages.nix:4700:19:
while evaluating 'makeOverridable' at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/customisation.nix:67:24, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/customisation.nix:112:8:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/lib/customisation.nix:69:12:
assertion failed at /var/lib/gc-of-borg/nix-test-rs-14/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-14/pkgs/development/python-modules/django-raster/default.nix:6:3

Copy link
Contributor

@xeji xeji left a comment

Choose a reason for hiding this comment

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

This assertion fails by default because default django is 1.11.
I suggest you override django = django_2_1 in python-packages.nix.

@lsix
Copy link
Member Author

lsix commented Oct 1, 2018

Sorry for the delay…

I do not think this is a good idea to have that in python-packages.nix. If any-one tries to use django-raster with any other django app, then with this kind of approach it will end up with 2 different versions of django in its dependencies, and things will probably go wrong.

The preferred approach, I think, would be to override pythonPackages to make use django_2_1 as `django:

let python3 = pkgs.python3.override {
      packageOverrides = sef: super: {
        django = super.django_2_1;
      };
    };
in python3.pkgs.buildPythonPackage {}

With such approach, only one version of django it used, but yes, the price is that django-raster cannot build without an altered python packages set.

@xeji
Copy link
Contributor

xeji commented Oct 1, 2018 via email

@lsix
Copy link
Member Author

lsix commented Oct 1, 2018

I’ll add a comment shortly.

My other option was to throw an exception with a message somewhere

if stdenv.lib.versionOlder django.version "2.0"
then throw "django-raster only supports Django >= 2.0. Consider overriding the pythonPackage set to use django_2_1"
else
buildPythonPackage {}

@xeji
Copy link
Contributor

xeji commented Oct 1, 2018 via email

@lsix lsix force-pushed the django-raster-improvements branch from b014657 to 5bbaa6e Compare October 1, 2018 16:19
@lsix
Copy link
Member Author

lsix commented Oct 1, 2018

@xeji I have updated to throw an exception with a proper error message if django is too old.

@xeji
Copy link
Contributor

xeji commented Oct 1, 2018

Thanks, so let's see it throw 😄
@GrahamcOfBorg build python36Packages.django-raster

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/lib/customisation.nix:108:35, called from /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/pkgs/top-level/python-packages.nix:4724:19:
while evaluating 'makeOverridable' at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/lib/customisation.nix:67:24, called from /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/lib/customisation.nix:112:8:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /var/lib/gc-of-borg/nix-test-rs-21/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-21/lib/customisation.nix:69:12:
django-raster requires Django >= 2.0. Consider overiding the python package set to use django_2.

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:108:35, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/top-level/python-packages.nix:4724:19:
while evaluating 'makeOverridable' at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:67:24, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:112:8:
while evaluating anonymous function at /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /private/var/lib/ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:69:12:
django-raster requires Django >= 2.0. Consider overiding the python package set to use django_2.

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: python36Packages.django-raster

Partial log (click to expand)

Cannot nix-instantiate `python36Packages.django-raster' because:
error: while evaluating 'callPackageWith' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:108:35, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/top-level/python-packages.nix:4724:19:
while evaluating 'makeOverridable' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:67:24, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:112:8:
while evaluating anonymous function at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/development/python-modules/django-raster/default.nix:1:1, called from /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/lib/customisation.nix:69:12:
django-raster requires Django >= 2.0. Consider overiding the python package set to use django_2.

@xeji xeji merged commit 5aa6699 into NixOS:master Oct 1, 2018
@lsix lsix deleted the django-raster-improvements branch August 22, 2019 07:52
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

3 participants