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.dash: init at 1.8.0 #77837

Merged
merged 7 commits into from Jan 21, 2020
Merged

python3Packages.dash: init at 1.8.0 #77837

merged 7 commits into from Jan 21, 2020

Conversation

antoinerg
Copy link
Contributor

@antoinerg antoinerg commented Jan 16, 2020

Motivation for this change

Dash is an open-source framework that creates analytical web apps from Python without writing a single line of javascript (https://dash.plot.ly/). It would be awesome to package it in NixOS!

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Manual test

I tested that I could start a simple Dash app:

$ nix-shell -I nixpkgs=$(pwd) -p python3Packages.dash
$ python app.py

@smaret
Copy link
Member

smaret commented Jan 16, 2020

nix-review pr passes on macOS.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

there should roughly be a commit per package addition

pname = "dash-core-components";
version = "1.7.0";

src = fetchurl {
Copy link
Contributor

Choose a reason for hiding this comment

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

There's already a helper for this, see https://github.com/NixOS/nixpkgs/blob/211ed174657712a00fd3bcabd590d2e7b7a25e10/pkgs/development/python-modules/requests/default.nix for an example

Suggested change
src = fetchurl {
src = fetchPypi {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonringer I initially gave up on fetchPypi because it wasn't working for me. I just realized it's because the package name should have underscores instead of dashes. It's now fixed for all packages in 4f0952022dcd5314aa6b56a98901155110c3294a.

Copy link
Contributor Author

@antoinerg antoinerg left a comment

Choose a reason for hiding this comment

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

there should roughly be a commit per package addition

@jonringer I'm sorry, I wasn't aware of that. Can I rebase and force push with a proper commit log? Ok so I force pushed a cleaned up commit log to fit that requirement.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

Please add tests (checkout from the github repos is preferable to no tets)
Please add yourself as a maintainer
Please apply comments to all packages

closes #69110

doCheck = false;

meta = {
description = "Dash is a Python framework for building analytical web applications. No JavaScript required.";
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need to define the subject, we know it's the description of a given package. "No JavaScript required." is just click-baity

Suggested change
description = "Dash is a Python framework for building analytical web applications. No JavaScript required.";
description = "Python framework for building analytical web applications";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 411a351

meta = {
description = "Dash is a Python framework for building analytical web applications. No JavaScript required.";
homepage = https://dash.plot.ly/;
license = with lib.licenses; [ mit ];
Copy link
Contributor

Choose a reason for hiding this comment

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

needs other suggestion to work

Suggested change
license = with lib.licenses; [ mit ];
license = licenses.mit;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 411a351

# No tests in archive
doCheck = false;

meta = {
Copy link
Contributor

Choose a reason for hiding this comment

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

also useful for referencing maintainers

Suggested change
meta = {
meta = with lib; {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Done in 411a351

@antoinerg
Copy link
Contributor Author

Please add tests (checkout from the github repos is preferable to no tets)

I am sorry to be such a newbie but can you expand on this @jonringer? Would the following be enough?

  # in lieu of proper tests
  pythonImportsCheck = [
    "dash"
  ];

Thank you for your patience

@jonringer
Copy link
Contributor

jonringer commented Jan 17, 2020

pythonImportsCheck will essentially do python -c 'import $MODULE_PATH' for each item. This will catch stuff such as namespace issues or some missing dependency issues. It's to give a little more validity that the package would be able to work in a normal workflow.

EDIT: However, unit tests are a much better measure to ensure the packages are internally correct and usable.

@antoinerg
Copy link
Contributor Author

pythonImportsCheck will essentially do python -c 'import $MODULE_PATH for each item. This will catch stuff such as namespace issues or some missing dependency issues. It's to give a little more validity that the package would be able to work in a normal workflow.

So I take it it would be good enough?

@jonringer
Copy link
Contributor

I am sorry to be such a newbie

I was a newbie at nix not too long ago as well. No reason to apologize :)

@jonringer
Copy link
Contributor

The big push for tests is to ensure that a bunch of packages aren't subtly broken. Since the sources are available through github, it's preferred to use from source rather just have our fingers crossed.

This becomes more important when we have to alter upstream version bounds, having tests ensures that we have valid packages, even if upstream isn't testing against those dependency ranges.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

for the add antoinerg as maintainer of python3Packages.dash-* commit, do you mind just doing:

  antoinerg = {
    email = "roygobeil.antoine@gmail.com";
    github = "antoinerg";
    githubId = 301546;
    name = "Antoine Roy-Gobeil";
  };

as maintainers: add antoinerg

then adding yourself to the other packages can remain as another commit.

Generally maintainer additions are separate from package changes.

Not sure how strong your git-fu is, let me know if you need help with altering git history. (but i would look at how to use git rebase -i if you're not already familiar)

@antoinerg
Copy link
Contributor Author

EDIT: However, unit tests are a much better measure to ensure the packages are internally correct and usable.

With 9cd2e23, it now runs a few unit tests. I skipped the ones that require browsers. All those tests are run upstream prior to a release. I hope this is good enough @jonringer !

@jonringer
Copy link
Contributor

jonringer commented Jan 21, 2020

please squash the dash fixup commit into the other.

git rebase -i HEAD~4
# move `python3Packages.dash: pull from github instead of pypi, run unit tests` line below dash init commit
# make `pick -> squash` for python3Packages.dash: pull from github instead of pypi, run unit tests
# save

git push --force

otherwise LGTM

@antoinerg
Copy link
Contributor Author

please squash the dash fixup commit into the other.

git rebase -i HEAD~4
# move `python3Packages.dash: pull from github instead of pypi, run unit tests` line below dash init commit
# make `pick -> squash` for python3Packages.dash: pull from github instead of pypi, run unit tests
# save

git push --force

otherwise LGTM

Now done @jonringer !

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

diff LGTM

[21 built, 36 copied (194.3 MiB), 12.9 MiB DL]
https://github.com/NixOS/nixpkgs/pull/77837
15 package built:
python27Packages.dash python27Packages.dash-core-components python27Packages.dash-html-components python27Packages.dash-renderer python27Packages.dash-table python37Packages.dash python37Packages.dash-core-components python37Packages.dash-html-components python37Packages.dash-renderer python37Packages.dash-table python38Packages.dash python38Packages.dash-core-components python38Packages.dash-html-components python38Packages.dash-renderer python38Packages.dash-table

@jonringer
Copy link
Contributor

@GrahamcOfBorg build python27Packages.dash python27Packages.dash-core-components python27Packages.dash-html-components python27Packages.dash-renderer python27Packages.dash-table python37Packages.dash python37Packages.dash-core-components python37Packages.dash-html-components python37Packages.dash-renderer python37Packages.dash-table python38Packages.dash python38Packages.dash-core-components python38Packages.dash-html-components python38Packages.dash-renderer python38Packages.dash-table

@jonringer jonringer merged commit a8c36db into NixOS:master Jan 21, 2020
@antoinerg antoinerg deleted the python3-dash branch January 21, 2020 20:36
@t184256 t184256 mentioned this pull request Jan 30, 2020
10 tasks
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