Skip to content

Commit 6682438

Browse files
author
Matthias Koeppe
committed
sage --package create: When re-creating as a normal or wheel package, remove requirements.txt
1 parent 30b3d78 commit 6682438

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

build/sage_bootstrap/creator.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,19 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal'):
101101
f.write('cd src\nsdh_pip_install .\n')
102102
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
103103
f.write('{0}\n'.format(pypi_package_name))
104+
try:
105+
# Remove this file, which would mark the package as a pip package.
106+
os.remove(os.path.join(self.path, 'requirements.txt'))
107+
except OSError:
108+
pass
104109
elif source == 'wheel':
105110
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
106111
f.write('{0}\n'.format(pypi_package_name))
112+
try:
113+
# Remove this file, which would mark the package as a pip package.
114+
os.remove(os.path.join(self.path, 'requirements.txt'))
115+
except OSError:
116+
pass
107117
elif source == 'pip':
108118
with open(os.path.join(self.path, 'requirements.txt'), 'w+') as f:
109119
f.write('{0}\n'.format(pypi_package_name))

0 commit comments

Comments
 (0)