Skip to content

Commit 8b56c6d

Browse files
authored
Merge pull request #7 from thunderock/better_developer_experience
started adding tests for node2vec
2 parents c90895c + cdac68a commit 8b56c6d

File tree

8 files changed

+1780
-1358
lines changed

8 files changed

+1780
-1358
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
run: timeout 10s poetry run pip --version || rm -rf .venv
7171

7272
- name: Uninstall typing dependencies
73-
run: poetry install --only main --only test -vvv
73+
run: poetry install -vvv
7474

7575
- name: Test
7676
run: |

.vscode/extensions.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
{
3+
"recommendations": [
4+
"GitHub.copilot",
5+
"GitHub.copilot-chat",
6+
"ms-python.python",
7+
"ms-python.black-formatter",
8+
"charliermarsh.ruff",
9+
"ms-python.mypy-type-checker",
10+
"eamodio.gitlens",
11+
"ms-vscode.makefile-tools",
12+
]
13+
}

.vscode/settings.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"files.exclude": {
3+
"**/.git": true,
4+
"**/.svn": true,
5+
"**/.hg": true,
6+
"**/CVS": true,
7+
"**/.DS_Store": true,
8+
"**/Thumbs.db": true,
9+
"**/__pycache__" : true,
10+
"**/node_modules/" : true,
11+
"**/.mypy_cache" : true,
12+
"**/.metals" : true,
13+
"**/.pytest_cache" : true,
14+
"**/.ruff_cache" : true,
15+
".venvs" : true,
16+
"**/*.egg-info" : true,
17+
},
18+
"files.associations": {
19+
"*.log.*": "log"
20+
},
21+
22+
"editor.insertSpaces": true,
23+
"files.trimTrailingWhitespace": true,
24+
"[markdown]": {
25+
"files.trimTrailingWhitespace": false,
26+
},
27+
"[python]" : {
28+
"editor.formatOnSave": true,
29+
"editor.defaultFormatter": "ms-python.black-formatter",
30+
},
31+
32+
// ==== Autocomplete issues ========
33+
34+
// Auto import
35+
"python.analysis.autoImportCompletions" : true,
36+
"python.analysis.packageIndexDepths" : [
37+
{
38+
"name": "graph_ml",
39+
"depth": 4
40+
},
41+
],
42+
43+
// ==== Linting ===
44+
// linter
45+
"flake8.enabled" : false,
46+
"isort.enabled" : false,
47+
"ruff.enable": true,
48+
"ruff.lint.args": [
49+
"--config=pyproject.toml",
50+
"--extend-ignore=I",
51+
],
52+
53+
// mypy - typechecker
54+
"mypy-type-checker.importStrategy": "fromEnvironment",
55+
"mypy-type-checker.args": ["--config-file", "pyproject.toml"],
56+
57+
// code formatter - black
58+
"black-formatter.importStrategy": "fromEnvironment",
59+
"black-formatter.args": ["--config", "${workspaceFolder}/pyproject.toml"],
60+
61+
// ====== pytest =====
62+
// See linting re passing config path.
63+
"python.testing.pytestEnabled": true,
64+
"python.testing.pytestArgs": ["-c", "${workspaceFolder}/pyproject.toml"],
65+
66+
67+
// === Integrated terminal ====
68+
"terminal.integrated.profiles.linux": {
69+
// Ensure the default integrated terminal (bash) respects .bash_profile
70+
// https://superuser.com/questions/1209366/win10-vs-code-integrated-bash-not-loading-bash-profile
71+
"bash": {
72+
"path": "bash",
73+
"args": ["--init-file", "${workspaceFolder}/.vscode/start-terminal.sh"],
74+
},
75+
},
76+
77+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
78+
"python.envFile": "${workspaceFolder}/.env",
79+
80+
"github.copilot.enable": {
81+
"*": true,
82+
}
83+
84+
}

.vscode/start-terminal.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
echo "Init vscode integrated terminal"
4+
5+
ENV_FILE=".env"
6+
VENV_DIR=".venv/bin/activate"
7+
8+
if test -f ~/.bash_profile; then
9+
echo "Running ~/.bash_profile"
10+
source ~/.bash_profile
11+
fi
12+
13+
if test -f "$ENV_FILE"; then
14+
echo "Exporting env vars in $ENV_FILE"
15+
set -o allexport
16+
source "$ENV_FILE"
17+
set +o allexport
18+
fi
19+
20+
if test -f "$VENV_DIR"; then
21+
echo "Activating virtualenv"
22+
source "$VENV_DIR"
23+
fi

Makefile

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,32 @@ ifeq ($(OS),Darwin)
1616
else
1717
@echo "Linux"
1818
endif
19-
@poetry config virtualenvs.in-project true
20-
@poetry install --only main -vvv
21-
22-
.PHONY: setup_all
23-
setup_all:
2419
@echo "setting up..."
2520
@poetry config virtualenvs.in-project true
26-
@poetry install --only main --only jupyter --only test --only lint -vvv
21+
@poetry install --only main --only test -vvv
2722
@poetry run poetry run jupyter contrib nbextension install --user
2823
@poetry run jupyter nbextension enable --py codeium --user
2924
@poetry run jupyter serverextension enable --py codeium --user
3025

3126
.PHONY: format
3227
format:
3328
@echo "formatting..."
34-
@poetry install --only lint
29+
@poetry install
3530
@poetry run black .
3631
# ruff fix
3732
@poetry run pre-commit run --all-files --config .pre-commit-config.yaml
3833

3934
.PHONY: run_tests
4035
run_tests:
4136
@echo "running tests..."
42-
@poetry install --only main --only test -vvv
37+
@poetry install -vvv
4338
@poetry run pytest -q tests
4439

4540
.PHONY: run_notebook
4641
run_notebook:
4742
@echo "running notebook..."
4843
@poetry config virtualenvs.in-project true
49-
@poetry install --only main --only jupyter -vvv
44+
@poetry install --only main -vvv
5045
@poetry run poetry run jupyter contrib nbextension install --user
5146
@poetry run jupyter nbextension enable --py codeium --user
5247
@poetry run jupyter serverextension enable --py codeium --user

0 commit comments

Comments
 (0)