Skip to content

Commit b68cba2

Browse files
committed
CAP-ADD: flagerzer invoke done
1 parent 9323c68 commit b68cba2

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16.)
2-
project(diffCheck VERSION 0.0.23 LANGUAGES CXX C)
2+
project(diffCheck VERSION 0.0.24 LANGUAGES CXX C)
33
set(CMAKE_CXX_STANDARD 17)
44

55
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

invokes/flagerize.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@
77

88
import typing
99

10+
1011
def main(
1112
package: str,
1213
from_manifest: bool,
1314
path_manifest: str,
14-
*args, **kwargs
15+
source: str,
16+
version: str
1517
) -> bool:
1618
# for all the files that are called code.py in the components folder
1719
# stamp on the second line of the file by not overwriting the first line
18-
for root, dirs, files in os.walk("./py/components/"):
20+
for root, dirs, files in os.walk(source):
1921
for file in files:
2022
if file == "code.py":
2123
path = os.path.join(root, file)
2224
with open(path, "r") as f:
2325
lines = f.readlines()
24-
# check if the line # r: package_name is already in the first 10 lines
26+
# check if the line # r: package_name is already in the first 10 lines, erase it
2527
if any([re.search(r"# r: .+==", line) for line in lines[:10]]):
2628
print(f"File {path} is already stamped with the package version.")
27-
return False
29+
lines = [line for line in lines if not re.search(r"# r: .+==", line)]
30+
2831
with open(path, "w") as f:
2932
f.write(lines[0])
30-
f.write(f"# r: {package}=={kwargs['version']}\n")
33+
f.write(f"# r: {package}=={version}\n")
3134
for line in lines[1:]:
3235
f.write(line)
3336
print("Done stamping components with version number of the pypi package.")
@@ -46,7 +49,7 @@ def main(
4649
parser.add_argument(
4750
"--source",
4851
type=str,
49-
required=False,
52+
required=True,
5053
default="./py/components/",
5154
help="The path to component folders."
5255
)
@@ -59,7 +62,7 @@ def main(
5962
parser.add_argument(
6063
"--path-manifest",
6164
type=str,
62-
required=False,
65+
required=True,
6366
default="./manifest.yml",
6467
help="The path to the manifest file."
6568
)
@@ -137,6 +140,7 @@ def main(
137140
package=args.package,
138141
from_manifest=args.from_manifest,
139142
path_manifest=args.path_manifest,
143+
source=args.source,
140144
version=_version
141145
)
142146

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: diffCheck
3-
version: 0.0.23
3+
version: 0.0.24
44
authors:
55
- Andrea Settimi
66
- Damien Gilliard

src/gh/components/DF_xml_exporter/code.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#! python3
2-
# r: diffCheck==0.0.9
32

43
import System
54
import typing

src/gh/diffCheck/diffCheck/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import sys
33

4-
__version__ = "0.0.23"
4+
__version__ = "0.0.24"
55

66
PATH_TO_DLL = "dlls"
77
extra_dll_dir = os.path.join(os.path.dirname(__file__), PATH_TO_DLL)

src/gh/diffCheck/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name="diffCheck",
11-
version="0.0.23",
11+
version="0.0.24",
1212
packages=find_packages(),
1313
install_requires=[
1414
"numpy",

tasks.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ def pypireize(c):
3333
path_pypireize = "./invokes/pypireize.py"
3434
c.run(f"python {path_pypireize} --setup-path {PATH_SETUP}")
3535

36-
37-
38-
3936
@task
40-
def flagerize(c, package_name="ACPy"):
37+
def flagerize(c, package_name="diffCheck"):
4138
path_flagerize = "./invokes/flagerize.py"
42-
c.run(f"python {path_flagerize} --package {package_name} --from-manifest")
39+
c.run(f"python {path_flagerize} \
40+
--package {package_name} \
41+
--source {DIR_IN_GHUSER_COMPONENTS} \
42+
--from-manifest \
43+
--path-manifest {PATH_MANIFEST}")
44+
45+
4346

4447

4548
@task

0 commit comments

Comments
 (0)