From c0c2881f396b68d387f904b7fc1aaa51ae8d16bf Mon Sep 17 00:00:00 2001 From: Elias Ohneberg Date: Mon, 30 Sep 2024 09:06:43 +0100 Subject: [PATCH] No Precompilation --- .gitignore | 4 +++- Project.toml | 4 +--- README.md | 17 +++++++++++++++++ docs/src/VersionChanges.md | 5 +++++ docs/src/index.md | 17 +++++++++++++++++ src/YFinance.jl | 12 ------------ 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 0783f97..1f4d96e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /docs/build examples.jl /ToDo -/.vscode \ No newline at end of file +/.vscode +Project with_precompile.toml +src/YFinance with precompile.jl \ No newline at end of file diff --git a/Project.toml b/Project.toml index 07cd77e..cc9768a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "YFinance" uuid = "e4b3b0a2-f9a3-42f3-aabb-32142cceaf77" authors = ["Elias L Ohneberg"] -version = "0.1.8" +version = "0.1.9" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -9,7 +9,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" [weakdeps] @@ -28,7 +27,6 @@ OrderedCollections = "1.3" TSFrames = "0.2.2" TimeSeries = "0.24" julia = "1.6" -PrecompileTools="1" [extras] TSFrames = "9f90e835-9451-4aaa-bcb1-743a1b8d2f84" diff --git a/README.md b/README.md index 6151cd4..b8b2c54 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,23 @@ The package is registered in the [`General`](https://github.com/JuliaRegistries/ Pkg.add("YFinance") ``` +## Precompilation + +### Version 0.1.8 +Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. One user at least has reported errors. Note precompilation also does not work if you require to set a proxy to access the internet. + +To Install this version enter the package mode by entering `]` in the REPL and run the following command: +```julia +(@v1.10) pkg> add YFinance @v0.1.8 +``` + +### Version 0.1.9 +Does not precompile. +To Install this version enter the package mode by entering `]` in the REPL and run the following command: +```julia + (@v1.10) pkg> add YFinance +``` + # Examples: There are more examples in the Docs. diff --git a/docs/src/VersionChanges.md b/docs/src/VersionChanges.md index 8055856..bf65db7 100644 --- a/docs/src/VersionChanges.md +++ b/docs/src/VersionChanges.md @@ -1,3 +1,8 @@ +!!! info "v0.1.9" + ## Bug Fix + * Getting rid of precompilation. Precompilation hangs and also doesn't work if a proxy is required ([#23](https://github.com/eohne/YFinance.jl/issues/23)) + + !!! info "v0.1.8" ## Bug Fix * `get_prices` fixes indexing error when divsplits=true ([#22](https://github.com/eohne/YFinance.jl/issues/22)) diff --git a/docs/src/index.md b/docs/src/index.md index 293f31f..a12e302 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -40,4 +40,21 @@ Pkg.add("YFinance") To load the package simply type the following: ```julia using YFinance +``` + +## Precompilation + +### Version 0.1.8 +Precompilation of the `get_prices` function. This has caused precompilation hangs for Julia 1.10 and 1.11 - package typically still precompiles but takes long and gives warnings. One user at least has reported errors. Note precompilation also does not work if you require to set a proxy to access the internet. + +To Install this version enter the package mode by entering `]` in the REPL and run the following command: +```julia +(@v1.10) pkg> add YFinance @v0.1.8 +``` + +### Version 0.1.9 +Does not precompile. +To Install this version enter the package mode by entering `]` in the REPL and run the following command: +```julia + (@v1.10) pkg> add YFinance ``` \ No newline at end of file diff --git a/src/YFinance.jl b/src/YFinance.jl index 662e285..c2195dd 100644 --- a/src/YFinance.jl +++ b/src/YFinance.jl @@ -6,7 +6,6 @@ module YFinance using HTTP using JSON3 using Random - using PrecompileTools: @setup_workload, @compile_workload export _PROXY_SETTINGS, create_proxy_settings,clear_proxy_settings, _set_cookies_and_crumb export validate_symbol,get_valid_symbols,get_prices, get_dividends, get_splits @@ -34,15 +33,4 @@ module YFinance include("ESG.jl"); include("Search_Symbol.jl"); include("News_Search.jl"); - - - @setup_workload begin - @compile_workload begin - get_prices("AAPL",interval = "1m",range="1d"); - get_prices("AAPL",interval = "1d",startdt=Date(2009,01,01), enddt = Date(2009,01,05)); - get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05"); - get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05",prepost=true); - get_prices("AAPL",interval = "1d",startdt="2009-01-01", enddt = "2009-01-05",divsplits=true); - end - end end \ No newline at end of file