Python: Packager configuration not working

Problem -
Sometimes when I run my python repl, the packager starts importing/guessing packages even though it is configured not to in .replit file.
The packager should not be guessing and installing packages in my repl, so the configuration is not working.

How to reproduce -
Create a python (or pygame) repl.
In the .replit file, add some packager configuration, then reload shell:

# disables auto-import according to docs
language = "python3"
ignoredPackages = ["pygame", "fold"]

  guessImports = false

As an example, create a folder named fold which contains empty files and

import pygame  # auto imports 'pygame'
import fold.imp1  # auto imports 'math-fold'

Running the repl will cause the packager to auto-import some packages.
Replit’s UPM runs dependency guessing if it thinks something import-related has changed, but I am unable to configure it.

1 Like

I’ve had to disable UPM before due to issues with a Repl, try just overwriting it’s folder with a read-only file.

1 Like

I am not sure how to do that.

From a quick guess, I think this should work:

rm -rf .upm && touch .upm && chmod 000 .upm

Note that this will entirely disable UPM.

Edit: Tested, and I can confirm that this does work.

1 Like

Yeah, this is a workaround, and I think that just deleting the contents of .upm/store.json has the same effect.
But I’d like to be able to just disable upm dependency guessing without breaking stuff.

1 Like

It shouldn’t have the same effect, as that file gets regenerated automatically.

1 Like

It seems to have the same effect. If the file (.upm/store.json) exists but is empty then it doesn’t regenerate the contents.

This worked for me for now. Would prefer they fix this issue though

1 Like

The configuration has been fixed, but with a different setting:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.