diff --git a/docs/docs/index.md b/docs/docs/index.md index 8f2dc48bd110cbb9e63c90b7475f0aab3673d56e..00810d0dfeb9871a30aec83560aa0e432d8760b6 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -177,3 +177,5 @@ can be run natively as [VSCode Tasks][vscode tasks]. [vscode tasks]: https://code.visualstudio.com/docs/editor/tasks [pdm task provider]: https://marketplace.visualstudio.com/items?itemName=knowsuchagency.pdm-task-provider [pdm scripts]: https://pdm.fming.dev/project/#run-scripts-in-isolated-environment + +### [Seek for other IDEs or editors](usage/advanced.md#integrate-with-other-ide-or-editors) diff --git a/docs/docs/usage/advanced.md b/docs/docs/usage/advanced.md index c9a94eff254d8d343c2fc3eebaa7038dccb764f8..18916f1b1eb4514bd322ab2c0c7e5da92b3ecdde 100644 --- a/docs/docs/usage/advanced.md +++ b/docs/docs/usage/advanced.md @@ -147,3 +147,45 @@ build-backend = "flit_core.buildapi" ``` PDM will call the correct backend when `pdm build`. + +## Integrate with other IDE or editors + +### Work with lsp-python-ms in Emacs + +Below is a sample code snippet showing how to make PDM work with [lsp-python-ms](https://github.com/emacs-lsp/lsp-python-ms) in Emacs. Contributed by [@linw1995](https://github.com/pdm-project/pdm/discussions/372#discussion-3303501). + +```emacs-lisp + ;; TODO: Cache result + (defun linw1995/pdm-get-python-executable (&optional dir) + (let ((pdm-get-python-cmd "pdm info --python")) + (string-trim + (shell-command-to-string + (if dir + (concat "cd " + dir + " && " + pdm-get-python-cmd) + pdm-get-python-cmd))))) + + (defun linw1995/pdm-get-packages-path (&optional dir) + (let ((pdm-get-packages-cmd "pdm info --packages")) + (concat (string-trim + (shell-command-to-string + (if dir + (concat "cd " + dir + " && " + pdm-get-packages-cmd) + pdm-get-packages-cmd))) + "/lib"))) + + (use-package lsp-python-ms + :ensure t + :init (setq lsp-python-ms-auto-install-server t) + :hook (python-mode + . (lambda () + (setq lsp-python-ms-python-executable (linw1995/pdm-get-python-executable)) + (setq lsp-python-ms-extra-paths (vector (linw1995/pdm-get-packages-path))) + (require 'lsp-python-ms) + (lsp)))) ; or lsp-deferred +``` diff --git a/news/188.feature b/news/188.feature index 717a41a07f9b4ed69fc028108be197270f3cd73a..72405b91f0188f4e4c61561cb86330bf2a41a5eb 100644 --- a/news/188.feature +++ b/news/188.feature @@ -1 +1 @@ -Add zsh completion script +Add hand-written zsh completion script. diff --git a/news/351.feature.1.md b/news/351.feature.1.md new file mode 100644 index 0000000000000000000000000000000000000000..3133b78662dcd06d9922a66abc900603324819d2 --- /dev/null +++ b/news/351.feature.1.md @@ -0,0 +1 @@ +Move `dev-dependencies`, `includes`, `excludes` and `package-dir` out from `[project]` table to `[tool.pdm]` table. The migration will be done automaticaly if old format is detected. diff --git a/news/351.feature.2.md b/news/351.feature.2.md new file mode 100644 index 0000000000000000000000000000000000000000..1767633ca4df7b3c39e0802388073aa41fa455d2 --- /dev/null +++ b/news/351.feature.2.md @@ -0,0 +1 @@ +`dev-dependencies` is now a table of dependencies groups, where key is the group name and value is an array of dependencies. These dependencies won't appear in the distribution's metadata. `dev-depedencies` of the old format will turn into `dev` group under `dev-dependencies`. diff --git a/news/351.feature.3.md b/news/351.feature.3.md new file mode 100644 index 0000000000000000000000000000000000000000..7dd2a46d394cd263c54c35f6ca32de20453f51c4 --- /dev/null +++ b/news/351.feature.3.md @@ -0,0 +1,2 @@ +Add a special value `:all` given to `-s/--section` to refer to all sections under the same species. +Adjust `add`, `sync`, `install`, `remove` and `update` to support the new `dev-dependencies` groups. Old behavior will be kept the same. diff --git a/news/351.feature.md b/news/351.feature.md deleted file mode 100644 index 97b795eeb11eef2facbbc5d1839765142d334da3..0000000000000000000000000000000000000000 --- a/news/351.feature.md +++ /dev/null @@ -1,6 +0,0 @@ -- Move `dev-dependencies`, `includes`, `excludes` and `package-dir` out from `[project]` table to `[tool.pdm]` table. -- The migration will be done automaticaly if old format is detected. -- dev-dependencies is now a table of dependencies groups, where key is the group name and value is an array of dependencies. These dependencies won't appear in the distribution's metadata. -- dev-depedencies of the old format will turn into `dev` group under `dev-dependencies`. -- Add a special value `:all` given to `-s/--section` to refer to all sections under the same species. -- Adjust `add`, `sync`, `install`, `remove` and `update` to support the new `dev-dependencies` groups. Old behavior will be kept the same. diff --git a/news/354.feature.md b/news/354.feature.md deleted file mode 100644 index c9df32f6cb492d36c20b79bea6ecd9b437c55a11..0000000000000000000000000000000000000000 --- a/news/354.feature.md +++ /dev/null @@ -1 +0,0 @@ -Add type annotations into untyped functions to start using mypy diff --git a/news/354.misc.md b/news/354.misc.md new file mode 100644 index 0000000000000000000000000000000000000000..970fb2628f0d8fc264371737da63ce8cd16dc505 --- /dev/null +++ b/news/354.misc.md @@ -0,0 +1 @@ +Add type annotations into untyped functions to start using mypy. diff --git a/news/357.bugfix.md b/news/357.feature.md similarity index 100% rename from news/357.bugfix.md rename to news/357.feature.md diff --git a/news/361.removal.md b/news/361.removal.md index 2b5a0cc2b10ec9619c7b83f300f7cd4156848cb3..26cdef29ab9e7b9167bb08d1500854dbdd692364 100644 --- a/news/361.removal.md +++ b/news/361.removal.md @@ -1 +1 @@ -Remove the support of project path following `-g/--global`. One should use `-g -p ` for that purpose. +Remove the support of project path following `-g/--global` that was deprecated in `1.4.0`. One should use `-g -p ` for that purpose. diff --git a/news/368.feature.md b/news/368.feature.md index dba727334143008d1c03e8a8dec2238394b84935..f17c1b762b6f93431a4baafdc708028a9974039f 100644 --- a/news/368.feature.md +++ b/news/368.feature.md @@ -1 +1 @@ -Support non-interactive `init` command via `-n/--non-interactive` options. No question will be asked in this mode. +Support non-interactive `init` command via `-n/--non-interactive` option. No question will be asked in this mode. diff --git a/news/369.bugfix.md b/news/369.bugfix.md index 5870c59c1ab6632536a8c8656557f8c31797b386..e6a5376a16b5d68ef08f936eadedcd826cf7e5d9 100644 --- a/news/369.bugfix.md +++ b/news/369.bugfix.md @@ -1 +1 @@ -Python runs in isolated mode via subprocess to avoid importing user packages +Python is now run in isolated mode via subprocess to avoid accidentally importing user packages. diff --git a/news/372.doc.md b/news/372.doc.md new file mode 100644 index 0000000000000000000000000000000000000000..5c79ee2ed576622935e4c4bbd15f629104ee49f4 --- /dev/null +++ b/news/372.doc.md @@ -0,0 +1 @@ +Add instructions of how to integrate PDM with Emacs, contributed by @linw1995. diff --git a/news/372.feature.md b/news/372.feature.md index 77dadb03f4ac91f08e6f3b892f7062e206c3fc1e..fbf413ff8ec0079c6b70c4b18dfcd8d2d7f4895e 100644 --- a/news/372.feature.md +++ b/news/372.feature.md @@ -1 +1 @@ -Show project packages(PEP 582) in the output of `pdm info`, also add an option `--packages` to show that value only. +Show project packages path(PEP 582) in the output of `pdm info`, also add an option `--packages` to show that value only.