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

imgkit: init at 1.2.3 #300145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

imgkit: init at 1.2.3 #300145

wants to merge 1 commit into from

Conversation

twitchy0
Copy link

Description of changes

Tested with the following:
export NIXPKGS_ALLOW_INSECURE=1 && NIX_PATH=nixpkgs=$PWD nix-shell -p "python3.withPackages (ps: with ps; [ imgkit pandas seaborn jinja2 ])" -p wkhtmltopdf --run "python"
Example from https://stackoverflow.com/questions/45664519/export-pandas-styled-table-to-image-file

import pandas as pd
import seaborn as sns
import jinja2
import imgkit

data = {('count', 's25'):
       {('2017-08-11', 'Friday'): 88.0,
        ('2017-08-12', 'Saturday'): 90.0,
        ('2017-08-13', 'Sunday'): 93.0},
        ('count', 's67'):
       {('2017-08-11', 'Friday'): 404.0,
        ('2017-08-12', 'Saturday'): 413.0,
        ('2017-08-13', 'Sunday'): 422.0},
        ('count', 's74'):
       {('2017-08-11', 'Friday'): 203.0,
        ('2017-08-12', 'Saturday'): 227.0,
        ('2017-08-13', 'Sunday'): 265.0},
        ('count', 's79'):
       {('2017-08-11', 'Friday'): 53.0,
        ('2017-08-12', 'Saturday'): 53.0,
        ('2017-08-13', 'Sunday'): 53.0}}

table = pd.DataFrame.from_dict(data)
table.sort_index(ascending=False, inplace=True)

cm = sns.light_palette("seagreen", as_cmap=True)
styled_table = table.style.background_gradient(cmap=cm)
html = styled_table.to_html()

imgkit.from_string(html, 'out.png')

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

python3Packages.buildPythonPackage rec {
pname = "imgkit";
version = "1.2.3";

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pyproject = true;

hash = "sha256-ya3pPQKBJ3yJi5g8lZ8R8MwctKX+0URWDfpNJz+1DNg=";
};

propagatedBuildInputs = [ six ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
propagatedBuildInputs = [ six ];
dependencies = [ six ];

};

propagatedBuildInputs = [ six ];
nativeBuildInputs = [ python3Packages.setuptools-scm ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nativeBuildInputs = [ python3Packages.setuptools-scm ];
build-system = [ python3Packages.setuptools-scm ];

Comment on lines +19 to +24
meta = with lib; {
homepage = "https://github.com/jarrekk/imgkit";
description = "Wkhtmltopdf python wrapper to convert html to image using the webkit rendering engine and qt";
license = licenses.mit;
maintainers = with maintainers; [ twitchy0 ];
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
meta = with lib; {
homepage = "https://github.com/jarrekk/imgkit";
description = "Wkhtmltopdf python wrapper to convert html to image using the webkit rendering engine and qt";
license = licenses.mit;
maintainers = with maintainers; [ twitchy0 ];
};
meta = {
homepage = "https://github.com/jarrekk/imgkit";
description = "Wkhtmltopdf Python wrapper to convert HTML to image using WebKit";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ twitchy0 ];
};

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.

2 participants