Volker Braun wrote:
This is a RFC for new packaging system for "sage-the-distribution". I've
already talked about this with a few of you at the last sage days, but
finally it managed to do something about it. The goal is to be:

* Git-aware: use SHA1 hashes instead of timestamps for dependency
calculations

? Hashs of what exactly? Modification / installation time of course matters...

* Unified machine-readable package configuration using YAML
* Dependency handling also for optional packages
* Distinction between different types of dependencies: build time,
runtime hard/soft, testing.
* Modular, allowing for easy experimentation with per-package backends
* written in pure Python without any dependencies
* doctested for Python 2.6, 2.7, 3.3, and 3.4.

So we're finally making (some) Python a prerequisite -- fine, provided all (or at least most) packages get built with the system's Python, i.e., do not (artificially) depend on Sage's Python.


Having all package configuration data accessible in machine-readable
form is IMHO the key to managing complexity. There are various
possibilities for the file format, but in the end I think YAML is the
best choice. It integrates very well with Python, is easy to read/write
for humans, and if things go wrong the parser can pin-point the error
very well. Downside is that it is not in the Python standard library,
but then I don't think we should that let us dictate the file format.
We'll just include the Python-only part of PyYAML as a fallback if the
OS Python does not have it.

The entire package configuration will be in a file
SAGE_ROOT/build/pkgs/<name>/package.yaml, for example
----------------------------------------
name:
     matplotlib

category:
     standard

source:
     version:
         1.3.1
     tarball:
         name:     matplotlib-{source.version}.tar.gz
         sha1:     f340378c43c4c3f6219ef9fd84af4ebbe18f8feb

builder:
     type:            SpkgInstallScript
     install_script:  spkg-install

depends:
     build:
         - pkgconf
         - setuptools
     hard:
         - python
         - numpy
         - freetype
         - libpng
         - gdmodule
         - dateutil
         - pyparsing
----------------------------------------

Not sure what "hard" dependencies are supposed to mean -- above you talk about hard/soft *runtime* dependencies, while at least some of the "hard" dependencies listed above are definitely *build* time dependencies (Python, freetype, libpng...).

What about versions in dependencies (i.e., prerequisites)?

(Patch level) version of the Sage package / YAML file?

I'd also add a couple of things from SPKG.txt:

 - perhaps at least short (one-line) description
 - copyright / license information
 - URL of upstream tarball if appropriate
 - upstream contact and website
 - author(s)
 - perhaps (Sage) package maintainers
 - list of patches?


I've been working on an implementation, which you can find at
http://trac.sagemath.org/ticket/16483. It is not feature-complete, but
can already build the standard packages in dependency order.


The package manager lives in SAGE_ROOT/build/manager. Eventually, all
build-related sage command line switches should just call it:

$ ./build/manager/sage-pkg help
usage: sage-pkg [-h] [--config CONFIG] [--log LOG]

{info,shell,list,pkg-upgrade-v1,help,download,unpack,prepare,configure,compile,check,install,build,get}
                 ...

The Sage Package Manager

positional arguments:

{info,shell,list,pkg-upgrade-v1,help,download,unpack,prepare,configure,compile,check,install,build,get}
     info                Print information about package
     shell               IPython shell

:-)  Another (useless?) dependency?

     list                List all packages
     pkg-upgrade-v1      Upgrade package descriptions
     help                Get help
     download            Build package up to the "download" step
     unpack              Build package up to the "unpack" step
     prepare             Build package up to the "prepare" step
     configure           Build package up to the "configure" step
     compile             Build package up to the "compile" step
     check               Build package up to the "check" step
     install             Build package and install
     build               Build everything
     get                 Download tarball/spkg/file

optional arguments:
   -h, --help            show this help message and exit
   --config CONFIG       Builder configuration file
   --log LOG             One of [DEBUG, INFO, ERROR, WARNING, CRITICAL]

Hmmm, 'pkg-upgrade-v1'?

Not immediately clear what the difference between 'get' and 'download' is, nor what 'build' here is supposed to mean.


$ ./build/manager/sage-pkg info matplotlib
Configuration:
- config.builder.install_script = spkg-install
- config.builder.type = SpkgInstallScript
- config.category = standard
- config.depends.build = 'pkgconf', 'setuptools']
- config.depends.hard = ['python', 'numpy', 'freetype', 'libpng',
'gdmodule', 'dateutil', 'pyparsing']
- config.name = matplotlib
- config.source.tarball.name = matplotlib-1.3.1.tar.gz
- config.source.tarball.sha1 = f340378c43c4c3f6219ef9fd84af4ebbe18f8feb
- config.source.version = 1.3.1
Status: up to date
Installed when: 2 hours ago

Curious what the output is when the installed version differs from the (officially) available one...

Do we / can we keep package info files for various versions?


-leif

--
() The ASCII Ribbon Campaign
/\   Help Cure HTML E-Mail

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to