File tree Expand file tree Collapse file tree 2 files changed +35
-2
lines changed
Expand file tree Collapse file tree 2 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,10 @@ jobs:
102102 with :
103103 path : ' src/.github/'
104104
105- - name : Overwrite README for PyPI
106- run : cp src/.github/README.md src/
105+ - name : Overwrite README & Distribution Package for PyPI
106+ run : |
107+ cp src/.github/README.md src/
108+ python src/.github/rename_package.py src/setup.py
107109
108110 - uses : actions/setup-python@v5
109111 name : Install Python
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ #
3+ # Copyright 2021-2025 The ImpactX Community
4+ #
5+ # Authors: Axel Huebl
6+ # License: BSD-3-Clause-LBNL
7+ #
8+ import re
9+ import sys
10+
11+
12+ find = r'name="impactx",'
13+ replace = r'name="impactx-noacc",'
14+
15+
16+ if len (sys .argv ) == 2 :
17+ file_path = sys .argv [1 ]
18+ else :
19+ print ("Must pass path to setup.py as first argument!" )
20+ sys .exit (1 )
21+
22+ new_content = ""
23+ with open (file_path , "r" ) as file :
24+ for line in file .readlines ():
25+ if re .search (find , line ):
26+ new_content += re .sub (find , replace , line )
27+ else :
28+ new_content += line # Keep original line
29+
30+ with open (file_path , "w" ) as file :
31+ file .write (new_content )
You can’t perform that action at this time.
0 commit comments