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;
- namespace Neuron.Python {
- public sealed class Main : Script {
- public override void Execute(string[] args) {
- //Console.WriteLine(run_python("d:/helloworld.py"));
- Console.WriteLine(python_version());
- cd_bin("../../");
- using (cd_tmp("dist")) {
- mkdir("dist");
- del("./", "*.whl");
- del("./", "*.zip");
- }
- Information(cd());
- copyto(selectfiles("d:/testdir/a/*.txt"), "d:/testdir/output/a");
- appendenv("PYTHONPATH", "D:\\neuron\\repository\\src\\pc-side\\neuronprotocol-python\\src");
- 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");
- run_python($"../setup.py bdist bdist_dumb --format=zip", throwOnError: false);
- moveto("dist", "./", true);
- del("dist");
- run_python("../setup.py bdist_wheel --universal");
- 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...");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement