flit icon indicating copy to clipboard operation
flit copied to clipboard

flit.common.VCSError -- how to fix?

Open josh-ashkinaze opened this issue 6 years ago • 3 comments

I already cd'd to my folder of the package I want to upload, and I did flit publish. I then get this`` flit.common.VCSError: Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS. (.)``` error. How do I fix this?

ASHKIJMAC:package ashkij$ flit publish
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 "/Library/Frameworks/Python.framework/Versions/3.5/bin/flit", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/__init__.py", line 115, in main
    main(args.ini_file, args.repository, formats=set(args.format or []))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/upload.py", line 267, in main
    built = build.main(ini_path, formats=formats)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/build.py", line 41, in main
    sdist_file = sb.build()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/sdist.py", line 239, in build
    files_to_add = self.find_tracked_files()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/sdist.py", line 179, in find_tracked_files
    self.srcdir)
flit.common.VCSError: Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS. (.)
ASHKIJMAC:package ashkij$ flit publish
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 "/Library/Frameworks/Python.framework/Versions/3.5/bin/flit", line 10, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/__init__.py", line 115, in main
    main(args.ini_file, args.repository, formats=set(args.format or []))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/upload.py", line 267, in main
    built = build.main(ini_path, formats=formats)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/build.py", line 41, in main
    sdist_file = sb.build()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/sdist.py", line 239, in build
    files_to_add = self.find_tracked_files()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/flit/sdist.py", line 179, in find_tracked_files
    self.srcdir)
flit.common.VCSError: Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS. (.)

josh-ashkinaze avatar Jul 23 '19 00:07 josh-ashkinaze

Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS. (.)``` error. How do I fix this?

Either commit, undo, or add the files to .gitignore. Honestly this message seems very clear. It's talking about your version control for the project being in a sloppy state, probably not a wise state to publish from.

AndydeCleyre avatar Nov 09 '19 20:11 AndydeCleyre

Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS. (.)``` error. How do I fix this?

Either commit, undo, or add the files to .gitignore. Honestly this message seems very clear. It's talking about your version control for the project being in a sloppy state, probably not a wise state to publish from.

There are several valid use cases where the other files should not be the concern of flit build, and it should not interfere with a developers workflow.

  1. if you have a repo with several packages in various states. its not a problem to have unchecked in files if they are not in the scope of the project flit is building. ie src/distro/proj1/pyproject.toml should not interfere with src/distro/proj2/pyproject.toml
  2. you should not be commiting files until you know the thing builds. so what is the point of flit build complaining about unchecked in files?

Im getting this error during flit build so that is not a valid workflow to be commiting files at that point.

pete312 avatar Dec 04 '24 05:12 pete312

This old issue could be closed. Two ways to solve:

  • call flit build --no-use-vcs
  • define flit_core as build backend and use pypa-build or pip as build frontend

merwok avatar Dec 04 '24 20:12 merwok