Skip to content

Commit

Permalink
CI: make generate-without-spyder.py more robust
Browse files Browse the repository at this point in the history
We are now starting it from a different directory
  • Loading branch information
jitseniesen committed Apr 18, 2024
1 parent 149a148 commit 8723a96
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/scripts/generate-without-spyder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
"""Script to generate requirements/without-spyder.txt"""

import re
from pathlib import Path

with open('requirements/conda.txt') as infile:
with open('requirements/without-spyder.txt', 'w') as outfile:
rootdir = Path(__file__).parents[2]
input_filename = rootdir / 'requirements' / 'conda.txt'
output_filename = rootdir / 'requirements' / 'without-spyder.txt'

with open(input_filename) as infile:
with open(output_filename, 'w') as outfile:
for line in infile:
package_name = re.match('[-a-z0-9_]*', line).group(0)
if package_name != 'spyder':
outfile.write(line)

0 comments on commit 8723a96

Please sign in to comment.