From 8723a96cb6b6dc813949a75ff8e66859a9a4d392 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Thu, 18 Apr 2024 16:13:55 +0100 Subject: [PATCH] CI: make generate-without-spyder.py more robust We are now starting it from a different directory --- .github/scripts/generate-without-spyder.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/scripts/generate-without-spyder.py b/.github/scripts/generate-without-spyder.py index 26a94a6..491ce99 100644 --- a/.github/scripts/generate-without-spyder.py +++ b/.github/scripts/generate-without-spyder.py @@ -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) -