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

Don't remove files that don't exist #1427

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CJ-Wright
Copy link
Member

@CJ-Wright CJ-Wright commented Nov 13, 2020

I think this is causing an issue with the ci-skeleton feature where it is trying to delete __pycache__ but the folder doesn't exist.

Checklist

  • Added a news entry

@isuruf
Copy link
Member

isuruf commented Nov 13, 2020

Can you show a traceback?

@CJ-Wright
Copy link
Member Author

Traceback (most recent call last):
  File "/home/christopher/mc/bin/conda-smithy", line 33, in <module>
    sys.exit(load_entry_point('conda-smithy', 'console_scripts', 'conda-smithy')())
  File "/home/christopher/dev/conda-smithy/conda_smithy/cli.py", line 613, in main
    args.subcommand_func(args)
  File "/home/christopher/dev/conda-smithy/conda_smithy/cli.py", line 419, in __call__
    self._call(args, tmpdir)
  File "/home/christopher/dev/conda-smithy/conda_smithy/cli.py", line 430, in _call
    temporary_directory=temporary_directory,
  File "/home/christopher/dev/conda-smithy/conda_smithy/configure_feedstock.py", line 1909, in main
    config = _load_forge_config(forge_dir, exclusive_config_file)
  File "/home/christopher/dev/conda-smithy/conda_smithy/configure_feedstock.py", line 1614, in _load_forge_config
    remove_file_or_dir(file_with_path)
  File "/home/christopher/dev/conda-smithy/conda_smithy/feedstock_io.py", line 67, in remove_file_or_dir
    repo.index.remove([filename], r=True)
  File "/home/christopher/mc/lib/python3.7/site-packages/git/index/util.py", line 58, in post_clear_cache_if_not_raised
    rval = func(self, *args, **kwargs)
  File "/home/christopher/mc/lib/python3.7/site-packages/git/index/util.py", line 76, in check_default_index
    return func(self, *args, **kwargs)
  File "/home/christopher/mc/lib/python3.7/site-packages/git/index/base.py", line 862, in remove
    removed_paths = self.repo.git.rm(args, paths, **kwargs).splitlines()
  File "/home/christopher/mc/lib/python3.7/site-packages/git/cmd.py", line 542, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/home/christopher/mc/lib/python3.7/site-packages/git/cmd.py", line 1005, in _call_process
    return self.execute(call, **exec_kwargs)
  File "/home/christopher/mc/lib/python3.7/site-packages/git/cmd.py", line 822, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git rm -r --cached -- __pycache__
  stderr: 'fatal: pathspec '__pycache__' did not match any files'

@CJ-Wright
Copy link
Member Author

The issue is that __pycache__ exists but it isn't git tracked so when we try remove it from git, git balks.

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

Successfully merging this pull request may close these issues.

3 participants