Skip to content

Commit

Permalink
sage --package create: When re-creating as a normal or wheel package,…
Browse files Browse the repository at this point in the history
… remove requirements.txt
  • Loading branch information
Matthias Koeppe committed Nov 13, 2023
1 parent 226c15f commit 7ed1193
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build/sage_bootstrap/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,19 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal'):
f.write('cd src\nsdh_pip_install .\n')
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
f.write('{0}\n'.format(pypi_package_name))
try:
# Remove this file, which would mark the package as a pip package.
os.remove(os.path.join(self.path, 'requirements.txt'))
except OSError:
pass
elif source == 'wheel':
with open(os.path.join(self.path, 'install-requires.txt'), 'w+') as f:
f.write('{0}\n'.format(pypi_package_name))
try:
# Remove this file, which would mark the package as a pip package.
os.remove(os.path.join(self.path, 'requirements.txt'))
except OSError:
pass
elif source == 'pip':
with open(os.path.join(self.path, 'requirements.txt'), 'w+') as f:
f.write('{0}\n'.format(pypi_package_name))
Expand Down

0 comments on commit 7ed1193

Please sign in to comment.