dense-analysis / dense-analysis/ale

Empty Pipfile files are created with Pipenv

Open
#2,737 7 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul 21 2019 22:54:00)

Operating System: Mac

## What went wrong

Empty Pipfile files are created alongside Python modules that are three subfolders deep from the projet's Pipfile.

See https://github.com/pypa/pipenv/issues/3908

## Reproducing the bug

1. Put in your config: `let g:ale_python_auto_pipenv = 1`
2. Create three layers, e.g. `a/b/c/foo.py`
3. Edit and save `foo.py`
4. Observe that an empty `a/b/c/Pipfile` is created

### :ALEInfo

Relevant section:

```
(finished - exit code 0) ['/usr/local/bin/zsh', '-c', 'cd ''[redacted]/api/api/task'' && ''pipenv'' run flake8 --format=default --stdin-display-name ''[redacted]/api/api/task/
connection.py'' - < ''/var/folders/ss/2cch6pjs7fqf55xztqstklh40000gn/T/vBtf28V/25/connection.py''']
```

### Context

Pipenv will look for a `Pipfile` up to `PIPENV_MAX_DEPTH` (defaults to 3) up. If it does not find one, it will create an empty `Pipfile`.

A simple fix would be to use `PIPENV_PIPFILE` to provide an explicit path to the `Pipfile`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.