django-lsp 0.1.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,176 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python
3
+
4
+ ### Python ###
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ #poetry.lock
107
+
108
+ # pdm
109
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110
+ #pdm.lock
111
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112
+ # in version control.
113
+ # https://pdm.fming.dev/#use-with-ide
114
+ .pdm.toml
115
+
116
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117
+ __pypackages__/
118
+
119
+ # Celery stuff
120
+ celerybeat-schedule
121
+ celerybeat.pid
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+
166
+ ### Python Patch ###
167
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168
+ poetry.toml
169
+
170
+ # ruff
171
+ .ruff_cache/
172
+
173
+ # LSP config files
174
+ pyrightconfig.json
175
+
176
+ # End of https://www.toptal.com/developers/gitignore/api/python
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Josh Thomas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,40 @@
1
+ Metadata-Version: 2.1
2
+ Name: django-lsp
3
+ Version: 0.1.0.dev0
4
+ Summary: Django Language Server Protocol
5
+ Author-email: Josh Thomas <josh@joshthomas.dev>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Josh Thomas
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ License-File: LICENSE
16
+ Classifier: Development Status :: 1 - Planning
17
+ Classifier: Framework :: Django
18
+ Classifier: Framework :: Django :: 3.2
19
+ Classifier: Framework :: Django :: 4.2
20
+ Classifier: Framework :: Django :: 5.0
21
+ Classifier: License :: OSI Approved :: MIT License
22
+ Classifier: Operating System :: OS Independent
23
+ Classifier: Programming Language :: Python
24
+ Classifier: Programming Language :: Python :: 3
25
+ Classifier: Programming Language :: Python :: 3 :: Only
26
+ Classifier: Programming Language :: Python :: 3.8
27
+ Classifier: Programming Language :: Python :: 3.9
28
+ Classifier: Programming Language :: Python :: 3.10
29
+ Classifier: Programming Language :: Python :: 3.11
30
+ Classifier: Programming Language :: Python :: 3.12
31
+ Classifier: Programming Language :: Python :: Implementation :: CPython
32
+ Requires-Python: >=3.8
33
+ Requires-Dist: pygls>=1.3.0
34
+ Description-Content-Type: text/markdown
35
+
36
+ # django-lsp
37
+
38
+ A Language Server Protocol implementation for Django projects.
39
+
40
+ WIP
@@ -0,0 +1,5 @@
1
+ # django-lsp
2
+
3
+ A Language Server Protocol implementation for Django projects.
4
+
5
+ WIP
@@ -0,0 +1,115 @@
1
+ [project]
2
+ name = "django-lsp"
3
+ dynamic = ["version"]
4
+ description = "Django Language Server Protocol"
5
+ authors = [{ name = "Josh Thomas", email = "josh@joshthomas.dev" }]
6
+ dependencies = ["pygls>=1.3.0"]
7
+ readme = "README.md"
8
+ requires-python = ">= 3.8"
9
+ license = { file = "LICENSE" }
10
+ classifiers = [
11
+ "Development Status :: 1 - Planning",
12
+ "Framework :: Django",
13
+ "Framework :: Django :: 3.2",
14
+ "Framework :: Django :: 4.2",
15
+ "Framework :: Django :: 5.0",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.8",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: Implementation :: CPython",
27
+ ]
28
+
29
+ [project.scripts]
30
+ django-lsp = "django_lsp.server:start"
31
+
32
+ [build-system]
33
+ requires = ["hatchling"]
34
+ build-backend = "hatchling.build"
35
+
36
+ [tool.rye]
37
+ managed = true
38
+ dev-dependencies = ["django<=3.2"]
39
+
40
+ [tool.hatch.metadata]
41
+ allow-direct-references = true
42
+
43
+ [tool.hatch.build]
44
+ exclude = [".*"]
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["src/django_lsp"]
48
+
49
+ [tool.hatch.version]
50
+ path = "src/django_lsp/__init__.py"
51
+
52
+ [tool.ruff]
53
+ # Exclude a variety of commonly ignored directories.
54
+ exclude = [
55
+ ".bzr",
56
+ ".direnv",
57
+ ".eggs",
58
+ ".git",
59
+ ".github",
60
+ ".hg",
61
+ ".mypy_cache",
62
+ ".ruff_cache",
63
+ ".svn",
64
+ ".tox",
65
+ ".venv",
66
+ "__pypackages__",
67
+ "_build",
68
+ "build",
69
+ "dist",
70
+ "migrations",
71
+ "node_modules",
72
+ "venv",
73
+ ]
74
+ extend-include = ["*.pyi?"]
75
+ indent-width = 4
76
+ # Same as Black.
77
+ line-length = 88
78
+ # Assume Python 3.8
79
+ target-version = "py38"
80
+
81
+ [tool.ruff.format]
82
+ # Like Black, indent with spaces, rather than tabs.
83
+ indent-style = "space"
84
+ # Like Black, automatically detect the appropriate line ending.
85
+ line-ending = "auto"
86
+ # Like Black, use double quotes for strings.
87
+ quote-style = "double"
88
+
89
+ [tool.ruff.lint]
90
+ # Allow unused variables when underscore-prefixed.
91
+ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
92
+ # Allow autofix for all enabled rules (when `--fix`) is provided.
93
+ fixable = ["A", "B", "C", "D", "E", "F", "I"]
94
+ ignore = ["E501", "E741"] # temporary
95
+ select = [
96
+ "B", # flake8-bugbear
97
+ "E", # Pycodestyle
98
+ "F", # Pyflakes
99
+ "I", # isort
100
+ "UP", # pyupgrade
101
+ ]
102
+ unfixable = []
103
+
104
+ [tool.ruff.lint.isort]
105
+ force-single-line = true
106
+ known-first-party = ["django_lsp"]
107
+ required-imports = ["from __future__ import annotations"]
108
+
109
+ [tool.ruff.lint.per-file-ignores]
110
+ # Tests can use magic values, assertions, and relative imports
111
+ "tests/**/*" = ["PLR2004", "S101", "TID252"]
112
+
113
+ [tool.ruff.lint.pyupgrade]
114
+ # Preserve types, even if a file imports `from __future__ import annotations`.
115
+ keep-runtime-typing = true
@@ -0,0 +1,27 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+
10
+ -e file:.
11
+ asgiref==3.7.2
12
+ # via django
13
+ attrs==23.2.0
14
+ # via cattrs
15
+ # via lsprotocol
16
+ cattrs==23.2.3
17
+ # via lsprotocol
18
+ # via pygls
19
+ django==3.2
20
+ lsprotocol==2023.0.1
21
+ # via pygls
22
+ pygls==1.3.0
23
+ # via django-lsp
24
+ pytz==2024.1
25
+ # via django
26
+ sqlparse==0.4.4
27
+ # via django
@@ -0,0 +1,20 @@
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+
10
+ -e file:.
11
+ attrs==23.2.0
12
+ # via cattrs
13
+ # via lsprotocol
14
+ cattrs==23.2.3
15
+ # via lsprotocol
16
+ # via pygls
17
+ lsprotocol==2023.0.1
18
+ # via pygls
19
+ pygls==1.3.0
20
+ # via django-lsp
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "0.1.0dev0"
@@ -0,0 +1,27 @@
1
+ from __future__ import annotations
2
+
3
+ from lsprotocol.types import INITIALIZE
4
+ from lsprotocol.types import InitializeParams
5
+ from lsprotocol.types import MessageType
6
+ from pygls.server import LanguageServer
7
+
8
+ from django_lsp import __version__
9
+
10
+ server = LanguageServer(
11
+ name="django",
12
+ version=__version__,
13
+ )
14
+
15
+
16
+ @server.command(INITIALIZE)
17
+ def initialize(params: InitializeParams) -> None:
18
+ server.show_message_log("django-lsp initialized", MessageType.Info)
19
+ server.show_message("django-lsp initialized", MessageType.Info)
20
+
21
+
22
+ def start() -> None:
23
+ server.start_io()
24
+
25
+
26
+ if __name__ == "__main__":
27
+ start()