Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg.rm removes [targets] from Project.toml #984

Closed
sostock opened this issue Jan 9, 2019 · 1 comment
Closed

Pkg.rm removes [targets] from Project.toml #984

sostock opened this issue Jan 9, 2019 · 1 comment

Comments

@sostock
Copy link

sostock commented Jan 9, 2019

Removing any package from a project via Pkg.rm removes the [targets] section from the Project.toml:

julia> versioninfo()
Julia Version 1.0.3
Commit 099e826241 (2018-12-18 01:34 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, ivybridge)

(v1.0) pkg> generate Foo
Generating project Foo:
    Foo/Project.toml
    Foo/src/Foo.jl

(v1.0) pkg> activate Foo

julia> f = open("Foo/Project.toml", "a"); write(f,
       """

       [extras]
       Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

       [targets]
       test = ["Test"]
       """); close(f);

shell> cat Foo/Project.toml
authors = ["<removed>"]
name = "Foo"
uuid = "2e060878-13ed-11e9-0e15-0759cb5991b0"
version = "0.1.0"

[deps]

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]

(Foo) pkg> add Unicode
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `~/Downloads/julia-1.0.3/bin/Foo/Project.toml`
  [4ec0a83e] + Unicode 
  Updating `~/Downloads/julia-1.0.3/bin/Foo/Manifest.toml`
  [4ec0a83e] + Unicode 

shell> cat Foo/Project.toml
name = "Foo"
uuid = "2e060878-13ed-11e9-0e15-0759cb5991b0"
authors = ["<removed>"]
version = "0.1.0"

[deps]
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]

(Foo) pkg> rm Unicode
  Updating `~/Downloads/julia-1.0.3/bin/Foo/Project.toml`
  [4ec0a83e] - Unicode 
  Updating `~/Downloads/julia-1.0.3/bin/Foo/Manifest.toml`
  [4ec0a83e] - Unicode 

shell> cat Foo/Project.toml
name = "Foo"
uuid = "2e060878-13ed-11e9-0e15-0759cb5991b0"
authors = ["<removed>"]
version = "0.1.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@fredrikekre fredrikekre transferred this issue from JuliaLang/julia Jan 9, 2019
@fredrikekre
Copy link
Member

duplicate of #876

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants