Skip to content

Commit

Permalink
update CI for 1.11 (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
svilupp authored Dec 6, 2024
1 parent b95f6c9 commit f354d8e
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
version:
- '1.9'
- '1.10'
# - '1.11'
- '1.11'
# - 'nightly'
os:
- ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [0.65.2]

### Fixed
- Fixed a bug in `extract_docstring` where it would not correctly block "empty" docstrings on Julia 1.11.


## [0.65.1]

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PromptingTools"
uuid = "670122d1-24a8-4d70-bfce-740807c42192"
authors = ["J S @svilupp and contributors"]
version = "0.65.1"
version = "0.65.2"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
3 changes: 2 additions & 1 deletion src/extraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ function extract_docstring(
## we ignore the ones that are subtypes for now (to prevent picking up Dicts, etc.)
if (type isa Type && (supertype(type) == Any)) || (type isa Function)
docs = Docs.doc(type) |> string
if !occursin("No documentation found.\n\n", docs)
## Covers two known cases: "No documentation found.\n\n" and "No documentation found for private symbol."
if !startswith(docs, "No documentation found")
return first(docs, max_description_length)
end
end
Expand Down
6 changes: 4 additions & 2 deletions test/Experimental/AgentTools/code_feedback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ end

# Test case 1: Test error_feedback with defined variable
e = UndefVarError(:Threads)
expected_output = "UndefVarError: `Threads` not defined\nExpert Tip: I know that the variable Threads is defined in Base module. Use `import Base.Threads` to use it."
@test error_feedback(e) == expected_output
str = error_feedback(e)
@test occursin("UndefVarError: `Threads` not defined", str)
@test occursin(
"Expert Tip: I know that the variable Threads is defined in Base module.", str)

# Test case 2: Test error_feedback with undefined variable
e = UndefVarError(:SomeVariable)
Expand Down
6 changes: 4 additions & 2 deletions test/code_eval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ using PromptingTools: extract_module_name
""")
eval!(cb)
@test cb.success == false
@test cb.error == UndefVarError(:b)
@test cb.error isa UndefVarError
@test cb.error.var == :b
@test !isnothing(cb.expression) # parsed
end

Expand All @@ -45,7 +46,8 @@ using PromptingTools: extract_module_name
cb = eval!(cb)
eval!(cb, cb.expression; capture_stdout = false)
@test cb.success == false
@test cb.error == UndefVarError(:b)
@test cb.error isa UndefVarError
@test cb.error.var == :b
@test cb.error_lines == [1]
# despite not capturing stdout, we always unwrap the error to be able to detect error lines
@test occursin("UndefVarError", cb.stdout)
Expand Down
1 change: 0 additions & 1 deletion test/extraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ end
@test get_arg_names(first(methods(f6))) == [:x, :y]
@test get_arg_types(first(methods(f6))) == [Int, String]
end

@testset "to_json_schema" begin
struct MyStruct
field1::Int
Expand Down

0 comments on commit f354d8e

Please sign in to comment.