Repository: JuliaPy/PyCall.jl
Pull request #1042 (2023-06-26 13:16:05)

fix depwarn
This updates deprecated code introduced in https://github.com/JuliaPy/PyCall.jl/pull/1039. We found this since our tests using some operations from PyCall.jl with `@test_nowarn` failed.

codecov-commenter: ## [Codecov](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
Patch coverage: **`100.00`**% and project coverage change: **`-1.19`** :warning:
> Comparison is base [(`c12d6d7`)](https://app.codecov.io/gh/JuliaPy/PyCall.jl/commit/c12d6d7da4116d8231c57e349a469567f14f362c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) 67.50% compared to head [(`c4288c8`)](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) 66.32%.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #1042      +/-   ##
==========================================
- Coverage   67.50%   66.32%   -1.19%     
==========================================
  Files          20       20              
  Lines        2025     2022       -3     
==========================================
- Hits         1367     1341      -26     
- Misses        658      681      +23     
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `66.32% <100.00%> (-1.19%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [src/PyCall.jl](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL1B5Q2FsbC5qbA==) | `66.35% <100.00%> (-1.55%)` | :arrow_down: |

... and [6 files with indirect coverage changes](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)


</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/JuliaPy/PyCall.jl/pull/1042?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).


Patch:
diff --git a/Project.toml b/Project.toml
index 133a026..413c282 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,7 +1,7 @@
 name = "PyCall"
 uuid = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
 authors = ["Steven G. Johnson <stevenj@mit.edu>", "Yichao Yu <yyc1992@gmail.com>", "Takafumi Arakaki <aka.tkf@gmail.com>", "Simon Kornblith <simon@simonster.com>", "Páll Haraldsson <Pall.Haraldsson@gmail.com>", "Jon Malmaud <malmaud@gmail.com>", "Jake Bolewski <jakebolewski@gmail.com>", "Keno Fischer <keno@alumni.harvard.edu>", "Joel Mason <jobba1@hotmail.com>", "Jameson Nash <vtjnash@gmail.com>", "The JuliaPy development team"]
-version = "1.96.0"
+version = "1.96.1"
 
 [deps]
 Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
diff --git a/deps/find_libpython.py b/deps/find_libpython.py
index 422a020..222d971 100755
--- a/deps/find_libpython.py
+++ b/deps/find_libpython.py
@@ -264,7 +264,7 @@ def normalize_path(path, suffix=SHLIB_SUFFIX, is_apple=is_apple):
 
     Parameters
     ----------
-    path : str ot None
+    path : str or None
         A candidate path to a shared library.
     """
     if not path:
diff --git a/src/PyCall.jl b/src/PyCall.jl
index 182abb1..f1987a2 100644
--- a/src/PyCall.jl
+++ b/src/PyCall.jl
@@ -983,7 +983,7 @@ const _deepcopy = PyNULL()
 
 function Base.deepcopy_internal(obj::PyObject, stackdict::Base.IdDict)
     haskey(stackdict, obj) && return stackdict[obj]
-    ispynull(_deepcopy) && copy!(_deepcopy, pyimport("copy")["deepcopy"])
+    ispynull(_deepcopy) && copy!(_deepcopy, pyimport("copy")."deepcopy")
     ret =  pycall(_deepcopy, PyObject, obj)
     stackdict[obj] = ret
     ret


Test patch:
diff --git a/test/runtests.jl b/test/runtests.jl
index b718ee2..96dc4fa 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -622,7 +622,7 @@ end
 
 @testset "deepcopy #757" begin
     l = py"[1,2,3]"o
-    l2 = deepcopy(l)
+    l2 = @test_nowarn deepcopy(l)
     @test l == l2
     l2.append(4)
     @test l != l2
@@ -636,7 +636,7 @@ end
             self.b = b
     """
     obj = py"C757(C757(1,2), C757(3,4))"o
-    obj2 = deepcopy(obj)
+    obj2 = @test_nowarn deepcopy(obj)
     @test PyPtr(obj) != PyPtr(obj2) # make sure a new Python object is created
     @test obj.a.a == obj2.a.a
     @test obj.a.b == obj2.a.b
@@ -651,7 +651,7 @@ end
 
     c = py"C757(1,2)"
     obj = S(c, c)
-    obj2 = deepcopy(obj)
+    obj2 = @test_nowarn deepcopy(obj)
     @test obj.a === obj.b
     @test obj2.a === obj2.b
     obj.a.a = 4