Commit Graph

219 Commits

Author SHA1 Message Date
a39a5c24af refactor(python): remove local conda.el fix
These were upstreamed.

Ref: necaris/conda.el@3c6d3c2022
Revert: 8f60a1bc46
Amend: b126c3857d
2025-04-08 18:14:10 -04:00
52c385c033 refactor!(python): remove anaconda-mode
BREAKING CHANGE: This removes company and non-LSP integration from the
Python module, in order to reduce the complexity of the module, reduce
dependencies on Company, and lean more on LSP, which provides these
features with more reliability and consistency. Switch to :tools lsp and
install a Python LSP client to get these features back.
2025-04-01 17:58:13 -04:00
117d9127f3 fix(python): stop anaconda-eldoc-mode when lsp server launches
this needed a fix in anaconda-mode to not also stop eldoc-mode in
general.

ref: pythonic-emacs/anaconda-mode#440
2025-03-13 01:00:36 -04:00
a211332796 fix(python): invalid command for basedpyright
`lsp-pyright-langserver-command` does not recognize a full path, only
"pyright" or "basedpyright".

Fix: #8160
Close: #8161
2024-11-19 16:50:28 -05:00
448bc5cae2 refactor: use negated flags
Ref: 7a806521a92c
2024-10-20 02:41:50 -04:00
397d149313 fix(python): renamed python-pytest commands
These two commands were renamed upstream and pulled in in 1fa1eba:

- python-pytest-function-dwim -> python-pytest-run-def-or-class-at-point
- python-pytest-function-dwim -> python-pytest-run-def-or-class-at-point-dwim

Amend: 1fa1eba5ac
Ref: wbolster/emacs-python-pytest#75
2024-10-03 00:39:55 -04:00
005831bfcc refactor(lsp): let lsp-mode load lsp client packages
Most of these lsp packages are already in `lsp-client-packages`, which
lsp-mode will eagerly load the first time `lsp-mode` is activated, so we
don't need to do it ourselves, except in cases where the package isn't
in `lsp-client-packages` (like lsp-julia).
2024-09-09 17:24:45 -04:00
01c19094e8 fix(python): type error if conda-anaconda-home is unset
Amend: 8f60a1bc46
2024-09-09 14:39:44 -04:00
1fa1eba5ac bump: :lang python
emacs-lsp/lsp-pyright@cc6df06aea -> emacs-lsp/lsp-pyright@0c0d72aedd
necaris/conda.el@60e14d1e97 -> necaris/conda.el@ce748a53f9
pythonic-emacs/anaconda-mode@79fa9b4d2b -> pythonic-emacs/anaconda-mode@f900bd7656
pythonic-emacs/company-anaconda@1fe526163c -> pythonic-emacs/company-anaconda@169252fca7
pythonic-emacs/pyenv-mode@de0d750b9c -> pythonic-emacs/pyenv-mode@76787ea44f
wbolster/emacs-python-pytest@9f850e22df -> wbolster/emacs-python-pytest@dcdaec6fe2

- Adds basedpyright support to lsp-pyright; and will prioritize it above
  pyright, if found on your system.

Ref: emacs-lsp/lsp-pyright#101
2024-09-05 15:30:22 -04:00
d6bc2b0f19 fix(python): respect $ANACONDA_HOME
Amend: 8f60a1bc46
2024-09-02 01:10:58 -04:00
8f60a1bc46 fix(python): type error on loading conda.el
When conda.el evaluates `conda-anaconda-home's initial value, and none
of `conda-home-candidates` exist on the user's system, `nil` will be
passed to `expand-file-name`, which requires a string argument, thus
throwing a type error, so we've got to set `conda-anaconda-home` to nil
to prevent it, then reinvent the wheel later.

This should be resolved upstream, but conda.el hasn't been updated in
some time...

Fix: #7283
2024-09-02 01:05:53 -04:00
6e19452f74 fix(python): missing labels for keybind prefixes
Use the `(PREFIX . DESCRIPTION)` syntax for the python mode map.
2024-07-08 01:33:28 -04:00
934141a01e refactor!(python): remove lsp-python-ms
BREAKING CHANGE: This removes the lsp-python-ms package (along with it,
lsp-python-ms support), since the package no longer works in recent
versions of Python and is no longer maintained upstream.
2024-07-05 18:05:15 -04:00
5da8304c46 fix(python): wrong-number-of-args error for eglot users
eglot-server-initialized-hook passes one argument to its hooks.

Amend: d14ddbf694
Ref: #7823
2024-07-01 03:35:35 -04:00
d14ddbf694 fix(python): ensure anaconda-mode and +lsp are mutually exclusive
I'm considering removing anaconda entirely from the module (to lean on
LSP), but for the time being, this should help with anaconda taking over
ine eglot-enabled buffers.

Fix: #7823
2024-06-30 15:07:42 -04:00
4696f0d4ce tweak(syntax): feat gate flycheck in all modules 2023-07-25 00:11:09 +01:00
a18ea683d2 refactor(python): autoload syntax highlighter fix for 28.1
A summary of the issue:
- emacs-mirror/emacs@c44908c059 broke syntax highlighting for
  python-mode.
- emacs-mirror/emacs@a8acb9516e fixes the issue shortly after, but the
  fix did not make it into the 28.1 release (but made it into 28.2).
- This fix was deployed in #6414 (773122f1ec).
- This commit ensures the fix is only effective for 28.1 users, and
  documents it for posterity.

Ref: #6414
Ref: emacs-mirror/emacs@c44908c059
Ref: emacs-mirror/emacs@a8acb9516e
Amend: 773122f1ec
Co-authored-by: dani84bs <dani84bs@users.noreply.github.com>
2022-09-16 01:14:20 +02:00
aa54383b5d refactor: deprecate doom-etc-dir for doom-data-dir
doom-etc-dir will be renamed to doom-data-dir, to better reflect its
purpose, and align it with XDG_DATA_HOME (where it will be moved to in
v3, where Doom will begin to obey XDG directory conventions more
closely).
2022-08-14 20:43:35 +02:00
ad6a3d0f33 refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
3239ab8b2e nit(mu4e): neutralize comments
Some of our comments/docs can come off as disparaging or snide. They're
glimpses of unfiltered frustration or snarky rubber ducking gone too
far, something I can totally sympathize with, as a scatterbrained
tinkerer, unwittingly made responsible for a lot of work that isn't mine
because of Doom's position as a middleman. But now that Doom has a
veritable userbase, I'd like to hold it to a higher standard.

Light-hearted banter and aired grievances in our source code,
documentation, or community are fine if focused on the problem or the
personal/shared experiences of the community (things that offer value or
amusement to others), but it is never acceptable to attack people or
their efforts. Especially not the very people on whose shoulders Doom
stands.

I sincerely apologize if these have offended you.

Amend: b07614037f
2022-08-14 20:36:42 +02:00
a70e634ebd refactor(:lang): move tree-sitter init
Moved add-hook calls (for tree-sitter initialization) into their
respective modes' config blocks, or nearby, to be consistent with how
other, similar tools (like lsp!) are initialized, and does so at
runtime, rather than at expansion/compile time, which eval-when! caused.
2022-07-25 17:34:44 +02:00
3b3857d57a fix(python): conflicting pyimport-remove-unused keybind
Binding for `pyimport-remove-unused` clashes with `py-isort-region`
2022-07-23 16:00:40 +02:00
773122f1ec fix(python): syntax highlighting in 28.1
Python syntax highlighting was broken in the 28.1 release.

Close: #6414
Co-authored-by: dani84bs <dani84bs@users.noreply.github.com>
2022-06-21 14:32:13 +02:00
7f814e5d99 refactor(:lang): redo tree-sitter hooks
- bind to major-mode-local-vars-hook instead of major mode hook
- bind the autodef tree-sitter! instead of the functions.
2022-05-22 21:26:08 +01:00
0c2f986708 feat(:lang): enable ts text objs in modes 2022-05-22 21:26:03 +01:00
06ed5ade3f refactor!(tree-sitter): add +tree-sitter flag
BREAKING CHANGE: break the global nature of the tree sitter
module by adding a +tree-sitter flag to every applicable module

In the background this hooks turn-on-tree-sitter-mode
to the major-mode-hook of the language.
This may also solve the eager loading of tree sitter
2022-05-22 21:26:00 +01:00
f51a2cdd3a fix(python): usage of obsolete alias letf
Amend: 04b76fd0ce
2022-04-18 18:14:16 +02:00
04b76fd0ce fix(python): HTTP request from pip-requirements-mode
pip-requirements-mode fetches the pypi.org package list via HTTP
request, which blocks. This can sometimes take unbearably long in cases
where the user has a slow or no internet connection.

This fix defers this behavior until the first time completion is
invoked.

Fix: #5998
2022-04-17 03:23:40 +02:00
6f8b83b884 refactor(default,python): move smartparens config
Ref: 41cbb1fe7b
2022-04-01 19:12:35 +02:00
ff31427687 tweak(python): use pyproject.toml as project file
With PEP 518, Python defined a general Python project configuration
format that is called pyproject.toml
2022-04-01 04:31:59 +02:00
41cbb1fe7b tweak(python): update smartparens config
- Automatically close f-strings
- Don't insert trailing colons in function definitions
2022-04-01 04:31:59 +02:00
d58d084774 tweak(:lang,:tools): start eglot/lsp-mode later
To ensure lsp/eglot settings have precedence over local servers (e.g.
cider and lookup handlers).

Ref: clojure-emacs/cider#3170
2022-03-30 17:32:47 +02:00
80ac69c14e fix(python): deprioritize ~/.conda detection
Since ~/.conda is always created, whether or not the other possibilities
exist, best we treat it as a last resort.

Fix: #6071
2022-02-01 18:56:16 +01:00
bcb29f7d17 feat(python): search for anaconda home in ~/.conda
What even are standards?
2022-01-27 18:18:52 +01:00
8b41f44882 refactor(python): remove redundant pyright+eglot config
joaotavora/eglot@fd27cdc8f9 adds Pyright support to Eglot, so these
lines can be removed.

Amend: 34cb632a61
Revert: #5355
Ref: joaotavora/eglot@fd27cdc8f9
Ref: joaotavora/eglot#742
2022-01-27 15:44:45 +01:00
1d0f4ca424 tweak(python): use python-shell repl handlers
Fix: #4375
2021-12-18 10:45:17 -05:00
c8b15fef73 feat(python): add miniforge support to conda.el
Look for "~/miniforge3" and "~/.miniforge3" as possible locations for
`conda-anaconda-home`.
2021-12-12 23:13:41 +01:00
c0490697c0 feat(python): add eglot support for +pyright (#5355) 2021-09-14 14:26:24 +02:00
40ef70d3ca Merge pull request #4855 from daanturo/python-repl-docsets
Extend Python's docsets to Python REPL
2021-04-15 00:27:16 -04:00
82dfa22e77 Merge pull request #4851 from daanturo/pyenv-fails-friendly
Active pyenv-mode only when pyenv exe is found
2021-04-14 12:46:43 -04:00
4af36e0dab Change poetry-tracking-strategy for performance. 2021-03-30 17:00:00 +07:00
7ae2bf962e Active pyenv-mode only when pyenv exe is found. 2021-03-27 16:24:40 +07:00
0e9fd716d2 Extend Python's docsets to Python REPL. 2021-03-19 20:41:20 +07:00
dad58cb31d Add "Pandas" to python-mode's docsets. 2021-03-13 22:41:48 +07:00
c8bfbda556 Make anaconda & pipenv integrations remote-aware
Resolve paths to pipenv and python-shell-interpreter on the remote if
over tramp.
2021-01-09 02:55:09 -05:00
fcdd238291 Merge pull request #4146 from sei40kr/python-poetry-tracking-mode
Enable poetry-tracking-mode
2020-11-01 16:25:38 -05:00
17b6129d34 Minor refactor 2020-10-31 16:18:15 +09:00
4f7d9f7171 Merge pull request #4144 from davidh38/config/add_testall_keybinding_pytest
Add keybinding for testing all project functions with pytest
2020-10-29 02:07:26 -04:00
9baf656ff9 Enable poetry-tracking-mode 2020-10-24 20:17:00 +09:00
3788fd2c44 Add Keybinding for testing all functions in the project with pytest 2020-10-24 01:29:44 +02:00