question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Distlib not comparing version '3.10' correctly

See original GitHub issue

Consider the following derivation:

{ pkgs ? import <nixpkgs> {} }:                                                         /* import all standard nix packages */

let
  mach-nix = import (
    builtins.fetchGit {
      url = "https://github.com/DavHau/mach-nix/";
      ref = "3.2.0";
    }) {

      pypiDataRev = "e723ab9fa1527957ee6d9f498ddb6fbf52f739a7";
      pypiDataSha256 = "1wxqbj8h3cgdhq69xxl7c2z7lxn8snvb5lqq5qk40bgsxp5168hp";

      python = "python38";                                                                      /* define python version */
    };

  pythonPackages = mach-nix.mkPython {                                          /* import all necessary python packages */
    requirements = ''
      cobra
      biopython
    '';
    providers = {
      "ruamel.yaml" = "nixpkgs";                                                        /* need to build this specific package from source due to cobra */
    };
  };

  RPackages = with pkgs; [                                                                      /* import all necessary R packages */
  ];

  linuxPackages = with pkgs; [                                                          /* import all necessary standard linux packages */
  ];

in

pkgs.mkShell {
  buildInputs = [ pythonPackages ] ++ RPackages ++ linuxPackages;
}

It works fine, except for the fact that I have to specify ruamel.yaml manually. If however I switch to 3.3.0, it breaks with

ERROR: Could not find a version that satisfies the requirement ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.10" (from ruamel-yaml)
ERROR: No matching distribution found for ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.10"

and the provider trick does not work.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
PierreRcommented, Jun 14, 2021

We hit the same issue today as well 😉

0reactions
TyberiusPrimecommented, Nov 23, 2021

Appreciate it, this fixes it beautifully.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release 0.3.7.dev0 Vinay Sajip
Fixed #149: Handle version comparisons correctly in environment markers. • scripts. – Add ARM-64 launchers and support code to use them.
Read more >
Announcement: distlib 0.3.4 released on PyPI - Packaging
Fixed #154: Determine Python versions correctly for Python >= 3.10. Updated launcher executables with changes to handle duplication logic.
Read more >
building wheel for backports.zoneinfo (pyproject.toml) did not run ...
ERROR: Could not build wheels for backports.zoneinfo, which is required to ... uses python version 3.10.x and backports.zoneinfo is not working properly ......
Read more >
Packages for 64-bit Linux on x86_64 CPUs with Python 3.10
Name Version Summary / License _libgcc_mutex 0.1 Mutex for libgcc and libgcc‑ng / None _openmp_mutex 5.1 OpenMP Implementation Mutex / BSD‑3‑Clause aiofiles 0.7.0 File support for...
Read more >
How do I compare version numbers in Python?
1 . Since I'm comparing strings, 2 sorts above 10, but that's not correct for versions. >>> "2.3 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found