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

python3Packages.django-filter: init at 2.1.0 #63504

Closed
wants to merge 2 commits into from

Conversation

aakropotkin
Copy link
Contributor

Motivation for this change

Required package for a project.

Things done

Added and tested "Django Filter" Python Package.

  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

sha256 = "3dafb7d2810790498895c22a1f31b2375795910680ac9c1432821cbedb1e176d";
};

doCheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

It's best to leave a reason for disabling tests. In this case the tests seem to require crispy_forms which isn't in nixpkgs (yet).

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh hold on #63502

Didn't see that. It might be better to combine this series of PRs into one...

Copy link
Contributor

@risicle risicle Jun 19, 2019

Choose a reason for hiding this comment

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

Ok provided you have django-crispy-forms available, it's quite simple to enable the tests:

  checkInputs = [
    djangorestframework
    mock
    django-crispy-forms
  ];
  checkPhase = ''
    ${python.interpreter} runtests.py
  '';

However a single test fails. This corresponds to an upstream issue carltongibson/django-filter#1050 which has luckily been fixed, and we can pull in that fix's changeset as a patch:

  patches = [
    (fetchpatch {
      name = "fix-dst-test.patch";
      url = https://github.com/carltongibson/django-filter/pull/1058/commits/9c0b06610dbd5b69a006ae121d383ef49cc70fff.patch;
      sha256 = "0rrbqxjcwwkcldxi1q38cf2wcl9rgk7yyyc6rxwswi45r9sxihgb";
    })
  ];

With the above two modifications, the tests pass for me non-nixos linux x86_64 & macos 10.13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!
Yeah I have a slew of PRs from a big collection of modules I added at work.
I want to get them all contributed but I'm pretty unfamiliar with the "norms" of contributing (despite reading the guide several times).

Maybe you can clear this up: is it best for me to submit one big PR with all of my new modules? (About 6 or 7 Python modules). Alternatively should I make PRs 1 at a time while I wait for each dependency in the chain to be merged?
What is the deal with the maintainers list? I have tried to add myself on other PRs for like a year now and every time they tell me to remove it. Am I supposed to add myself as a maintainer on a separate PR? When I tried that before it was also rejected for some reason... Is the idea that I just push code anonymously until I have a fat collection of packages that I finally "claim" from my past PRs?

I appreciate any advice you can spare.

Copy link
Contributor

Choose a reason for hiding this comment

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

Certainly if they're interrelated, I'd combine your PRs together.

The maintainers list? I don't know - I never had any issue adding myself, in fact I was nagged for creating packages and leaving them maintainerless. I think there's probably a stronger case to add yourself to the maintainers list if you're adding a slew of packages together which you're maintaining.

When it comes to getting tests working, I have two main tricks/pieces of advice:

  1. Many pypi packages don't include the test suite, in this case you can pull the source directly from the repo with e.g. fetchFromGitHub.
  2. A great source for "how am I supposed to get the tests running from scratch for this project?" is looking at the project's CI configuration. .travis.ymls, tox.inis, appveyor.ymls etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

(the tests for django-crispy-forms are looking pretty tricky and might be beyond hope)

Copy link
Contributor

Choose a reason for hiding this comment

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

I have tried to add myself on other PRs for like a year now and every time they tell me to remove it

Just a thought - do you think it might be something to do with your github username?

@risicle
Copy link
Contributor

risicle commented Jun 19, 2019

Builds & appears to work, macos 10.13 & non-nixos linux x86_64

, buildPythonPackage
}:
buildPythonPackage rec {

Copy link
Contributor

@jonringer jonringer Jun 19, 2019

Choose a reason for hiding this comment

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

Since this package requires Python>=3.4, please add this.

Suggested change
broken = isPy2;

@aakropotkin
Copy link
Contributor Author

Merging multiple PRs.

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

4 participants