Esempio n. 1
0
        private static void ProcessKeras()
        {
            var spec = new ReleaseSpec()
            {
                Version             = $"3.6.{V}",
                ProjectName         = ProjectName,
                RelativeProjectPath = ProjectPath,
                PackageId           = "Keras.NET",
                Description         = @"C# bindings for Keras on {0} - Keras.NET is a high-level neural networks API, capable of running on top of TensorFlow, CNTK, or Theano. ",
                PackageTags         = "Data science, Machine Learning, ML, AI, Keras, Neural Network, deep learning",
                UsePythonIncluded   = true,
            };

            spec.Process();
            // nuget
            var key = File.ReadAllText("../../nuget.key").Trim();

            foreach (var nuget in Directory.GetFiles(Path.Combine(ProjectPath, "bin", "Release"), "*.nupkg"))
            {
                Console.WriteLine("Push " + nuget);
                var arg = $"push -Source https://api.nuget.org/v3/index.json -ApiKey {key} {nuget}";
                var p   = new Process()
                {
                    StartInfo = new ProcessStartInfo("nuget.exe", arg)
                    {
                        RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false
                    }
                };
                p.OutputDataReceived += (x, data) => Console.WriteLine(data.Data);
                p.ErrorDataReceived  += (x, data) => Console.WriteLine("Error: " + data.Data);
                p.Start();
                p.WaitForExit();
                Console.WriteLine("... pushed");
            }
        }
Esempio n. 2
0
        private static void ProcessNumpy()
        {
            var spec = new ReleaseSpec()
            {
                Version             = $"3.7.{V}",
                ProjectName         = ProjectName,
                RelativeProjectPath = ProjectPath,
                PackageId           = "Numpy",
                Description         = @"C# bindings for NumPy - a fundamental library for scientific computing, machine learning and AI. Does not require a local Python installation!",
                PackageTags         = "Data science, Machine Learning, ML, AI, Scientific Computing, NumPy, Linear Algebra, FFT, SVD, Matrix, Python",
                UsePythonIncluded   = true,
            };

            spec.Process();
            // nuget
            var key = File.ReadAllText("../../nuget.key").Trim();

            foreach (var nuget in Directory.GetFiles(Path.Combine(ProjectPath, "bin", "Release"), "*.nupkg"))
            {
                Console.WriteLine("Push " + nuget);
                var arg = $"push -Source https://api.nuget.org/v3/index.json -ApiKey {key} {nuget}";
                var p   = new Process()
                {
                    StartInfo = new ProcessStartInfo("nuget.exe", arg)
                    {
                        RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false
                    }
                };
                p.OutputDataReceived += (x, data) => Console.WriteLine(data.Data);
                p.ErrorDataReceived  += (x, data) => Console.WriteLine("Error: " + data.Data);
                p.Start();
                p.WaitForExit();
                Console.WriteLine("... pushed");
            }
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // ==> Numpy
            ProcessNumpy();

            // ==> Numpy Bare
            var specs = new ReleaseSpec[]
            {
                // linux
                new ReleaseSpec()
                {
                    CPythonVersion = "2.7", Platform = "Linux",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.5", Platform = "Linux",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.6", Platform = "Linux",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.7", Platform = "Linux",
                },
                // mac
                new ReleaseSpec()
                {
                    CPythonVersion = "2.7", Platform = "OSX",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.5", Platform = "OSX",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.6", Platform = "OSX",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.7", Platform = "OSX",
                },
                // win
                new ReleaseSpec()
                {
                    CPythonVersion = "2.7", Platform = "Win64",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.5", Platform = "Win64",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.6", Platform = "Win64",
                },
                new ReleaseSpec()
                {
                    CPythonVersion = "3.7", Platform = "Win64",
                },
            };

            foreach (var spec in specs)
            {
                spec.Version             = $"{spec.CPythonVersion}.{V}";
                spec.PythonNetVersion    = $"{spec.CPythonVersion}.{PythonNetVersion}";
                spec.Description         = string.Format(Description, spec.Platform, spec.CPythonVersion);
                spec.PackageTags         = Tags;
                spec.RelativeProjectPath = ProjectPath2;
                spec.ProjectName         = ProjectName2;
                switch (spec.Platform)
                {
                case "Linux":
                    spec.PackageId = "Numpy.Bare.Mono";
                    spec.PythonNet = "Python.Runtime.Mono";
                    break;

                case "OSX":
                    spec.PackageId = "Numpy.Bare.OSX";
                    spec.PythonNet = "Python.Runtime.OSX";
                    break;

                case "Win64":
                    spec.PackageId = "Numpy.Bare";
                    spec.PythonNet = "Python.Runtime.NETStandard";
                    break;
                }
                spec.Process();
            }

            var key = File.ReadAllText("../../nuget.key").Trim();

            foreach (var nuget in Directory.GetFiles(Path.Combine(ProjectPath2, "bin", "Release"), "*.nupkg"))
            {
                Console.WriteLine("Push " + nuget);
                var arg = $"push -Source https://api.nuget.org/v3/index.json -ApiKey {key} {nuget}";
                var p   = new Process()
                {
                    StartInfo = new ProcessStartInfo("nuget.exe", arg)
                    {
                        RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false
                    }
                };
                p.OutputDataReceived += (x, data) => Console.WriteLine(data.Data);
                p.ErrorDataReceived  += (x, data) => Console.WriteLine("Error: " + data.Data);
                p.Start();
                p.WaitForExit();
                Console.WriteLine("... pushed");
            }
            Thread.Sleep(3000);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            var win_id   = "Python.Runtime.Windows";
            var linux_id = "Python.Runtime.Linux";
            var osx_id   = "Python.Runtime.OSX";
            var specs    = new ReleaseSpec[]
            {
                // linux
                new ReleaseSpec()
                {
                    Version = "2.7." + V, Description = Description + "2.7 (linux)", PackageId = linux_id, PackageTags = Tags, Constants = "TRACE;PYTHON2;PYTHON27;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.5." + V, Description = Description + "3.5 (linux)", PackageId = linux_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON35;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.6." + V, Description = Description + "3.6 (linux)", PackageId = linux_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON36;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.7." + V, Description = Description + "3.7 (linux)", PackageId = linux_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON37;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                // mac
                new ReleaseSpec()
                {
                    Version = "2.7." + V, Description = Description + "2.7 (osx)", PackageId = osx_id, PackageTags = Tags, Constants = "TRACE;PYTHON2;PYTHON27;UCS2;MONO_OSX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.5." + V, Description = Description + "3.5 (osx)", PackageId = osx_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON35;UCS2;MONO_OSX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.6." + V, Description = Description + "3.6 (osx)", PackageId = osx_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON36;UCS2;MONO_OSX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.7." + V, Description = Description + "3.7 (osx)", PackageId = osx_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON37;UCS2;MONO_OSX;PYTHON_WITH_PYMALLOC", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                // win
                new ReleaseSpec()
                {
                    Version = "2.7." + V, Description = Description + "2.7 (win64)", PackageId = win_id, PackageTags = Tags, Constants = "TRACE;PYTHON2;PYTHON27;UCS2", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.5." + V, Description = Description + "3.5 (win64)", PackageId = win_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON35;UCS2", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.6." + V, Description = Description + "3.6 (win64)", PackageId = win_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON36;UCS2", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
                new ReleaseSpec()
                {
                    Version = "3.7." + V, Description = Description + "3.7 (win64)", PackageId = win_id, PackageTags = Tags, Constants = "TRACE;PYTHON3;PYTHON37;UCS2", RelativeProjectPath = ProjectPath, ProjectName = ProjectName
                },
            };

            foreach (var spec in specs)
            {
                //try
                {
                    spec.Process();
                }
                //catch (Exception e)
                //{
                //    Console.WriteLine(e.Message);
                //    Console.WriteLine(e.StackTrace);
                //}
            }

            var key = File.ReadAllText("../../nuget.key").Trim();

            foreach (var nuget in Directory.GetFiles(Path.Combine(ProjectPath, "bin", "Release"), "*.nupkg"))
            {
                Console.WriteLine("Push " + nuget);
                var arg = $"push -Source https://api.nuget.org/v3/index.json -ApiKey {key} {nuget}";
                var p   = new Process()
                {
                    StartInfo = new ProcessStartInfo("nuget.exe", arg)
                    {
                        RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false
                    }
                };
                p.OutputDataReceived += (x, data) => Console.WriteLine(data.Data);
                p.ErrorDataReceived  += (x, data) => Console.WriteLine("Error: " + data.Data);
                p.Start();
                p.WaitForExit();
                Console.WriteLine("... pushed");
            }
            Thread.Sleep(3000);
        }