# requirements-language-server
[![readthedocs](https://shields.io/readthedocs/requirements-language-server)](https://requirements-language-server.readthedocs.io)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/requirements-language-server/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/requirements-language-server/main)
[![github/workflow](https://github.com/Freed-Wu/requirements-language-server/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/requirements-language-server/actions)
[![codecov](https://codecov.io/gh/Freed-Wu/requirements-language-server/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/requirements-language-server)
[![DeepSource](https://deepsource.io/gh/Freed-Wu/requirements-language-server.svg/?show_trend=true)](https://deepsource.io/gh/Freed-Wu/requirements-language-server)
[![github/downloads](https://shields.io/github/downloads/Freed-Wu/requirements-language-server/total)](https://github.com/Freed-Wu/requirements-language-server/releases)
[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/requirements-language-server/latest/total)](https://github.com/Freed-Wu/requirements-language-server/releases/latest)
[![github/issues](https://shields.io/github/issues/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/issues)
[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/issues?q=is%3Aissue+is%3Aclosed)
[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/pulls)
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/pulls?q=is%3Apr+is%3Aclosed)
[![github/discussions](https://shields.io/github/discussions/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/discussions)
[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/milestones)
[![github/forks](https://shields.io/github/forks/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/network/members)
[![github/stars](https://shields.io/github/stars/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/stargazers)
[![github/watchers](https://shields.io/github/watchers/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/watchers)
[![github/contributors](https://shields.io/github/contributors/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/commits)
[![github/release-date](https://shields.io/github/release-date/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/releases/latest)
[![github/license](https://shields.io/github/license/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![github/v](https://shields.io/github/v/release/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)
[![pypi/status](https://shields.io/pypi/status/requirements-language-server)](https://pypi.org/project/requirements-language-server/#description)
[![pypi/v](https://shields.io/pypi/v/requirements-language-server)](https://pypi.org/project/requirements-language-server/#history)
[![pypi/downloads](https://shields.io/pypi/dd/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)
[![pypi/format](https://shields.io/pypi/format/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)
Language server for
[requirements.txt](https://pip.pypa.io/en/stable/reference/requirements-file-format).
Currently python's `requirement.txt` has 2 types:
- [PEP508](https://peps.python.org/pep-0508): supported by:
- [setuptools](https://setuptools.pypa.io)
- [pip](https://pip.pypa.io/en/stable/reference/requirements-file-format/#requirements-file-format):
supported by:
- [pip](https://pip.pypa.io)
- [pip-compile](https://github.com/jazzband/pip-tools)
The difference is that
[PEP508 doesn't support pip's options](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata).
For `pyproject.toml`:
```toml
[tool.setuptools.dynamic.dependencies]
file = "requirements.txt"
[tool.setuptools.dynamic.optional-dependencies.dev]
file = "requirements/dev.txt"
```
We recognize `requirements.txt` and `requirements/dev.txt` as PEP508's
`requirements.txt`s and display errors for all pip's options. For other
`requirements.txt`s, we recognize them as pip's `requirements.txt`s.
Features:
- [x] [Goto Definition](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_definition):
jump to first repeated package
- [x] [Find References](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_references):
jump to all other repeated packages
- [x] [Diagnostic](https://microsoft.github.io/language-server-protocol/specifications/specification-current#diagnostic):
- [x] repeated packages
- [x] unsorted packages
- [x] invalid path
- [x] pip's option when PEP508 is enabled
- [x] [Document Formatting](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_formatting):
sort packages
- [x] [Document Link](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_documentLink):
open package's pypi homepage
- [x] [Hover](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_hover)
- [x] pip's options
- [x] package
- [x] [Completion](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_completion):
- [x] pip's options
- [x] package
Other features:
- [x] [pre-commit-hooks](https://pre-commit.com/)
- [x] linter
- [x] formatter
## Screenshots
### Diagnostic
![diagnostic](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/13aa466d-62af-423a-a141-880b495750a7)
### Hover
![module](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/03237cb6-72ce-4d2f-a879-db18d595fa39)
![option](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/78a7b5ec-a9dd-46c2-b22b-4dc0123b6f0e)
### Completion
![module](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/0f1f9e31-3933-4f56-9cf9-5db6e044caca)
![option](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/1a8de48c-9138-4a0c-97a4-0c7ea3030be0)
![file](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/da7e162d-fa82-461a-a8b4-09db684e766c)
## How Does It Work
See [here](https://github.com/neomutt/lsp-tree-sitter#usage).
Read
[![readthedocs](https://shields.io/readthedocs/requirements-language-server)](https://requirements-language-server.readthedocs.io)
to know more.
## Related Projects
- [requirements.txt.vim](https://github.com/raimon49/requirements.txt.vim):
syntax highlight for vim
- [vim-polyglot](https://github.com/sheerun/vim-polyglot): contains above
- [bat](https://github.com/sharkdp/bat): syntax highlight for less
- [requirements-txt-fixer](https://github.com/pre-commit/pre-commit-hooks#requirements-txt-fixer):
sort package names
- [pip-tools](https://github.com/jazzband/pip-tools): check `requirements.txt`
Raw data
{
"_id": null,
"home_page": "",
"name": "requirements-language-server",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "requirements,language server",
"author": "",
"author_email": "\"Wu, Zhenyu\" <wuzhenyu@ustc.edu>",
"download_url": "https://files.pythonhosted.org/packages/ec/bb/d32792227005c4ec79649cf86db78127d3f06b6be857c8c7b1ce78f0f56a/requirements-language-server-0.0.20.tar.gz",
"platform": null,
"description": "# requirements-language-server\n\n[![readthedocs](https://shields.io/readthedocs/requirements-language-server)](https://requirements-language-server.readthedocs.io)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/requirements-language-server/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/requirements-language-server/main)\n[![github/workflow](https://github.com/Freed-Wu/requirements-language-server/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/requirements-language-server/actions)\n[![codecov](https://codecov.io/gh/Freed-Wu/requirements-language-server/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/requirements-language-server)\n[![DeepSource](https://deepsource.io/gh/Freed-Wu/requirements-language-server.svg/?show_trend=true)](https://deepsource.io/gh/Freed-Wu/requirements-language-server)\n\n[![github/downloads](https://shields.io/github/downloads/Freed-Wu/requirements-language-server/total)](https://github.com/Freed-Wu/requirements-language-server/releases)\n[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/requirements-language-server/latest/total)](https://github.com/Freed-Wu/requirements-language-server/releases/latest)\n[![github/issues](https://shields.io/github/issues/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/issues)\n[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/issues?q=is%3Aissue+is%3Aclosed)\n[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/pulls)\n[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/pulls?q=is%3Apr+is%3Aclosed)\n[![github/discussions](https://shields.io/github/discussions/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/discussions)\n[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/milestones)\n[![github/forks](https://shields.io/github/forks/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/network/members)\n[![github/stars](https://shields.io/github/stars/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/stargazers)\n[![github/watchers](https://shields.io/github/watchers/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/watchers)\n[![github/contributors](https://shields.io/github/contributors/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/graphs/contributors)\n[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/graphs/commit-activity)\n[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/commits)\n[![github/release-date](https://shields.io/github/release-date/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/releases/latest)\n\n[![github/license](https://shields.io/github/license/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server/blob/main/LICENSE)\n[![github/languages](https://shields.io/github/languages/count/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n[![github/v](https://shields.io/github/v/release/Freed-Wu/requirements-language-server)](https://github.com/Freed-Wu/requirements-language-server)\n\n[![pypi/status](https://shields.io/pypi/status/requirements-language-server)](https://pypi.org/project/requirements-language-server/#description)\n[![pypi/v](https://shields.io/pypi/v/requirements-language-server)](https://pypi.org/project/requirements-language-server/#history)\n[![pypi/downloads](https://shields.io/pypi/dd/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)\n[![pypi/format](https://shields.io/pypi/format/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)\n[![pypi/implementation](https://shields.io/pypi/implementation/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)\n[![pypi/pyversions](https://shields.io/pypi/pyversions/requirements-language-server)](https://pypi.org/project/requirements-language-server/#files)\n\nLanguage server for\n[requirements.txt](https://pip.pypa.io/en/stable/reference/requirements-file-format).\n\nCurrently python's `requirement.txt` has 2 types:\n\n- [PEP508](https://peps.python.org/pep-0508): supported by:\n - [setuptools](https://setuptools.pypa.io)\n- [pip](https://pip.pypa.io/en/stable/reference/requirements-file-format/#requirements-file-format):\n supported by:\n - [pip](https://pip.pypa.io)\n - [pip-compile](https://github.com/jazzband/pip-tools)\n\nThe difference is that\n[PEP508 doesn't support pip's options](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html#dynamic-metadata).\n\nFor `pyproject.toml`:\n\n```toml\n[tool.setuptools.dynamic.dependencies]\nfile = \"requirements.txt\"\n\n[tool.setuptools.dynamic.optional-dependencies.dev]\nfile = \"requirements/dev.txt\"\n```\n\nWe recognize `requirements.txt` and `requirements/dev.txt` as PEP508's\n`requirements.txt`s and display errors for all pip's options. For other\n`requirements.txt`s, we recognize them as pip's `requirements.txt`s.\n\nFeatures:\n\n- [x] [Goto Definition](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_definition):\n jump to first repeated package\n- [x] [Find References](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_references):\n jump to all other repeated packages\n- [x] [Diagnostic](https://microsoft.github.io/language-server-protocol/specifications/specification-current#diagnostic):\n - [x] repeated packages\n - [x] unsorted packages\n - [x] invalid path\n - [x] pip's option when PEP508 is enabled\n- [x] [Document Formatting](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_formatting):\n sort packages\n- [x] [Document Link](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_documentLink):\n open package's pypi homepage\n- [x] [Hover](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_hover)\n - [x] pip's options\n - [x] package\n- [x] [Completion](https://microsoft.github.io/language-server-protocol/specifications/specification-current#textDocument_completion):\n - [x] pip's options\n - [x] package\n\nOther features:\n\n- [x] [pre-commit-hooks](https://pre-commit.com/)\n - [x] linter\n - [x] formatter\n\n## Screenshots\n\n### Diagnostic\n\n![diagnostic](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/13aa466d-62af-423a-a141-880b495750a7)\n\n### Hover\n\n![module](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/03237cb6-72ce-4d2f-a879-db18d595fa39)\n\n![option](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/78a7b5ec-a9dd-46c2-b22b-4dc0123b6f0e)\n\n### Completion\n\n![module](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/0f1f9e31-3933-4f56-9cf9-5db6e044caca)\n\n![option](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/1a8de48c-9138-4a0c-97a4-0c7ea3030be0)\n\n![file](https://github.com/Freed-Wu/requirements-language-server/assets/32936898/da7e162d-fa82-461a-a8b4-09db684e766c)\n\n## How Does It Work\n\nSee [here](https://github.com/neomutt/lsp-tree-sitter#usage).\n\nRead\n[![readthedocs](https://shields.io/readthedocs/requirements-language-server)](https://requirements-language-server.readthedocs.io)\nto know more.\n\n## Related Projects\n\n- [requirements.txt.vim](https://github.com/raimon49/requirements.txt.vim):\n syntax highlight for vim\n- [vim-polyglot](https://github.com/sheerun/vim-polyglot): contains above\n- [bat](https://github.com/sharkdp/bat): syntax highlight for less\n- [requirements-txt-fixer](https://github.com/pre-commit/pre-commit-hooks#requirements-txt-fixer):\n sort package names\n- [pip-tools](https://github.com/jazzband/pip-tools): check `requirements.txt`\n",
"bugtrack_url": null,
"license": "GPL v3",
"summary": "requirements.txt language server",
"version": "0.0.20",
"project_urls": {
"Bug Report": "https://github.com/Freed-Wu/requirements-language-server/issues",
"Download": "https://github.com/Freed-Wu/requirements-language-server/releases",
"Homepage": "https://requirements-language-server.readthedocs.io",
"Source": "https://github.com/Freed-Wu/requirements-language-server"
},
"split_keywords": [
"requirements",
"language server"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "67cf695323125fd1269ac31881a6172b008b542532ac258fe27ab23f68fd9993",
"md5": "98f08eba5b2e653867f1974cbaffbea6",
"sha256": "01f1d36b2cf722215b04c66172d2a32e243a8f1374ce4003781fbe502bf39ada"
},
"downloads": -1,
"filename": "requirements_language_server-0.0.20-py3-none-any.whl",
"has_sig": false,
"md5_digest": "98f08eba5b2e653867f1974cbaffbea6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 31260,
"upload_time": "2024-03-14T08:53:00",
"upload_time_iso_8601": "2024-03-14T08:53:00.987542Z",
"url": "https://files.pythonhosted.org/packages/67/cf/695323125fd1269ac31881a6172b008b542532ac258fe27ab23f68fd9993/requirements_language_server-0.0.20-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ecbbd32792227005c4ec79649cf86db78127d3f06b6be857c8c7b1ce78f0f56a",
"md5": "8d8b22911927fe35a105b448f727da7f",
"sha256": "536283cfe4bec905b95c19552bdca6ddb644d76df0ecdff597159e423f2844fc"
},
"downloads": -1,
"filename": "requirements-language-server-0.0.20.tar.gz",
"has_sig": false,
"md5_digest": "8d8b22911927fe35a105b448f727da7f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 36441,
"upload_time": "2024-03-14T08:53:03",
"upload_time_iso_8601": "2024-03-14T08:53:03.944116Z",
"url": "https://files.pythonhosted.org/packages/ec/bb/d32792227005c4ec79649cf86db78127d3f06b6be857c8c7b1ce78f0f56a/requirements-language-server-0.0.20.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-14 08:53:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Freed-Wu",
"github_project": "requirements-language-server",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "requirements-language-server"
}