GithubHelp home page GithubHelp logo

manish364824 / conda-package-handling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conda/conda-package-handling

0.0 0.0 0.0 411 KB

Create and extract conda packages of various formats

License: BSD 3-Clause "New" or "Revised" License

Python 92.42% C 3.72% Batchfile 2.55% Shell 1.31%

conda-package-handling's Introduction

conda-package-handling

Create and extract conda packages of various formats

usage: cph [-h] {extract,x,create,c,transmute,t} ...

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  {extract,x,create,c,transmute,t}
    extract (x)         extract package contents
    create (c)          bundle files into a package
    transmute (t)       convert from one package type to another

cph is an abstraction of conda package handling and a tool for extracting, creating, and converting between formats.

At the time of writing, the standard conda package format is a .tar.bz2 file. That will need to be maintained for quite a long time, thanks to the long tail of people using old conda versions. There is a new conda format, described at https://docs.google.com/document/d/1HGKsbg_j69rKXPihhpCb1kNQSE8Iy3yOsUU2x68x8uw/edit?usp=sharing. This new format is designed to have much faster metadata access and utilize more modern compression algorithms, while also facilitating package signing without adding sidecar files.

For example, one can transmute (convert) the old package format to the new one with cph:

cph transmute mkl-2018.0.3-1.tar.bz2 .conda

One can then test the speed of extracting the old file and the new one:

$ time cph extract mkl-2018.0.3-1.tar.bz2 --dest mkl-a
cph extract mkl-2018.0.3-1.tar.bz2 --dest mkl-a  18.16s user 0.59s system 98% cpu 19.015 total
$ time cph extract mkl-2018.0.3-1.conda --dest mkl-b
cph extract mkl-2018.0.3-1.conda --dest mkl-b  1.41s user 0.65s system 87% cpu 2.365 total

The new package format is an indexed, uncompressed zip file that contains tarfiles that can use any compression supported by libarchive. The info metadata about packages is separated into its own tarfile from the rest of the package contents. By doing this, we can extract only the metadata, for speeding up operations like indexing.

$ time cph extract mkl-2018.0.3-1.conda --dest mkl-b --info
cph extract mkl-2018.0.3-1.conda --dest mkl-b --info  0.21s user 0.07s system 98% cpu 0.284 total```

Package creation is primarily something that conda-build uses, as cph does absolutely nothing to create metadata that makes a conda package useful. However, you may consider it useful to abuse cph's package creation as a way of utilizing newer compression formats.

cph create /path/to/some/dir my-cute-archive.conda

Again, this would not necessarily create a valid conda package, unless the directory being archived contained all the metadata in an "info" directory that a standard conda package needs. The .conda file it creates, however, uses all the nice new compression formats, though, and you could use cph on some other computer to extract it.

Releasing

Conda-package-handling releases may be performed via the rever command <https://regro.github.io/rever-docs/>_. Rever is configured to perform the activities for a typical conda-build release. To cut a release, simply run rever <X.Y.Z> where <X.Y.Z> is the release number that you want bump to. For example, rever 1.2.3. However, it is always good idea to make sure that the you have permissions everywhere to actually perform the release. So it is customary to run rever check before the release, just to make sure. The standard workflow is thus::

 rever check
rever 1.2.3

If for some reason a release fails partway through, or you want to claw back a release that you have made, rever allows you to undo activities. If you find yourself in this pickle, you can pass the --undo option a comma-separated list of activities you'd like to undo. For example::

 rever --undo tag,changelog,authors 1.2.3

Happy releasing!

conda-package-handling's People

Contributors

alanhdu avatar jjhelmus avatar manish364824 avatar mingwandroid avatar msarahan avatar nehaljwani avatar ossdev07 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.