Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.

Commit 84865ee

Browse files
committed
for -e default to line in requirements file
1 parent 9768863 commit 84865ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pypi2nix/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ def main(nix_path,
100100
editable_file = os.path.join(tmp_dir, 'editable.txt')
101101
with open(editable_file, 'w+') as f:
102102
for item in editable:
103-
f.write('-e %s\n' % item)
103+
if os.path.isdir(item):
104+
f.write('-e %s\n' % item)
105+
elif os.path.isfile(item):
106+
f.write('-e %s\n' % os.path.dirname(item))
107+
else:
108+
f.write('%s\n' % item)
109+
104110
requirements_files.append(editable_file)
105111

106112
project_dir = os.getcwd()

0 commit comments

Comments
 (0)