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

python312Packages.terminaltables3: init at 4.0.0 #353928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions pkgs/development/python-modules/terminaltables3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
pytestCheckHook,
pythonOlder,
python312Packages,
}:

buildPythonPackage rec {
pname = "terminaltables3";
version = "4.0.0";
pyproject = true;
Kek5chen marked this conversation as resolved.
Show resolved Hide resolved
disabled = pythonOlder "3.8";

build-system = [
poetry-core
];

src = fetchFromGitHub {
owner = "matthewdeanmartin";
repo = "terminaltables3";
rev = "f1c465b36eb9b91a984d8864b21376e7c37075b8"; # Untagged commit 4.0.0
hash = "sha256-UcEovh1Eb4QNPwLGDjCphPlJSSkOdhCJ2fK3tuSWOTc=";
};

Kek5chen marked this conversation as resolved.
Show resolved Hide resolved
pythonImportsCheck = [ "terminaltables3" ];

# Tests are broken upstream
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

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

Uhhhm, there are tests: https://github.com/matthewdeanmartin/terminaltables3/tree/master/tests

It can be that the tests aren't included on PyPi. But they should be when you change src to the GitHub-Repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, i'm gonna do that then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think the fork cares about the tests

============================= test session starts ==============================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /build/source
configfile: pyproject.toml
collected 801 items                                                            

tests/test_all_tables_e2e/test_ascii_table.py ..s                        [  0%]
tests/test_all_tables_e2e/test_double_table.py ..s                       [  0%]
tests/test_all_tables_e2e/test_github_table.py ..                        [  0%]
tests/test_all_tables_e2e/test_porcelain_table.py ..                     [  1%]
tests/test_all_tables_e2e/test_single_table.py ..                        [  1%]
tests/test_all_tables_e2e/test_single_table_windows.py sss               [  1%]
tests/test_ascii_table.py ......................                         [  4%]
tests/test_base_table/test_gen_row_lines.py ...............              [  6%]
tests/test_base_table/test_gen_table.py ....................             [  8%]
tests/test_base_table/test_horizontal_border.py ................         [ 10%]
tests/test_base_table/test_table.py .......F                             [ 11%]
tests/test_build/test_build_border.py .................................. [ 16%]
........................................................................ [ 25%]
........................................................................ [ 34%]
........................................................................ [ 43%]
........................................................................ [ 52%]
........................................................................ [ 61%]
...................................FFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFF.FFF [ 70%]
FFFFFFFFFFFFFFF.FFFFFFFFFFFFFF.....                                      [ 74%]
tests/test_build/test_build_row.py ......                                [ 75%]
tests/test_build/test_combine.py ......                                  [ 76%]
tests/test_build/test_flatten.py ..                                      [ 76%]
tests/test_examples.py ...                                               [ 76%]
tests/test_terminal_io/test_get_console_info.py .                        [ 76%]
tests/test_terminal_io/test_set_terminal_title.py sssssssss              [ 77%]
tests/test_terminal_io/test_terminal_size.py .....                       [ 78%]
tests/test_width_and_alignment/test_align_and_pad_cell.py ........F..... [ 80%]
......F...........F...........F...........F......F......F......F......F. [ 89%]
.....F................................F                                  [ 94%]
tests/test_width_and_alignment/test_column_max_width.py ...              [ 94%]
tests/test_width_and_alignment/test_max_dimensions.py ...........        [ 95%]
tests/test_width_and_alignment/test_table_width.py ...                   [ 96%]
tests/test_width_and_alignment/test_visible_width.py ................... [ 98%]
...........                                                              [100%]

=================================== FAILURES ===================================
__________________________________ test_color __________________________________

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A sample:

        if left and right:
            expected = left + expected + right
        actual = build_border(outer_widths, "-", left, intersect, right, title=title)
>       assert "".join(actual) == expected
E       AssertionError: assert 'TEST--------' == '\x1b[34mTEST\x1b[0m--------'
E         
E         - TEST--------
E         + TEST--------

Copy link
Member

Choose a reason for hiding this comment

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

Very weird. I can replicate the failing tests. But I wonder why nearly every test got touched in the 4.0.0 commit matthewdeanmartin/terminaltables3@f1c465b

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looks like an autoformatting commit


nativeCheckInputs = [
pytestCheckHook
python312Packages.colorama
python312Packages.colorclass
python312Packages.termcolor
];

meta = with lib; {
description = "Display simple tables in terminals";
homepage = "https://github.com/matthewdeanmartin/terminaltables3";
license = licenses.mit;
Kek5chen marked this conversation as resolved.
Show resolved Hide resolved
maintainers = with maintainers; [ kekschen ];
Copy link
Member

Choose a reason for hiding this comment

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

Also add yourself to maintainer-list.nix :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already done. I'm still waiting for #353536

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I extracted it into #354251

};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15608,6 +15608,8 @@ self: super: with self; {

terminaltables = callPackage ../development/python-modules/terminaltables { };

terminaltables3 = callPackage ../development/python-modules/terminaltables3 { };

terminaltexteffects = callPackage ../development/python-modules/terminaltexteffects { };

termplotlib = callPackage ../development/python-modules/termplotlib { };
Expand Down