The top-level "modules" field in .replit file

I was greeted by the following .replit file when I created a Python Repl:

entrypoint = "main.py"
modules = ["python-3.10:v18-20230807-322e88b"]

hidden = [".pythonlibs"]

[nix]
channel = "stable-23_05"

[deployment]
run = ["python3", "main.py"]
deploymentTarget = "cloudrun"

Most of the tables and fields are documented here, as the Repl would suggest if I were to empty the file. However, the modules field is not even mentioned in the documentation page.

It is quite obvious that this field is responsible for the Python version the Repl uses. Even if I specify that I want to use Python 3.11 in the replit.nix file it won’t budge a millimeter:

{ pkgs }: {
  deps = [
    pkgs.python311
  ];
}

What are possible values for this field, and why is it not documented?

1 Like

This field is relatively new and helps reduce the amount of stuff in a repl: there is no venv folder with a bunch of packages and package manager stuff. Of course, a lot of the replit docs are outdated so the documentation doesn’t include it. (some packager configuration still needs to be fixed I think)
I don’t really know what the value for the field is (it’s not documented!).

2 Likes

Societas,

If you are looking to upgrade the template to 3.11, you can use this link for instructions on how to upgrade the Nix package.

For example, you can update your replit.nix file to this and upon the next run, you’ll have 3.11 installed in the Repl.

{ pkgs }: { deps = [pkgs.python311Packages.safe-pysha3];}

Would that still work with the new modules in the .replit file?

If you are looking to upgrade the template to 3.11, you can use this link for instructions on how to upgrade the Nix package.

What link do you mean?

For example, you can update your replit.nix file to this and upon the next run, you’ll have 3.11 installed in the Repl.

That doesn’t change anything. As stated, I already tried pkgs.python311 (which is taken from search.nixos.org, mind you).

Seems that even (some of) the staff don’t know about the latest changes?