Skip to content

Commit b18a07f

Browse files
committed
FIX-ADD: pythonnet pip dependecy spec in conda env.yml
1 parent 0803ded commit b18a07f

File tree

8 files changed

+62
-38
lines changed

8 files changed

+62
-38
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 1.0.0 LANGUAGES CXX C)
2+
project(diffCheck VERSION 0.0.23 LANGUAGES CXX C)
33
set(CMAKE_CXX_STANDARD 17)
44

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

cmake/activate_conda.bat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ exit /b 1
3232
:end
3333
echo Anaconda3 found.
3434

35-
:: check if a different environment then diff_check is activated, if so deactivate it
36-
for /f "delims=" %%i in ('conda env list ^| findstr /C:"*"') do set "active_env=%%i"
37-
for /f "delims= " %%j in ("%active_env%") do set "active_env_name=%%j"
38-
if not "%active_env_name%"=="diff_check" (
39-
echo You should deactivating %active_env_name% firs
40-
echo Call "conda deactivate"
41-
)
42-
4335
:: Check if the diff_check environment is available
4436
call conda env list | findstr /C:"diff_check" >nul 2>nul
4537
if %ERRORLEVEL% neq 0 (
@@ -57,4 +49,12 @@ if %ERRORLEVEL% neq 0 (
5749
)
5850
echo diff_check environment is up to date.
5951

52+
:: check if a different environment then diff_check is activated, if so deactivate it
53+
for /f "delims=" %%i in ('conda env list ^| findstr /C:"*"') do set "active_env=%%i"
54+
for /f "delims= " %%j in ("%active_env%") do set "active_env_name=%%j"
55+
if not "%active_env_name%"=="diff_check" (
56+
echo You should deactivating %active_env_name% first with "conda deactivate" and "conda activate diff_check" before running this script.
57+
exit /b 1
58+
)
59+
6060
echo you can start the cmake config now ...

environment.yml

46 Bytes
Binary file not shown.

invokes/versionize.py

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def main(
1313
path_manifest: str,
1414
path_setup: str,
1515
path_init: str,
16+
path_cmake: str,
1617
is_from_manifest: bool,
1718
*args, **kwargs
1819
) -> bool:
@@ -77,6 +78,15 @@ def main(
7778
with open(path_init, "w") as f:
7879
f.write(init)
7980

81+
# modify the CMake file
82+
cmake_crt_version = None
83+
# search the first "project" line
84+
with open(path_cmake, "r") as f:
85+
cmake = f.read()
86+
cmake = re.sub(r"(project\(diffCheck VERSION )(\d+\.\d+\.\d+)", r"\g<1>" + version, cmake)
87+
with open(path_cmake, "w") as f:
88+
f.write(cmake)
89+
8090
return True
8191

8292
if __name__ == "__main__":
@@ -98,24 +108,31 @@ def main(
98108
parser.add_argument(
99109
"--path-manifest",
100110
type=str,
101-
required=False,
111+
required=True,
102112
default="./manifest.yml",
103113
help="The path to the manifest file."
104114
)
105115
parser.add_argument(
106116
"--path-setup",
107117
type=str,
108-
required=False,
109-
default="./py/pypi/setup.py",
118+
required=True,
119+
default="./src/gh/diffCheck/setup.py",
110120
help="The path to the setup file."
111121
)
112122
parser.add_argument(
113123
"--path-init",
114124
type=str,
115-
required=False,
116-
default="./py/pypi/ACPy/__init__.py",
125+
required=True,
126+
default="./src/gh/diffCheck/diffCheck/__init__.py",
117127
help="The path to the __init__ file."
118128
)
129+
parser.add_argument(
130+
"--path-cmake",
131+
type=str,
132+
required=True,
133+
default="./CMakeLists.txt",
134+
help="The path to the CMake file."
135+
)
119136

120137
args = parser.parse_args()
121138
parse_errors = []
@@ -154,23 +171,17 @@ def main(
154171
is_init_ok = False
155172
parse_errors.append(f"Path to __init__ file is invalid: {args.path_init}")
156173

174+
is_cmake_ok = True
175+
if not os.path.isfile(args.path_cmake):
176+
is_cmake_ok = False
177+
parse_errors.append(f"Path to CMake file is invalid: {args.path_cmake}")
178+
157179
print("Versionizer checks:")
158-
if is_version_ok:
159-
print("\t[x] Correct version format")
160-
else:
161-
print(f"\t[ ] Correct version format")
162-
if is_manifest_ok:
163-
print("\t[x] Manifest file path is valid")
164-
else:
165-
print(f"\t[ ] Manifest file path is valid")
166-
if is_setup_ok:
167-
print("\t[x] Setup file path is valid")
168-
else:
169-
print(f"\t[ ] Setup file path is valid")
170-
if is_init_ok:
171-
print("\t[x] __init__ file path is valid")
172-
else:
173-
print(f"\t[ ] __init__ file path is valid")
180+
print(f"\t[{'x' if is_version_ok else ' '}] Correct version format: {args.version}")
181+
print(f"\t[{'x' if is_manifest_ok else ' '}] Manifest file exists: {args.path_manifest}")
182+
print(f"\t[{'x' if is_setup_ok else ' '}] Setup file exists: {args.path_setup}")
183+
print(f"\t[{'x' if is_init_ok else ' '}] __init__ file exists: {args.path_init}")
184+
print(f"\t[{'x' if is_cmake_ok else ' '}] CMake file exists: {args.path_cmake}")
174185
if parse_errors.__len__() != 0:
175186
print("[ERRORS]:")
176187
for error in parse_errors:
@@ -183,6 +194,7 @@ def main(
183194
path_manifest=args.path_manifest,
184195
path_setup=args.path_setup,
185196
path_init=args.path_init,
197+
path_cmake=args.path_cmake,
186198
is_from_manifest=args.from_manifest
187199
)
188200

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.18
3+
version: 0.0.23
44
authors:
55
- Andrea Settimi
66
- Damien Gilliard

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.17"
4+
__version__ = "0.0.23"
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.17",
11+
version="0.0.23",
1212
packages=find_packages(),
1313
install_requires=[
1414
"numpy",

tasks.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# tasks.py
22
from invoke import task
33

4-
@task
5-
def ghcomponentize(c):
6-
path_ghcomponentizer = "./invokes/ghcomponentize/ghcomponentizer.py"
7-
c.run(f"python {path_ghcomponentizer} --ghio ./invokes/ghcomponentize/ghio ./py/components ./build/gh")
4+
PATH_MANIFEST = "./manifest.yml"
5+
PATH_SETUP = "./src/gh/diffCheck/setup.py"
6+
PATH_INIT = "./src/gh/diffCheck/diffCheck/__init__.py"
7+
PATH_CMAKE = "./CMakeLists.txt"
8+
89

910
@task
1011
def versionize(c):
1112
path_versionize = "./invokes/versionize.py"
12-
c.run(f"python {path_versionize} --from-manifest")
13+
c.run(f"python {path_versionize} \
14+
--from-manifest \
15+
--path-manifest {PATH_MANIFEST} \
16+
--path-setup {PATH_SETUP} \
17+
--path-init {PATH_INIT} \
18+
--path-cmake {PATH_CMAKE} \
19+
")
20+
21+
@task
22+
def ghcomponentize(c):
23+
path_ghcomponentizer = "./invokes/ghcomponentize/ghcomponentizer.py"
24+
c.run(f"python {path_ghcomponentizer} --ghio ./invokes/ghcomponentize/ghio ./py/components ./build/gh")
1325

1426
@task
1527
def flagerize(c, package_name="ACPy"):

0 commit comments

Comments
 (0)