Giter Club home page Giter Club logo

pkgcleanup.jl's Introduction

PkgCleanup

Build Status

The Pkg.gc() command garbage collects packages and artifacts that are no longer reachable, but will not touch existing packages or artifacts requested by existing active environments, which are listed in your ~/.julia/logs directory. One option for a more deep cleaning is to run ]gc --all, but this will remove... well... all packages.

If you prefer a more controlled way to clean package installations in your Julia depot, you can remove the undesired manifests lingering in ~/.julia/logs. PkgCleanup.jl provides a couple of functions which let you interactively remove active environments or artifacts you do not care about any longer but cannot be removed by Pkg.gc().

Installation

To install the package, enter the Julia Pkg REPL mode with ] and run the command

add https://github.com/giordano/PkgCleanup.jl

Usage

To load the package, run in the Julia REPL the command

using PkgCleanup

PkgCleanup.jl provides the following interactive functions:

  • PkgCleanup.artifacts(): to remove unneeded Artifacts.toml from your ~/.julia/logs/artifact_usage.toml;
  • PkgCleanup.manifests(): to remove unneeded Manifest.toml from your ~/.julia/logs/manifest_usage.toml.

Yes, that's it.

Demo

NOTE: deselect the entries you want to remove.

julia> using PkgCleanup

julia> PkgCleanup.manifests()
Select the Manifest.toml to keep in /home/user/.julia/logs/manifest_usage.toml
[press: d=done, a=all, n=none]
^  [X] /home/user/.julia/dev/BinaryBuilder/benchmark/Manifest.toml
   [X] /home/user/.julia/dev/JLLWrappers/Manifest.toml
   [X] /home/user/.julia/dev/PhysicalConstants/Manifest.toml
   [X] /home/user/.julia/dev/PkgCleanup/Manifest.toml
   [ ] /home/user/.julia/environments/v1.0/Manifest.toml
   [ ] /home/user/.julia/environments/v1.3/Manifest.toml
   [ ] /home/user/.julia/environments/v1.4/Manifest.toml
 > [ ] /home/user/.julia/environments/v1.5/Manifest.toml
   [X] /home/user/.julia/environments/v1.6/Manifest.toml
v  [X] /home/user/.julia/environments/v1.7/Manifest.toml

You are going to remove the following entries in /home/user/.julia/logs/manifest_usage.toml:
  * /home/user/.julia/environments/v1.0/Manifest.toml
  * /home/user/.julia/environments/v1.3/Manifest.toml
  * /home/user/.julia/environments/v1.4/Manifest.toml
  * /home/user/.julia/environments/v1.5/Manifest.toml
Do you confirm your choice? [Y/n]: y

To actually cleanup packages/artifacts installations, remember to run

    using Pkg
    Pkg.gc()

or, for a more in-depth cleaning,

    using Pkg
    using Dates
    Pkg.gc(; collect_delay=Dates.Day(0))

License

The PkgCleanup.jl package is licensed under the MIT "Expat" License. The original author is Mosè Giordano.

pkgcleanup.jl's People

Contributors

giordano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.