Commit graph

265 commits

Author SHA1 Message Date
emacspace
912f69ef9d documentation formatting: Thu Apr 18 19:16:31 UTC 2019 2019-04-18 21:39:10 +02:00
Mike Macpherson
c339656172 python: Add support for black formatter 2019-04-18 18:34:09 +02:00
Trapez Breen
d25b329c17 Shadow python-mode-hook during python-send-shell-* 2019-04-18 17:56:47 +02:00
emacspace
0b90e116f5 documentation formatting: Wed Apr 17 13:48:54 UTC 2019 2019-04-17 23:36:35 -04:00
Trapez Breen
2206095be8 Added instruction on installing importmagic and epc.
Importmagic and epc isn't really optional if error messages are to be avoided.
2019-04-17 09:14:01 +02:00
emacspace
3e97b8e8f3 documentation formatting: Mon Apr 15 20:21:30 UTC 2019 2019-04-15 22:56:31 +02:00
Ivan Yonchovski
59c4f1f283 Use dap mode layer for python debugging
- I had to remove the "db" keybinding manually before setting the dap bindings.
  An alternative approach is to use a different binding for it.
2019-04-15 20:56:27 +02:00
Loys Ollivier
7667df6319 python: add diminish for importmagic
importmangic does not have a diminish character.
Add diminish characters to make the modeline nice(r).

Signed-off-by: Loys Ollivier <loys.ollivier@gmail.com>
2019-04-04 12:33:57 +02:00
rgb-24bit
c2a351cac7 Fix conflict between pipenv directory .venv and pyvenv file .venv 2019-01-20 17:28:43 +02:00
emacspace
8b3a30f240 documentation formatting: Sat Dec 22 11:04:49 UTC 2018 2018-12-22 11:12:10 +00:00
cormacc
c375bc428f Flattened some cquery/ccls configuration
c-c++-lsp-initialization-options:
-> ccls-initialization-options
-> cquery-extra-init-params (cacheFormat set to "msgpack" by default)

c-c++-lsp-args:
-> ccls-args
-> cquery-extra-args

c-c++-lsp-cache-dir:
-> ccls: Appended to initialization-options
-> cquery-cache-dir

<<Amendment 1 21/12/18>>
Removing 'clangd' from list of lsp clients to squash per-file prompt for
language client.
Updated lsp/packages.el to reflect upstream lsp-mode function name changes.
Python layer -- added if guards to prevent anaconda package loading / keyboard
shortcut config when lsp backend selected.
2018-12-22 12:51:17 +02:00
Ivan Yonchovski
f346ae0683 Fix java/python/javascript/rust lsp backends 2018-12-22 12:51:05 +02:00
emacspace
45276bd96f documentation formatting: Wed Dec 5 03:03:03 UTC 2018 2018-12-04 22:06:14 -05:00
duianto
ee811f7b13 Unify packages list parentheses style
problem:
some layer packages lists have the open and closing parentheses on the same line
as the first and last listed package, but most seem to have them on a separate
lines.

solution:
put the open and close parentheses on separate lines, except for lists with only
a single package, they are written on the same line as the variable name and
parentheses.

fix the lists indentation
2018-11-21 21:35:38 +00:00
emacspace
901f35849a documentation fixes: Tue Oct 23 14:18:21 UTC 2018 2018-10-23 23:38:16 +03:00
Boris Buliga
a0db651fc5
mention new python debugging option in readme 2018-10-23 07:18:24 +03:00
boris
554b3d9622
python3.7 comes with a builtin breakpoint() function (PEP 553) 2018-10-23 07:16:38 +03:00
JimmyG
bf2bf86269 anaconda-mode-go-back is replaced with xref-pop-marker-stack 2018-10-20 09:38:32 +03:00
JAremko
cd39f80c24 Reformat documentation 2018-10-11 00:13:43 +03:00
Alexander Eberspächer
77afc63da8 Fix pyenv using system Python
Check the case of "pyenv which" returning "system". In this case, find the
Python executable using default "executable-find".
2018-09-03 20:21:05 +01:00
Benno Fünfstück
03b8f71997 fix typos 2018-08-28 22:37:08 +01:00
Benno Fünfstück
f31bed7f52 python-mode: fix indent offset guessing for tab indentation 2018-08-28 22:37:08 +01:00
Riley Levy
9af8e1564d Fix #1109: Escape argument for shell spacemacs/python-execute-file
Escape the filename before calling python on the filename in the shell in the
function `spacemacs/python-execute-file` by calling `shell-quote-argument`.
2018-08-04 10:51:49 -04:00
EMayej
6f9097e6f0 fix(python): index out of bound 2018-08-04 10:32:31 -04:00
Miciah
6d8be7b381 python: Initialize inferior-python-mode variables
Fix SPC m c c (spacemacs/python-execute-file) and SPC m c C
(spacemacs/python-execute-file-focus), which were causing
the following errors:

    save-current-buffer: Symbol’s value as variable is void: python-shell--interpreter
    error in process filter: python-shell-comint-end-of-output-p: Wrong type argument: arrayp, nil
    error in process filter: Wrong type argument: arrayp, nil

This commit also fixes issue #9070: spacemacs/python-execute-file-focus
does not change focus.

The problem is that spacemacs/python-execute-file-focus invokes
spacemacs/python-execute-file, spacemacs/python-execute-file invokes
inferior-python-mode, and inferior-python-mode uses the variables
python-shell--interpreter and python-shell--interpreter-args, which
the python package declares but does not initialize.

To resolve this problem, this commit initializes both variables to nil.

* layers/+lang/python/config.el: Initialize python-shell--interpreter and
python-shell--interpreter-args to nil.
2018-08-03 06:53:02 +03:00
Guan Xipeng
0c878ae453 fix: spacemacs/pyenv-executable-find support multi pyenv versions 2018-08-01 17:42:44 -04:00
Ting Zhou
e362b17868 polish lsp-python and anaconda-mode 2018-08-01 17:22:36 -04:00
JAremko
6946e255e6 Reformat docs 2018-07-20 02:45:21 +03:00
syl20bnr
adf10d652b Lazy load importmagic 2018-06-11 01:45:48 -04:00
syl20bnr
d48ecea6e6 Lazy load anaconda-mode 2018-06-11 01:41:22 -04:00
syl20bnr
49b1659a18 Lazy load lsp-mode 2018-06-11 00:28:11 -04:00
bmag
50621c93af python: conditionally remove binding to obsolete keymap
Using a conditional instead of removing entirely since anaconda-mode code has
been in some flux recently. If the keymap stays obsolete when the dust settles
we can remove this block.
2018-06-03 20:19:19 +03:00
Miciah Dashiel Butler Masters
78297be625 Fix various typos
* Fix various isolated typos

"apppend" -> "append"

"availabe" -> "available"

"Descripti using ternon" -> "Description"

"you have not them" -> "you don't have them"

"new on" -> "new one"

"plained" -> "curved"

"repel" -> "REPL"

"vairable" -> "variable"

* Fix a few errors in the CoffeeScript layer readme

Add a missing "the".

Correct a reference to the layer as "javascript" to "coffeescript".

Fix the syntax on the link to CoffeeLint.

* Fix typos: "dofile" -> "dotfile"

* Fix typos: "formated" and "formating"

"formated" -> "formatted"

"formating" -> "formatting"

* hy: Fix docstrings in funcs.el

Fix copy-and-pasted docstring text for
spacemacs/hy-shell-eval-current-form-and-go and
spacemacs/hy-shell-eval-region-and-go.

* Fix typos: "indendation" -> "indentation"

* Fix typos: "the the", "a a"

Fix duplicated (or misplaced) articles.

* Fix typos: "wether" -> "whether"

* Fix typos: "intialize" -> "initialize"
2018-05-23 22:12:30 -04:00
syl20bnr
7d19ba1711 python: fix missing t with :call-hooks keyword 2018-05-23 22:11:10 -04:00
Brandon T. Willard
f069f9992d Fix pyvenv pre-init defun and package names; adjust hy-mode prefixes. 2018-05-21 01:18:37 -04:00
syl20bnr
ea8991ac90 New layer Hy extracted from Python layer 2018-05-20 03:06:25 -04:00
syl20bnr
9f6b45223f python: put smartparens advice in a post-config use-package hook 2018-05-20 00:24:29 -04:00
Nikita Leshenko
b3743701db python: smartparens: Fix bytecomp warning (#10582)
The byte compiler doesn't know about `smartparens-strict-mode' because
smartparens is lazy loaded, so wrap the variable reference in `bound-and-true-p'
to silence a warning that appears on Spacemacs startup.

To reproduce:
1. Install a fresh Spacemacs from develop branch
2. Use spacemacs-base distribution
3. Select only these configuration layers: spacemacs-editing python
4. Restart Emacs to install packages
5. Restart Emacs again and observe warning:
   Warning (bytecomp): reference to free variable 'smartparens-strict-mode'
2018-05-20 00:22:44 -04:00
syl20bnr
996cc91b5d python: fix company when opening a buffer for the 1st time
fixes #https://github.com/syl20bnr/spacemacs/issues/10638
2018-05-13 12:39:52 -04:00
Codruț Constantin Gușoi
775fb50f9f Fixes TOC formatting for python layer 2018-05-09 01:19:21 +03:00
JAremko
d4017b1ca7 Make sure that docs pass formatting cheques. 2018-04-15 22:16:17 +03:00
syl20bnr
ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
syl20bnr
29c78ce841 Defer packages by default using use-package-always-defer
Warning now `:defer t` is implied, to force a package to load `:demand t` is
now necessary.
2018-02-27 23:32:52 -05:00
syl20bnr
1e6a0a66c0 python: group backend packages 2018-02-27 23:32:52 -05:00
Dan Girshovich
a141c9adff Add support for breakpoints for the trepan3k python debugger 2018-02-24 19:49:39 -05:00
syl20bnr
920a6f6075 python: sort key bindings 2018-02-24 19:49:39 -05:00
Jack Kamm
8f79abc7f3 python: add pipenv. unified prefix for pyenv, pyvenv, pipenv 2018-02-24 19:49:39 -05:00
syl20bnr
e99ca55e13 python: add doc for SPC m t l 2018-02-24 19:49:39 -05:00
Benoit Coste
262c8ee7b0 Add defun spacemacs/python-test-last
It is a wrapper around the nosetests-again defun.
It will call the latest called nosetest function.
2018-02-24 19:49:39 -05:00
syl20bnr
81a931f48b python: add support for Language Server Protocol 2018-02-19 00:08:27 -05:00
JAremko
d2c3b847d8 doc fmt 2018-01-27 16:57:39 +02:00
Shitikanth Kashyap
6e0d38f3ea pylookup: Clear self.tag on endtag 2018-01-17 23:23:59 -05:00
Shitikanth Kashyap
480c8531b3 pylookup: Add "/genindex/" to potential_urls
Used in online documentation of libraries Flask and Requests.

http://flask.pocoo.org/docs/0.12/genindex/
docs.python-requests.org/en/master/genindex/
2018-01-17 23:23:47 -05:00
Shitikanth Kashyap
23e582d121 pylookup: Switch to using urllib2 on Python 2
Fixes bug: pylookup fails silently on 404. For instance, on
`./pylookup -u https://matplotlib.org/` it first looks up
'https://matplotlib.org/genindex-all.html', gets a 404 response,
but instead of moving to the next candidate url, it builds an empty
index.

Cause of bug: urllib.urlopen doesn't give an error on 404.
2018-01-17 23:23:25 -05:00
Shitikanth Kashyap
48032ca787 pylookup: Use generic tags to detect list levels.
This fixes bug #9866.

Tested to work with documentation of Python 2.6, Python 2.7, Python 3.4,
Python 3.5, Python 3.6, and latest stable releases for SciPy, NumPy,
Matplotlib, and Flask.
2018-01-17 23:23:14 -05:00
Shitikanth Kashyap
a3d8df9244 pylookup: Set one_entry to false after each element
Fix for bug: extraneous links registered for last entry
in index. For instance, for python documentation index,
all links in footer would get attached to `zlib`.
2018-01-17 23:23:04 -05:00
Shitikanth Kashyap
01e588c5f0 pylookup: Remove unused field do_entry 2018-01-17 23:22:52 -05:00
Shitikanth Kashyap
86f7213b65 pylookup: Handle end tag logic in handle_endtag
Doing it handle_data was a bug because `self.tag`
would contain the most recent opened tag, not the tag
currently being closed. This meant, for instance, that
the elements were not being generated correctly and
"./pylook.py --cache" was broken.
2018-01-17 23:22:39 -05:00
Shitikanth Kashyap
dbe5bb4893 pylookup: Use HTMLParser instead of htmllib
htmllib has been deprecated since PEP 3108.
2018-01-17 23:22:19 -05:00
syl20bnr
2c16d19ab7 semantic: make it possible to exclude stickyfunc 2018-01-17 23:03:33 -05:00
Hans Jang
d35268a1d6 Fix the broken python repl invocation through SPC a '
Without this chage, it ends up with the following error:
  'Wrong type argument: commandp, python-start-or-switch-repl'
2018-01-06 00:59:29 -05:00
syl20bnr
eee2b4b89c python: document pippel and set key binding to SPC m P 2018-01-05 22:15:50 -05:00
James Wang
0a4f257da0 Add pippel for python package management 2018-01-05 21:54:41 -05:00
Christoph Paulik
17d350b585 Python: Fix pyenv-executable-find in presence of pyenv-which-ext. 2018-01-05 21:48:04 -05:00
Shane Pearlman
2f2ed06b0e Use python-mode for SCons script files 2018-01-05 21:46:52 -05:00
syl20bnr
302d272ae3 python: sort key bindings in doc and package config 2018-01-05 21:45:57 -05:00
Volodymyr Vitvitskyi
b63039a6a4 Support importmagic in the Python layer
Problem
-------
If the symbol is not resolved due to a missing import there is no automatic way
in the Python layer to import it.

Solution
--------
Use 'importmagic' package.

Pressing `SPC m r f` at point that requires an import will suggest a list of
possible options.
2018-01-05 21:44:11 -05:00
syl20bnr
6a345b86a0 python: document python-save-before-test 2018-01-05 21:41:26 -05:00
Benoit Coste
3f01fd5fed Add defvar python-save-before-test
If true, buffer is automatically saved when calling
python-test-* functions
2018-01-05 21:38:28 -05:00
lostmarble
572820e618 Update funcs.el
fix python/:init: Invalid version syntax: '5.1.0^M' bug, for "ipython --version" will return '5.1.0\r\n' on windows with Anaconda3
2018-01-05 21:37:08 -05:00
Muneeb Shaikh
ef36bdfb06 python: update anaconda-mode view mode variable names
Fix #10047
2018-01-05 21:37:03 -05:00
Muneeb Shaikh
3289e0d114 python: update invalid cython mode keybindings 2018-01-05 21:35:58 -05:00
syl20bnr
326965d4ce Happy New Year 2018! 2018-01-04 02:00:25 -05:00
Robbert van der Helm
c61ae1a1c1 Add ivy support to the gtags layer
It would be much better to have a single function for each layer that
initializes ggtags, helm-gtags and counsel-gtags for a mode.
2017-12-17 22:03:01 -05:00
wizmer
2531012319 Make nose fail compilation when tests fail
Using nose.main instead of nose.run returns the result of the tests
so the status of the *compilation* buffer can be modified accordingly
2017-10-15 11:08:01 -04:00
CeleritasCelery
e32acfbf3b Fixed feature header 2017-08-29 20:00:44 +03:00
syl20bnr
2e8412323c python: move functions to funcs.el 2017-08-28 10:44:58 -04:00
JAremko
06301b2212 Improve exporting/testing 2017-08-18 20:50:21 +03:00
Eivind Fonn
f4b53d2a4f Rename :depends to :requires 2017-07-03 09:54:53 +02:00
syl20bnr
e2e532bb49 core: change <function>p to <function>-p suffixes for consistency
Also defined aliases for backward compatibility with `usedp` functions.
2017-07-02 10:09:39 -04:00
Eivind Fonn
08561d8631 core: implement :depends for package declarations
This replaces the older pattern
:toggle (configuration-layer/package-usedp ..)

This implementation ensures that :disabled-for honors dependent packages, i.e.
if package a depends on package b, which is owned by layer c, and layer c is
disabled for layer d, then neither package a nor b will be configured for layer
d. Previously, this was only true for package a, but not b.

This commit also fixes:

- configuration-layer/describe-package now shows which post-init and pre-init
  functions are disabled, if any
- Does not recreate all layer objects unconditionally when calling
  configuration-layer/discover-layers. Previously, this led to all layers being
  recreated after e.g. `SPC h SPC`, without any of the dotfile information.
  Since this information is now necessary for
  configuration-layer/describe-package, it’s important that we don’t clear the
  indexed layers when invoking this function.
2017-06-22 11:53:05 +02:00
Eivind Fonn
bcb597a329 python doc: Reformulate jedi warning 2017-06-12 12:38:27 +02:00
davidpham87
f6b2c90260 Autocompletion debug
Autcompletion does not handle request properly with jedi 1.0. Until the bug is corrected, one should keep the 0.9 version.
2017-06-12 12:37:04 +02:00
Danny Freeman
6bf310f572 Updated hy-mode lisp eval keys to match spacemacs conventions
Updated to match the conventions listed here:
https://github.com/syl20bnr/spacemacs/blob/develop/doc/CONVENTIONS.org#evaluation

Now functions related to lisp evaluation start with 'SPC m e' and functions
related to the hy repl start with 'SPC m e'.
2017-06-08 09:14:02 +02:00
Eivind Fonn
55ceef53a5 bugfix: arguments to python-setup-hy 2017-06-07 16:28:03 +02:00
Eivind Fonn
ed90f2b4ff Bugfixes
- Set hy-mode-inferior-lisp-command globally
- Function names
2017-06-07 12:43:58 +02:00
Eivind Fonn
16f25488a9 Clean up python/hy pyenv/pyvenv integration
- Move find-hy-executable to funcs.el and rename
- Don’t set hy-executable (not needed by anything)
- Setup hy only once at startup (allow user to override settings, see #5988)
- Use setup-hy in advice instead of post-activate-hook (works with many more
  commands)
- Setup checkers pyenv change, too
- Guard checker setup function for possibly missing flycheck
- Combine all setup functions into one
2017-06-07 12:40:30 +02:00
Danny Freeman
5a7019427e Fixed bug so hy command work when hy is installed on a virtualenv
Hy is typically installed on a python virtual environment, not globally. When
that is the case, init-hy-mode doesn't set any leader keys for hy since it
can't find the hy executable on the path. When a virtual environment is
activated, init-hy-mode is run again to see if it can find a hy executable
and setup the leader keys for hy.
2017-06-07 12:28:48 +02:00
Swaroop C H
a2f1bfa8a4 [python] Prefer virtualenv python to compile file 2017-05-29 10:12:20 -07:00
Eivind Fonn
97862af26c Trim output from pyenv command
Trailing newlines will cause errors
2017-05-28 14:59:34 +02:00
Muneeb Shaikh
47cb3e01e0 python: fixes for anaconda-mode-view-mode
* layers/+lang/python/funcs.el (spacemacs/anaconda-view-forward-and-push):
  Added helper function to go forward and hit RET
* layers/+lang/python/packages.el (python/init-anaconda-mode):
   - use new evilification macro
   - use helper function to go ahead and push button when hitting `RET`
   - Add `C-j`, `C-k` for easy navigation in anaconda-view-mode when multiple
   references are displayed. Doesn't conflict with normal `hjkl` navigation in
   other views of `anaconda-view-mode`

Fix #7538
Fix #5737
2017-05-24 13:58:23 +02:00
Swaroop C H
ea54e6863e Make python-execute-file use python-shell-interpreter
So that we can customize to use `python3` instead of `python`
2017-05-24 13:41:12 +02:00
Alexey Kotlyarov
f27568d8f9 Python: Highlight wdb breakpoints as well as pdb/ipdb/pudb 2017-05-24 12:44:57 +02:00
Alexey Kotlyarov
dc3f16b840 Python: search for Pylint and Flake8 in the virtualenvs 2017-05-24 12:44:19 +02:00
Kristoffer Haugsbakk
79ed1a6b4b Use proper markup for code in readmes
By convention, code markup (`~`) is reserved for keybindings in Org-based
documentation in Spacemacs.  Verbatim markup (`=`) is reserved for code and
other code-like things.  So change several readmes to reflect this convention.

Use verbatim markup for things like (non-exhaustive list):

- Emacs Lisp functions, modes, buffers, etc.
- Environment variables
- Directory paths
- Code in general
2017-05-24 11:57:17 +02:00
Rand01ph
c71d482012 fix python layers anaconda-mode requirements 404
the anaconda-mode requirements has change to wiki
2017-05-24 10:04:33 +02:00
JAremko
6c5a0b2b14 update docs to the new toc-org format 2017-05-22 18:35:37 +03:00
Wieland Hoffmann
4c009f4721 Use verbatim markup for the flake8 package name 2017-05-14 22:07:21 -04:00
JAremko
f805d0ebd9 Fix spacefmt test on deleted files
Also fix some links
[ci skip]
2017-04-28 23:29:43 -04:00
Pedro Algarvio
9c226d8201 .python-version can contain more than one version specified.
https://github.com/yyuu/pyenv/blob/master/COMMANDS.md#pyenv-local-advanced
2017-04-17 22:31:50 -04:00