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

Build failure: python311.pkgs.grip #288478

Closed
brianmcgillion opened this issue Feb 13, 2024 · 5 comments · Fixed by #288869
Closed

Build failure: python311.pkgs.grip #288478

brianmcgillion opened this issue Feb 13, 2024 · 5 comments · Fixed by #288869

Comments

@brianmcgillion
Copy link
Contributor

brianmcgillion commented Feb 13, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. include python3.pkgs.grip in configuration
  2. Checkout unstable to:
"nixpkgs": {
       "locked": {
       "lastModified": 1707689078,
        "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
        "type": "github"
  }

Build log

Running phase: installCheckPhase
============================= test session starts ==============================
platform linux -- Python 3.11.7, pytest-7.4.4, pluggy-1.4.0
rootdir: /build/source
configfile: pytest.ini
collecting ... ^Mcollected 22 items / 6 deselected / 16 selected                                

tests/test_api.py ..........F

=================================== FAILURES ===================================
___________________________________ test_app ___________________________________

monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ffff51b77d0>
tmpdir = local('/build/pytest-of-nixbld/pytest-0/test_app0')

    def test_app(monkeypatch, tmpdir):
        monkeypatch.setenv('GRIPHOME', str(tmpdir))
        zero_path = input_filename('zero.md')
        zero_output = output_file('app', 'zero.html')
        gfm_test_path = input_filename('gfm-test.md')
        gfm_test_output = output_file('app', 'gfm-test.html')
        assets = GitHubAssetManagerMock()
    
        with GitHubRequestsMock() as responses:
>           assert Grip(zero_path, assets=assets).render() == zero_output

tests/test_api.py:260: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Grip 'grip.app'>, route = '/'

    def render(self, route=None):
        """
        Renders the application and returns the HTML unicode that would
        normally appear when visiting in the browser.
        """
        if route is None:
            route = '/'
        with self.test_client() as c:
            response = c.get(route, follow_redirects=True)
>           encoding = response.charset
E           AttributeError: 'WrapperTestResponse' object has no attribute 'charset'

grip/app.py:400: AttributeError
=========================== short test summary info ============================
FAILED tests/test_api.py::test_app - AttributeError: 'WrapperTestResponse' object has no attribute 'charset'
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
================== 1 failed, 10 passed, 6 deselected in 0.27s ==================

Additional context

Add any other context about the problem here.

Notify maintainers

@mweinelt

Metadata

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.7.4, NixOS, 24.05 (Uakari), 24.05.20240207.f8e2ebd`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - nixpkgs: `/nix/store/snp5f95xhkz89kdw9703kana3m6xfd0a-source`
@jackwilsdon
Copy link
Contributor

jackwilsdon commented Feb 13, 2024

It looks like this has already been fixed upstream in joeyespo/grip@2784eb2. There isn't a tagged release containing this fix though (it seems like there was a 4.6.2 but it's gone now: joeyespo/grip#380), so maybe it just needs pulling in as a patch?

@mweinelt
Copy link
Member

cc @k0ral

@Infinidoge
Copy link
Contributor

Went ahead and pulled it in as a patch: Infinidoge@3ab1da4,
And opened a PR: #288869

@panchoh
Copy link
Contributor

panchoh commented Feb 15, 2024

meta: mentioning python311Packages.grip to enable searches by that term.
(I didn't know the FQDN of the package, so I couldn't find this issue).

@brianmcgillion
Copy link
Contributor Author

Thanks for the quick fix! Verified on unstable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants