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

How to change flake to python310? #556

Open
waynee95 opened this issue May 15, 2023 · 3 comments
Open

How to change flake to python310? #556

waynee95 opened this issue May 15, 2023 · 3 comments

Comments

@waynee95
Copy link

Currently I have the following flake:

{
  inputs = {
    mach-nix.url = "mach-nix/3.5.0";
  };

  outputs = {self, nixpkgs, mach-nix}:
    let
      l = nixpkgs.lib // builtins;
      supportedSystems = [ "x86_64-linux" "aarch64-darwin" ];
      forAllSystems = f: l.genAttrs supportedSystems
        (system: f system (import nixpkgs {inherit system;}));
    in
    {
      # enter this python environment by executing `nix shell .`
      defaultPackage = forAllSystems (system: pkgs: mach-nix.lib."${system}".mkPython {
        # python = "python310";
        requirements = ''
          jupyter_contrib_nbextensions
          RISE
        '';
      });
    };
}

I would like to use version python310.

I tried following #504 but that didn't work.

@TyberiusPrime
Copy link
Collaborator

TyberiusPrime commented Jul 6, 2023

{
  inputs = {
    mach-nix.url = "mach-nix/3.5.0";
  };

  outputs = {
    self,
    nixpkgs,
    mach-nix,
  }: let
    l = nixpkgs.lib // builtins;
    supportedSystems = ["x86_64-linux" "aarch64-darwin"];
    forAllSystems = f:
      l.genAttrs supportedSystems
      (system: f system (import nixpkgs {inherit system;}));
  in {
    # enter this python environment by executing `nix shell .`
    defaultPackage = forAllSystems (system: pkgs: let
      mach-nix_ = import mach-nix {
        inherit pkgs;
        python = "python310";
      };
    in
      mach-nix_.mkPython {
        # python = "python310";
        requirements = ''
          jupyter_contrib_nbextensions
          RISE
        '';
      });
  };
}

@hakan-demirli
Copy link

I get > packaging.version.InvalidVersion: Invalid version: 'unstable-2023-05-04 when I use that flake.

@TyberiusPrime
Copy link
Collaborator

Give the current master a try, I did some work around such issues a few months back.

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

No branches or pull requests

3 participants