Git Product home page Git Product logo

epl's Introduction

Cask

https://github.com/cask/cask/actions/workflows/test.yml/badge.svg

Cask can be likened to venv or maven for Emacs Lisp development, although, as with all things emacs, is decidedly less sophisticated (but no less arcane).

Cask provisions dependencies within a sandbox via a user-defined “Cask” file analogous to requirements-dev.txt or pom.xml.

Cask does not absolve you of having to learn emacs’s command flags. Cask only constructs the sandbox, one for each version of emacs you choose to test.

Installation

git clone https://github.com/cask/cask
make -C cask install

Not-so-quick start

With just this baseline “Cask” file, you can run most of the commands described in http://cask.readthedocs.io.

(source gnu)
(source melpa)

(package-file "your-main-file.el")

The EMACS environment variable governs which emacs binary to test. For example, the following runs ert tests under an older emacs:

EMACS=emacs-25.3 cask emacs --batch -l mytest.el -f ert-run-tests-batch

We have deprecated the cask exec invocation, and consequently no longer recommend cask exec ert-runner nor cask exec ecukes .

Typical Makefile Usage

Egregious boilerplate follows:

export EMACS ?= $(shell command -v emacs 2>/dev/null)
CASK_DIR := $(shell cask package-directory)

$(CASK_DIR): Cask
	cask install
	@touch $(CASK_DIR)

.PHONY: cask
cask: $(CASK_DIR)

.PHONY: compile
compile: cask
	cask emacs -batch -L . -L test \
          --eval "(setq byte-compile-error-on-warn t)" \
	  -f batch-byte-compile $$(cask files); \
	  (ret=$$? ; cask clean-elc && exit $$ret)

.PHONY: test
test: compile
	cask emacs --batch -L . -L test -l readme-test -f ert-run-tests-batch

Typical CI Usage

Cask, in conjunction with setup-emacs, is commonly used in Github Actions. Egregious boilerplate follows:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        emacs-version:
          - 26.3
          - 27.2
          - 28.2
          - 29.2
    steps:
      - uses: actions/checkout@v2
      - uses: purcell/setup-emacs@master
        with:
          version: ${{ matrix.emacs-version }}
      - uses: actions/cache@v2
        id: cache-cask-packages
        with:
          path: .cask
          key: cache-cask-packages-000
      - uses: actions/cache@v2
        id: cache-cask-executable
        with:
          path: ~/.cask
          key: cache-cask-executable-000
      - uses: cask/setup-cask@master
        if: steps.cache-cask-executable.outputs.cache-hit != 'true'
        with:
          version: snapshot
      - run: echo "$HOME/.cask/bin" >> $GITHUB_PATH

Frequently Asked Questions

Why does this shit never work?
Bitrot and weak hacks, primarily. Always try rm -rf ~/.emacs.d/.cask since we’re liable to make backwards-incompatible changes.
Why does this utterly fail on Windows?
If you use emacs on Windows, you’re not doing it right. But for a sufficiently motivated Powershell bro, it would not be hard to finesse the Makefile for a typical Windows environment.
Why does install “not know where to install”?
After assaying cross-platform schemes like systemd-path and XDG_DATA_HOME to figure out a suitable install directory, Cask resorts to the old, unspoken standbys of ~/.local/bin and ~/bin. If neither of those are present, then make install gives up with that error. I couldn’t determine a more standard method last I asked stackoverflow.com. To fix this error, you can manually specify the install directory like this - DESTDIR="$HOME/path/to/install/dir" make install.
Why is everything you say inconsistent with cask.readthedocs.io?
I would disregard nearly everything at cask.readthedocs.io, especially the Quickstart page. In particular, I would not require cask in your dot.emacs since cask is now largely a command-line tool independent of whatever you do within emacs. If you are calling cask-initialize in your dot.emacs or harken back to the bygone era of pallet, I’m afraid you’re on your own.
Doesn’t Cask make things more complicated?
Yes, because it forces you to test your package under multiple versions of emacs. Most packages don’t do any testing at all, which is why emacs has lost credibility with the computing public.

epl's People

Contributors

fanael avatar marsam avatar rejeep avatar ryantm avatar sambrightman avatar silex avatar swsnr avatar tarsius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

epl's Issues

Support package-archive-priorities

Hello,

@fommil at Silex/package-utils#4 reported an issue that I think is in fact an epl issue 😉

Basically, epl-find-upgrades (and thus epl-upgrade) ignores package-archive-priorities and always finds the latest version from all archives.

It apparently has the effect that upgrading packages through epl has not the same effect as upgrading packages from package-list-package.

That being said, I'm not entirely sure my description above is accurate, but it's what it feels like.

If you point me to the right direction I can make a PR.

Create packages from TARs and package descriptors

EPL should provide means to create epl-package objects from TARs and package descriptor files (i.e. foo-pkg.el).

The former should be part of epl-package-from-file, and the latter should live in a separate function, e.g. epl-package-parse-descriptor.

Delete package function does not update package alist

In Emacs Snapshot, the deleted package is removed from package-alist using:

;; Update package-alist.
(let* ((name (package-desc-name pkg-desc))
       (pkgs (assq name package-alist)))
  (delete pkg-desc pkgs)
  (unless (cdr pkgs)
    (setq package-alist (delq pkgs package-alist))))

The package-alist is however not updated in older versions of Emacs, such as 24.3.1.

What do you say about adding the above snippet to the legacy version?

Error on epl-upgrade

Running epl-upgrade results in an error(MELPA repo, Emacs 24.3):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`https?:" nil)
  package-download-tar(web-mode "20131007.2108")
  package-download-transaction((web-mode))
  package-install(web-mode)
  epl-package-install([cl-struct-epl-package web-mode [(20131007 2108) nil "major mode for editing html templates [github]" tar "melpa"]])
  epl-upgrade()
  eval((epl-upgrade) nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  ad-Orig-call-interactively(eval-last-sexp nil nil)
  call-interactively(eval-last-sexp nil nil)

Vagrantify :)

Setup Vagrant to create a local virtual machine to test against all supported Emacs versions. Use the same provisioning script as on Travis CI.

Epl install file

package.el has a function called package-install-file, which does not exist in Epl. Looking at the source of package-install-file it's an interactive function, so I wonder if we should use that directly with a simple alias or if we should write it from scratch using non interactive functions in package.el.

Thoughts?

Epl find available packages broken on snapshot

@lunaryorn,

It seems that epl-find-available-packages behaves differently on 24.3.1 and 24.3.50.1.

In 24.3.50.1, if you have installed a package with the most recent version available, then it will not be added to package-archive-contents when you call (package-refresh-contents). The function epl-find-available-packages checks if the package is in package-archive-contents, which it might not be.

Here's some code to reproduce the issue:

(let ((flycheck (assq 'flycheck package-alist)))
  (let (package-alist package-archive-contents)
    (push flycheck package-alist)
    (package-refresh-contents)
    (print (format "in package-alist: %s"
                   (not (not (assq 'flycheck package-alist)))))
    (print (format "in package-archive-contents: %s"
                   (not (not (assq 'flycheck package-archive-contents)))))))

The package is however available in package-alist. What we could do is that we extend epl-find-available-packages so that it first checks package-archive-contents and then package-alist.

What do you think?

Wrong type argument arrayp

This happens with latest EPL:

Debugger entered--Lisp error: (wrong-type-argument arrayp f)
  epl-package--package-desc-p(f)
  epl-package-install(f)

I will look at this later. @lunaryorn is this is an issue for trunk as well?

(we really need some tests...)

Package requirements recursively

In Cask, we need a function that returns a package's requirements recursively. Either we add a new function or we extend epl-package-requirements to take a second optional recusive argument.

I've looked a bit at what package.el provides us with. In snapshot, we could probably use package-compute-transaction, but this does not exist in stable Emacs. Perhaps there's some other function we could use there?

But it seems to me that it's quite easy to write this function ourself.

@lunaryorn What do you think about this?

Reflux Issue 7 -- EPL Upgrade

[see https://github.com//issues/7]

Just attempted a clean install of Cider

  • emacs 24.3.1
  • Fedora 19 64-bit

As per @lunaryorn comment:
@cch1 @davidboles Unlikely. This issue has been fixed months ago. EPL does not clear package-archives anymore.
Please provide more details, including tracebacks. Ideally, open a new issue.

--- Warnings 
Warning (emacs): Unable to activate package `pkg-info'.
Required package `dash-1.6.0' is unavailable

--- Compile Log
Leaving directory `/home/mark/.emacs.d/elpa/epl-20140211.524'

Compiling file /home/mark/.emacs.d/elpa/epl-20140211.524/epl-pkg.el at Wed Feb 19 15:01:51 2014
Entering directory `/home/mark/.emacs.d/elpa/epl-20140211.524/'

Compiling file /home/mark/.emacs.d/elpa/epl-20140211.524/epl.el at Wed Feb 19 15:01:51 2014

Compiling no file at Wed Feb 19 15:01:52 2014
Leaving directory `/home/mark/.emacs.d/elpa/pkg-info-20131101.408'

Compiling file /home/mark/.emacs.d/elpa/pkg-info-20131101.408/pkg-info-pkg.el at Wed Feb 19 15:01:52 2014
Entering directory `/home/mark/.emacs.d/elpa/pkg-info-20131101.408/'

Compiling file /home/mark/.emacs.d/elpa/pkg-info-20131101.408/pkg-info.el at Wed Feb 19 15:01:52 2014
pkg-info.el:48:1:Error: Cannot open load file: dash

Compiling no file at Wed Feb 19 15:01:53 2014
Leaving directory `/home/mark/.emacs.d/elpa/dash-20140214.321'

Compiling file /home/mark/.emacs.d/elpa/dash-20140214.321/dash-pkg.el at Wed Feb 19 15:01:53 2014
Entering directory `/home/mark/.emacs.d/elpa/dash-20140214.321/'

Compiling file /home/mark/.emacs.d/elpa/dash-20140214.321/dash.el at Wed Feb 19 15:01:53 2014

Compiling no file at Wed Feb 19 15:01:54 2014
Leaving directory `/home/mark/.emacs.d/elpa/clojure-mode-20140201.649'

Compiling file /home/mark/.emacs.d/elpa/clojure-mode-20140201.649/clojure-mode-pkg.el at Wed Feb 19 15:01:54 2014
Entering directory `/home/mark/.emacs.d/elpa/clojure-mode-20140201.649/'

Compiling file /home/mark/.emacs.d/elpa/clojure-mode-20140201.649/clojure-mode.el at Wed Feb 19 15:01:54 2014

Compiling no file at Wed Feb 19 15:01:57 2014
Leaving directory `/home/mark/.emacs.d/elpa/cider-20140211.2319'

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-client.el at Wed Feb 19 15:01:57 2014
Entering directory `/home/mark/.emacs.d/elpa/cider-20140211.2319/'

In end of data:
cider-client.el:173:1:Warning: the following functions are not known to be defined:
    cider-eval-ns-form, cider-load-file-handler,
    cider-interrupt-handler

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-eldoc.el at Wed Feb 19 15:01:57 2014

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-interaction.el at Wed Feb 19 15:01:57 2014
cider-interaction.el:90:1:Warning: defcustom for
    `cider-prompt-save-file-on-load' fails to specify containing group
cider-interaction.el:90:1:Warning: defcustom for
    `cider-prompt-save-file-on-load' fails to specify containing group

In cider-default-err-handler:
cider-interaction.el:764:18:Warning: reference to free variable
    `cider-repl-popup-stacktraces'

In cider-insert-in-repl:
cider-interaction.el:1038:13:Warning: reference to free variable `arg'

In end of data:
cider-interaction.el:1329:1:Warning: the following functions are not known to be defined:
    cider-repl-set-ns, cider-find-or-create-repl-buffer,
    cider-repl-clear-buffer, cider-repl-emit-result,
    cider-repl-emit-output, cider-repl-emit-interactive-output,
    cider-repl-return, cider-repl--replace-input

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-macroexpansion.el at Wed Feb 19 15:01:57 2014

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-mode.el at Wed Feb 19 15:01:58 2014

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-pkg.el at Wed Feb 19 15:01:58 2014

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-repl.el at Wed Feb 19 15:01:58 2014
cider-repl.el:39:1:Error: Cannot open load file: pkg-info

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-selector.el at Wed Feb 19 15:01:58 2014
cider-selector.el:35:1:Error: Cannot open load file: pkg-info

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider-util.el at Wed Feb 19 15:01:58 2014

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/cider.el at Wed Feb 19 15:01:58 2014
cider.el:60:1:Error: Cannot open load file: pkg-info

Compiling file /home/mark/.emacs.d/elpa/cider-20140211.2319/nrepl-client.el at Wed Feb 19 15:01:58 2014

In end of data:
nrepl-client.el:874:1:Warning: the following functions are not known to be defined:
    cider-repl-emit-interactive-output, cider-make-repl

Possible conflict with built-in package.el

There's a version of package.el that's bundled with EPL and compiling that package-legacy.el overrides the functions definitions from package.el (or a least the byte compiler seems to think so, since that file is not yet loaded):

In package-untar-buffer:
package-legacy.el:582:8:Warning: function package-untar-buffer used to take 1
    argument, now takes 0

In package-refresh-contents:
package-legacy.el:1075:28:Warning: `condition-case-no-debug' is an obsolete
    alias (as of 24.1); use `condition-case-unless-debug' instead.

In package-menu-describe-package:
package-legacy.el:1385:8:Warning: function package-menu-describe-package used
    to take 0-1 arguments, now takes 0

Not sure if that's a real problem, but distributing an old package.el seems like a recipe for problems :-) I guess you do it for compatibility with Emacs 23?

Byte compilation error

I got this error while installing the latest version from MELPA:

Compiling file /Users/bozhidar/.emacs.d/elpa/epl-20130914.1604/epl.el at Fri Sep 27 14:50:33 2013
epl.el:105:1:Error: Symbol's function definition is void: epl-error

Documentation on what epl adds/replaces?

I'm curious if there's anywhere that I can learn more about the advantages of epl over current package.el, especially given the emergence of systems like straight and use-package.
Thanks in advance!

Invalid package requires error handling

Calling epl-package-from-file on a file with an invalid Package-Requires header, for example

;; Package-Requires: ((s "1.7.0") (dash "2.2.0")

will result in the error End of file during parsing. This error can be very difficult to track in packages using EPL.

I suggest handling the error in EPL and raise a proper error in such case.

See cask/cask#284

Changing package dir initializes the default elpa dir

Is there any reason that the function epl-change-package-dir calls epl-initialize? If you call epl-reset, this will initialize in the default elpa dir, which is not what I want.

Is there any reason it works like that or can it be removed?

Epl sandbox

Hey,

I want to be able to perform a "package.el task" for a project and then switch back to the current state. For example:

(epl-sandbox
 (epl-change-package-dir "/path/to")
 (epl-package-install 'foo))

The main reason for this is in Cask so that functions won't affect the global package.el state.

What do you think?

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.