Skip to content

Remove 6.0 PreviousVersion Attributes #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Python_Engine/Compute/DownloadPython.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public static partial class Compute
[Description("Download a target version of Python.")]
[Input("version", "A Python version.")]
[Output("executablePath", "The path of the executable for the downloaded Python.")]
[PreviousVersion("5.3", "BH.Engine.Python.Compute.DownloadPython()")]
public static string DownloadPython(this BH.oM.Python.Enums.PythonVersion version)
{
string targetDirectory = Query.EnvironmentsDirectory();
Expand Down
2 changes: 0 additions & 2 deletions Python_Engine/Compute/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ await Task.Run(() =>
[Input("startDirectory", "The directory in which the command should be run.")]
[Input("timeoutMinutes", "A number of minutes beyond which this command will timeout.")]
[Output("success", "True if successful and False if not.")]
[PreviousVersion("5.3", "BH.Engine.Python.Compute.RunCommandBool(System.String, System.Boolean, System.String)")]
public static bool RunCommandBool(string command, bool hideWindows = false, string startDirectory = null, double timeoutMinutes = 5)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
Expand Down Expand Up @@ -106,7 +105,6 @@ public static bool RunCommandBool(string command, bool hideWindows = false, stri
[Input("startDirectory", "The directory in which the command should be run.")]
[Input("timeoutMinutes", "A number of minutes beyond which this command will timeout.")]
[Output("stdout", "The StandardOutput from the command that was run. If the process failed, then StandardError will be returned here instead.")]
[PreviousVersion("5.3", "BH.Engine.Python.Compute.RunCommandStdout(System.String, System.Boolean, System.String)")]
public static string RunCommandStdout(string command, bool hideWindows = true, string startDirectory = null, double timeoutMinutes = 5)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
Expand Down
10 changes: 2 additions & 8 deletions Python_Engine/Python_Engine.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -89,7 +89,6 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Versioning_53.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Python_oM\Python_oM.csproj">
Expand Down Expand Up @@ -121,23 +120,18 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

xcopy "$(TargetDir)$(TargetFileName)" "C:\\ProgramData\\BHoM\\Assemblies" /Y
xcopy "$(TargetDir)Python.Runtime.dll" "C:\\ProgramData\\BHoM\\Assemblies" /Y

:: create infrastructure necessary to support Python environments
if not exist "C:\ProgramData\BHoM\Extensions\PythonEnvironments" mkdir "C:\ProgramData\BHoM\Extensions\PythonEnvironments"
if not exist "C:\ProgramData\BHoM\Extensions\PythonCode" mkdir "C:\ProgramData\BHoM\Extensions\PythonCode"

:: remove any old versions within target directory for current toolkits Python code
if exist "C:\ProgramData\BHoM\Extensions\PythonCode\$(SolutionName)" rmdir "C:\ProgramData\BHoM\Extensions\PythonCode\$(SolutionName)" /S /Q

:: move Python code over to toolkit extensions folder, redirecting output to temp log file to silence it
robocopy "$(ProjectDir)Python" "C:\ProgramData\BHoM\Extensions\PythonCode\$(SolutionName)" /s /purge /xf "*.pyc" /xd "\__pycache__\" &gt; output.log

:: remove temporary log file
del output.log

</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
1 change: 0 additions & 1 deletion Python_Engine/Query/CodeDirectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public static partial class Query
{
[Description("The path where any BHoM generated Python code is placed prior to inclusion in a BHoM Python Environment.")]
[Output("The path where any BHoM generated Python code is placed prior to inclusion in a BHoM Python Environment.")]
[PreviousVersion("5.3", "BH.Engine.Python.Query.CodeDirectory(BH.oM.Python.PythonEnvironment)")]
public static string CodeDirectory()
{
return Path.Combine(Query.ExtensionsDirectory(), "PythonCode");
Expand Down
Loading