Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Reflection;
- using System.Text.RegularExpressions;
- namespace Neuron.Python {
- public sealed class Main : Script {
- public override void Execute(string[] args) {
- //Console.WriteLine(run_python("d:/helloworld.py"));
- var pythonHomes = python_homes();
- foreach (var pythonHomeInfo in pythonHomes) {
- Information("Found {0} at {1}", "Python" + pythonHomeInfo.Version, pythonHomeInfo.PythonHome);
- }
- appendenv("PYTHONPATH", "D:\\neuron\\repository\\src\\pc-side\\neuronprotocol-python\\src");
- foreach (var pythonInfo in pythonHomes) {
- pythonInfo.setenvs(); //sets PYTHONHOME and PYTHONPATH
- Information(PythonInfo);
- python_version();
- cd_bin("../../");
- using (cd_tmp("dist")) {
- mkdir("dist");
- del("./", "*.whl");
- del("./", "*.zip");
- }
- Information(cd());
- setenv("SRCPATH", relative("../../"));
- setenv("ROOT_PATH", getenv("SRCPATH"));
- setenv("DIST_PATH", relative("dist"));
- setenv("BOOST_ROOT", "D:\\local\\boost_1_70_0");
- copyto("src", "dist");
- Information("Python path: {0}", @where("python"));
- using (cd_tmp("dist")) {
- //run_python($"../python/build37.py bdist --help");
- //run_python($"../python/build37.py --help-commands");
- //run_python($"../python/build37.py build");
- pip_install("wheel");
- run_python($"../setup.py bdist bdist_dumb --format=zip --plat-name win32", throwOnError: false);
- run_python($"../setup.py bdist bdist_dumb --format=zip --plat-name win-amd64", throwOnError: false);
- moveto("dist", "./", true);
- del("dist");
- run_python("../setup.py bdist_wheel --universal --plat-name win32");
- run_python("../setup.py bdist_wheel --universal --plat-name win-amd64");
- moveto("dist", "./", true);
- copyto(selectfiles(".", "*.whl|*.zip"), "../out/");
- }
- //using (cd_tmp("out")) {
- // //todo proper check if build worked
- // var whl = selectfiles(".", "*.whl").OrderByDescending(p => new FileInfo(p).CreationTimeUtc).FirstOrDefault();
- // Information(install_whl(whl, Constants.PackageName));
- //}
- Information("copying...");
- clear_envs_cache();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement