Skip to content

pdf-parser: python version changes unexpectedly #477525

@vinayakankugoyal

Description

@vinayakankugoyal

Nixpkgs version

  • Unstable (26.05)

Describe the bug

I have the following nix.flake

{
  description = "CTF Environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true; 
        };

        pythonEnv = pkgs.python311.withPackages (ps: with ps; [
          pwntools
          requests
          ropper
          ipython
        ]);

      in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            # --- Reverse Engineering ---
            ghidra
            binwalk
            
            # --- Network & Forensics ---
            nmap
            netcat-gnu
            wireshark-cli
            file
            unzip
            poppler-utils
            exiftool
            qpdf
            zsteg
            
            # --- Scripting ---
            pythonEnv
          ];

          shellHook = ''
            echo "🚩 CTF Environment Loaded!"
            echo "Python Version: $(python --version)"
          '';
        };
      }
    );
}

Upon running nix develop the python version printed is python 3.11

now I add pdf-parser to it

{
  description = "CTF Environment";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
          config.allowUnfree = true; 
        };

        pythonEnv = pkgs.python311.withPackages (ps: with ps; [
          pwntools
          requests
          ropper
          ipython
        ]);

      in
      {
        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            # --- Reverse Engineering ---
            ghidra
            binwalk
            
            # --- Network & Forensics ---
            nmap
            netcat-gnu
            wireshark-cli
            file
            unzip
            poppler-utils
            exiftool
            qpdf
            zsteg
+          pdf-parser
            
            # --- Scripting ---
            pythonEnv
          ];

          shellHook = ''
            echo "🚩 CTF Environment Loaded!"
            echo "Python Version: $(python --version)"
          '';
        };
      }
    );
}

upon running nix develop the python version printed is 3.13. I suspect that this package is incorrectly handling python dependencies.

Steps to reproduce

Please see the above report.

Expected behaviour

python version should have been 3.11 (I think)

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

  • system: "aarch64-darwin"
  • host os: Darwin 25.1.0, macOS 26.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.33.0
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/store/k6laq49cmzqx2v71jyhs61j7imaafa62-nixpkgs/nixpkgs

Notify maintainers


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions