flit icon indicating copy to clipboard operation
flit copied to clipboard

flit build - fetching list of valid trove classifiers fails without Internet access

Open jornfranke opened this issue 3 years ago • 3 comments

Hi,

I am using flit 3.6 in an environment without Internet and Python packages are fetched through an internal pypi mirror.

If I run

flit build

then it fails with the following

Fetching list of valid trove classifiers               I-flit.validate
Couldn't get list of valid classifiers to check against  W-flit.validate
Traceback (most recent call last):
  File "c:\test\pythonexample\Scripts\flit-script.py", line 9, in <module>
    sys.exit(main())
  File "c:\test\condaenv\pythonexample\lib\site-packages\flit\__init__.py", line 177, in main
    main(args.ini_file, formats=set(args.format or []),
  File "c:\test\condaenv\pythonexample\lib\site-packages\flit\build.py", line 45, in main
    sb = SdistBuilder.from_ini_path(ini_file)
  File "c:\test\condaenv\pythonexample\lib\site-packages\flit_core\sdist.py", line 91, in from_ini_path
    module = common.Module(ini_info.module, srcdir)
  File "dc:\test\condaenv\pythonexample\lib\site-packages\flit_core\common.py", line 58, in __init__
    raise ValueError("No file/folder found for module {}".format(name))
ValueError: No file/folder found for module flit
  

I suspect this is due to the lack of Internet access. Is it possible to skip the check and/or provide an alternative URL? It seems to be hardcoded, which is not so suitable for Enterprise scenarios: https://github.com/pypa/flit/blob/main/flit/validate.py#L55

Thank you.

Best regards

jornfranke avatar Jan 25 '22 12:01 jornfranke

ok the error is not related. The error is a wrong module name in my pyproject.toml.... However, it still would be nice if the classifiers can be fetched through a different URL and/or a local file I specify. I know I can place it in the user folder, but this is not so nice from sharing the code in a repository point of view

jornfranke avatar Jan 25 '22 13:01 jornfranke

Hiya! You can set FLIT_NO_NETWORK=1 and flit won't try to fetch a list of trove classifiers.

pradyunsg avatar Jan 25 '22 18:01 pradyunsg

We try to keep options to a minimum, so I'd say skipping the check is sufficient - and it will automatically skip it if you don't have an internet connection (I added that on a long train journey with beautiful scenery and no wifi :slightly_smiling_face: ).

takluyver avatar Jan 26 '22 11:01 takluyver

I'm going to close this now. The error described was separate, and an internet connection is not required - you will only see a harmless warning that it can't check your classifiers if you're without internet. Even that doesn't show if it has cached the list previously and all your classifiers are in that list. :slightly_smiling_face:

takluyver avatar Jan 28 '24 11:01 takluyver