diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..253bcb7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6602f60 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + emacs-version: + - 26.3 + - 27.2 + - 28.2 + - 29.4 + - 30.1 + experimental: [false] + include: + - os: ubuntu-latest + emacs-version: snapshot + experimental: true + - os: macos-latest + emacs-version: snapshot + experimental: true + - os: windows-latest + emacs-version: snapshot + experimental: true + exclude: + - os: macos-latest + emacs-version: 26.3 + - os: macos-latest + emacs-version: 27.2 + + steps: + - uses: actions/checkout@v6 + + - uses: jcs090218/setup-emacs@master + with: + version: ${{ matrix.emacs-version }} + + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' + + - name: Run tests + run: + make ci diff --git a/.gitignore b/.gitignore index 0ef71f7..08dcc82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ *~ .cask/ +.eask/ +/dist +*.elc .vagrant/ + +# OS generated +.DS_Store diff --git a/Eask b/Eask new file mode 100644 index 0000000..6e09991 --- /dev/null +++ b/Eask @@ -0,0 +1,21 @@ +;; -*- mode: eask; lexical-binding: t -*- + +(package "pythonic" + "0.2" + "Utility functions for writing pythonic emacs package") + +(website-url "https://github.com/proofit404/pythonic") +(keywords "convenience" "pythonic") + +(package-file "pythonic.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'gnu) +(source 'melpa) + +(depends-on "emacs" "25.1") +(depends-on "s") +(depends-on "f") + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e92a368 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +EMACS ?= emacs +EASK ?= eask + +.PHONY: clean checkdoc lint package install compile test + +ci: clean package install compile + +package: + @echo "Packaging..." + $(EASK) package + +install: + @echo "Installing..." + $(EASK) install + +compile: + @echo "Compiling..." + $(EASK) compile + +test: + @echo "Testing..." + $(EASK) test ert ./test/*.el + +checkdoc: + @echo "Run checkdoc..." + $(EASK) lint checkdoc + +lint: + @echo "Run package-lint..." + $(EASK) lint package + +clean: + $(EASK) clean all diff --git a/README.markdown b/README.markdown index 4a804eb..40c13b8 100644 --- a/README.markdown +++ b/README.markdown @@ -1,4 +1,9 @@ -# Pythonic [![MELPA](http://www.melpa.org/packages/pythonic-badge.svg)](http://www.melpa.org/#/pythonic) [![MELPA Stable](https://stable.melpa.org/packages/pythonic-badge.svg)](https://stable.melpa.org/#/pythonic) +[![MELPA](https://melpa.org/packages/pythonic-badge.svg)](https://melpa.org/#/pythonic) +[![MELPA Stable](https://stable.melpa.org/packages/pythonic-badge.svg)](https://stable.melpa.org/#/pythonic) + +# Pythonic + +[![CI](https://github.com/pythonic-emacs/pythonic/actions/workflows/test.yml/badge.svg)](https://github.com/pythonic-emacs/pythonic/actions/workflows/test.yml) Utility functions for writing pythonic emacs package. diff --git a/pythonic.el b/pythonic.el index ce796b7..83611aa 100644 --- a/pythonic.el +++ b/pythonic.el @@ -1,11 +1,12 @@ -;;; pythonic.el --- Utility functions for writing pythonic emacs package. -*- lexical-binding: t; -*- +;;; pythonic.el --- Utility functions for writing pythonic emacs package -*- lexical-binding: t; -*- -;; Copyright (C) 2015-2019 by Artem Malyshev +;; Copyright (C) 2015-2021 by Artem Malyshev ;; Author: Artem Malyshev ;; URL: https://github.com/proofit404/pythonic -;; Version: 0.1.1 +;; Version: 0.2 ;; Package-Requires: ((emacs "25.1") (s "1.9") (f "0.17.2")) +;; Keywords: convenience pythonic ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ (defun pythonic-remote-ssh-p () "Determine ssh remote virtual environment." (and (pythonic-remote-p) - (s-equals-p (pythonic-remote-method) "ssh"))) + (member (pythonic-remote-method) '("ssh" "sshx")))) (defun pythonic-remote-vagrant-p () "Determine vagrant remote virtual environment." @@ -132,7 +133,7 @@ Take FILENAME from the perspective of the localhost and translate it to the FILENAME Python process can read. Python can be running locally or remotely. FILENAME can have local or tramp format. Result will have local format." - (let ((alias (pythonic-aliased-path filename))) + (let ((alias (pythonic-aliased-path (expand-file-name filename)))) (if (tramp-tramp-file-p alias) (tramp-file-name-localname (tramp-dissect-file-name alias)) alias))) @@ -295,7 +296,8 @@ process flag." (defun pythonic-activate (virtualenv) "Activate python VIRTUALENV." (interactive "DEnv: ") - (setq python-shell-virtualenv-root (pythonic-python-readable-file-name virtualenv))) + (setq python-shell-virtualenv-root + (and virtualenv (pythonic-python-readable-file-name virtualenv)))) ;;;###autoload (defun pythonic-deactivate ()