# Pkg.jl internal API changes in Julia v1.7

**URL:** <https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607>\
**Category:** General Usage\
**Created:** [June 26, 2021, 3:59pm UTC](https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607 "2021-06-26T15:59:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 26, 2021, 3:59pm UTC](https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607/1 "2021-06-26T15:59:32Z")

</div>

An awesome contributor implemented programmatic `Project.toml` creation in Genie - but now the corresponding test breaks in Julia v1.7. It’s this line:

```julia
Pkg.project(Pkg.API.Context(), name, tmpdir) # generate tmp

```

in [Genie.jl/Generator.jl at f04988dc1c988767963ad8dcff80c36e58bebbf0 · GenieFramework/Genie.jl · GitHub](https://github.com/GenieFramework/Genie.jl/blob/f04988dc1c988767963ad8dcff80c36e58bebbf0/src/Generator.jl#L456)

Is it meant to be breaking and how can the same functionality be achieved in v1.7?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 26, 2021, 4:04pm UTC](https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607/2 "2021-06-26T16:04:00Z")

</div>

You are reaching pretty far into internals there so I wouldn’t call it breaking.

Why not just use the TOML stdlib and use `TOML.print` instead?

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 26, 2021, 4:10pm UTC](https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607/3 "2021-06-26T16:10:07Z")

</div>

It’s user contributed and I’m trying to digest the whole thing but I’m not familiar with the APIs.

`TOML.print` seems to require writing the `Project.toml` by hand? Is there a way to hook into the current Pkg API to replicate the old functionality?

In v1.6 the line `Pkg.project(Pkg.API.Context(), name, "zetempdir")` generates the full `Project.toml` file (including folders creation):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/3/8/38da6a18dbcd842171606c7245ca94d82343f7ec.png)

---

<div class="post-metadata">

**Author:** ![essenciary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/essenciary/32/210469_2.png) [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Post date:** [June 26, 2021, 4:43pm UTC](https://discourse.julialang.org/t/pkg-jl-internal-api-changes-in-julia-v1-7/63607/4 "2021-06-26T16:43:57Z")

</div>

OK, I just git blamed the file in `Pkg` and stol… ehem, _borrowed_ the old `Pkg.project` and related API into `Genie.Generate` 🤓

Also it looks like 1.7 breaks something in `Revise`

```julia
WARNING: Method definition Any() in module Revise at C:\Users\adria\.julia\packages\Revise\9lZUE\src\types.jl:272 overwritten on the same line (check for duplicate calls to `include`)

```
