Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

WIP: Clone Project and run jedi locally on it #47

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
aa45b30
add workspace that clones repo
ggilmore Mar 1, 2018
56cb4e9
fs: don't yield non-text files
ggilmore Mar 1, 2018
b530d1c
wip - work on making fizzbuzz tests pass
ggilmore Mar 2, 2018
270f4cf
make fizzbuzz refs test pass
ggilmore Mar 2, 2018
1459573
wip
ggilmore Mar 3, 2018
da0ddb6
wip
ggilmore Mar 5, 2018
498caf2
add doc to get_module_info
ggilmore Mar 7, 2018
bbe5a09
fix venv_location reference
ggilmore Mar 7, 2018
2826abb
delete a lot of the xdef logic for now, use cloneworkspace outside test
ggilmore Mar 7, 2018
b52e0c8
comment out pip args logic for now
ggilmore Mar 7, 2018
25304ad
uncomment hover tests
ggilmore Mar 7, 2018
f82f8a0
add local definition tests back for fizzbuzz
ggilmore Mar 7, 2018
363db57
fix lint
ggilmore Mar 7, 2018
7cfb6bf
rm unused cache to project path, clean logic in project to cache
ggilmore Mar 7, 2018
e1ddfb3
re-order clone_workspace methods
ggilmore Mar 7, 2018
54f80dd
remove unused x-def related methods, distracting for now
ggilmore Mar 7, 2018
10245a7
project_to_cache: change doc string to make both abolute
ggilmore Mar 7, 2018
5be8955
add docstring for venv_path
ggilmore Mar 7, 2018
39bcd14
fix lint
ggilmore Mar 7, 2018
cc78c33
simplify project_to_cache, use in constructor
ggilmore Mar 7, 2018
7bf3c6a
wip - install third party deps
ggilmore Mar 8, 2018
f7ea88e
handle minetype == None
ggilmore Mar 8, 2018
6a1b286
setup flask tests
ggilmore Mar 8, 2018
2f1079b
comment out all non hover tests
ggilmore Mar 8, 2018
e214260
fix flask hover tests
ggilmore Mar 8, 2018
a807253
add working local def tests for flask
ggilmore Mar 8, 2018
16276b4
refactor install_ext_deps and add doc
ggilmore Mar 8, 2018
a3e0c76
add explicit str() call to install_pip
ggilmore Mar 8, 2018
14a2743
assume file is text if the mimetype is none
ggilmore Mar 8, 2018
e0d5208
fix / enhance _install_pipenv logic
ggilmore Mar 8, 2018
5518f86
add conflictingdeps test
ggilmore Mar 8, 2018
0d10e5e
add back dep versioning tests
ggilmore Mar 8, 2018
4608a9c
add back modpkgsamename tests
ggilmore Mar 8, 2018
cd05874
ignore decoding errors when running workspace in tests
ggilmore Mar 8, 2018
ccb6396
add back tensorflow tests
ggilmore Mar 8, 2018
7768ada
add back graphql core test
ggilmore Mar 8, 2018
0437207
add back jedi tests
ggilmore Mar 8, 2018
854f40f
comment out remaning tests that don't deal with local defs or hovers
ggilmore Mar 8, 2018
e5807b2
remove vv flag
ggilmore Mar 8, 2018
d346750
HACK: force pipenv to create venvs (right now for tests)
ggilmore Mar 8, 2018
cf7fe97
more strict checking for Pipfile at repo root
ggilmore Mar 8, 2018
ebbd7dc
rm old workspace, rename cloneworkspace to workspace
ggilmore Mar 9, 2018
b17dae2
wip - support multiple projects in workspace
ggilmore Mar 9, 2018
72bf615
rm .cache
keegancsmith Mar 16, 2018
dd19b44
use latest pytest
keegancsmith Mar 16, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ __pycache__/
src
.cache/
python-langserver-cache/
python-cloned-projects-cache/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ lint:
pipenv run flake8

test:
pipenv run pytest test_langserver.py
# pipenv run pytest test_langserver.py
cd ./test && pipenv run pytest test_*.py
8 changes: 5 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ name = "pypi"

[packages]

jedi = {git = "git://github.com/sourcegraph/jedi.git", editable = true, ref = "9a3e7256df2e6099207fd7289141885ec17ebec7"}
requirements = {git = "git://github.com/sourcegraph/requirements-parser.git", editable = true, ref = "69f1a9cb916b2995843c3ea9b988da46c9dd65c7"}
opentracing = "*"
lightstep = "*"
"delegator.py" = "*"
pipenv = "*"
jedi = {git = "git://github.com/davidhalter/jedi.git", editable = true, ref = "3c9aa9ef254dbf1aa5f55ed3a4ed9ec4c6d0bb5a"}


[dev-packages]

py = "==1.4.34"
pytest = "==3.2.3"
py = "*"
pytest = "*"
"autopep8" = "*"
"flake8" = "*"
autoflake = "*"
Expand Down
192 changes: 147 additions & 45 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions langserver/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import distutils
from distutils.sysconfig import get_python_lib
from pathlib import Path


class GlobalConfig:

# TODO: allow different Python stdlib versions per workspace?

PYTHON_PATH = distutils.sysconfig.get_python_lib(standard_lib=True)
PACKAGES_PARENT = "python-langserver-cache"
PYTHON_PATH = Path(get_python_lib(standard_lib=True)).absolute()
PACKAGES_PARENT = Path("python-langserver-cache").absolute()
CLONED_PROJECT_PATH = Path("python-cloned-projects-cache").absolute()
STDLIB_REPO_URL = "git://github.com/python/cpython"
STDLIB_SRC_PATH = "Lib"
STDLIB_SRC_PATH = Path("Lib")
6 changes: 4 additions & 2 deletions langserver/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import opentracing
from typing import List

import mimetypes
from .jsonrpc import JSONRPC2Connection


Expand Down Expand Up @@ -212,7 +212,9 @@ def _walk(self, top: str):
if os.path.isdir(e):
dirs.append(os.path.relpath(e, self.root))
else:
files.append(os.path.relpath(e, self.root))
file_type = mimetypes.guess_type(e)[0]
if file_type is None or file_type.startswith("text/"):
files.append(os.path.relpath(e, self.root))
yield from files
for d in dirs:
yield from self._walk(os.path.join(self.root, d))
Loading