Skip to content

Commit

Permalink
Remove pandas/matplotlib dependency version (#18)
Browse files Browse the repository at this point in the history
* Remove pandas/matplotlib dependency version

- To improve support remove pandas/matplotlib dependency version

* Pin pyright version
  • Loading branch information
Martin-Molinero authored Mar 28, 2024
1 parent 9eb6c6f commit 2887a0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:

- name: Install integration test dependencies
run: |
pip install pandas matplotlib
npm install --global pyright
pip install pandas matplotlib pyright==1.1.338
- name: Run integration tests
run: python integration/integration_tests.py
26 changes: 1 addition & 25 deletions QuantConnectStubsGenerator/Renderer/SetupRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ public void Render()
var packageVersion = GetPackageVersion();
var namespaces = GetNamespaces();

var pandasVersion = GetPythonPackageVersion("pandas");
var pandasVersionConstraint = pandasVersion != null ? $">={pandasVersion}" : "";

var matplotlibVersion = GetPythonPackageVersion("matplotlib");
var matplotlibVersionConstraint = matplotlibVersion != null ? $">={matplotlibVersion}" : "";

WriteLine($@"
from setuptools import setup
Expand Down Expand Up @@ -65,7 +59,7 @@ from AlgorithmImports import *
""License :: OSI Approved :: Apache Software License"",
""Programming Language :: Python :: 3""
],
install_requires=[""pandas{pandasVersionConstraint}"", ""matplotlib{matplotlibVersionConstraint}""],
install_requires=[""pandas"", ""matplotlib""],
packages=[
{string.Join(",\n", namespaces.Select(ns => new string(' ', 8) + $"\"{ns}\""))}
],
Expand Down Expand Up @@ -121,23 +115,5 @@ private List<string> GetNamespaces()
return ns.Replace('/', '.');
}).Distinct().OrderBy(name => name).ToList();
}

private string GetPythonPackageVersion(string package)
{
var dockerFilePath = Path.GetFullPath("DockerfileLeanFoundation", _leanPath);
if (File.Exists(dockerFilePath))
{
var dockerFileContents = File.ReadAllText(dockerFilePath);
var versionMatch = new Regex($@"{package}==?(\d+\.\d+\.\d+)").Match(dockerFileContents);

if (versionMatch.Success)
{
return versionMatch.Groups[1].Value;
}
}

Logger.Warn($"{dockerFilePath} does not pin {package} to a specific version");
return null;
}
}
}

0 comments on commit 2887a0a

Please sign in to comment.