Skip to content

Commit d9f4545

Browse files
Add basic codespace configuration for development (#304)
Co-authored-by: Karthik Nadig <[email protected]>
1 parent 6a8240a commit d9f4545

File tree

8 files changed

+340
-8
lines changed

8 files changed

+340
-8
lines changed

.devcontainer/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.7
2+
3+
RUN python -m pip install --upgrade pip
4+
5+
COPY dev-requirements.txt ./
6+
RUN python -m pip install -r dev-requirements.txt \
7+
&& rm dev-requirements.txt
8+
9+
COPY requirements.txt ./
10+
RUN python -m pip install -r requirements.txt \
11+
&& rm requirements.txt
12+
13+
COPY src/test/python_tests/requirements.txt .
14+
RUN python -m pip install -r requirements.txt \
15+
&& rm requirements.txt

.devcontainer/devcontainer.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
3+
{
4+
"name": "Python Environment",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": ".."
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"amodio.tsl-problem-matcher",
13+
"bungcip.better-toml",
14+
"cschleiden.vscode-github-actions",
15+
"dbaeumer.vscode-eslint",
16+
"esbenp.prettier-vscode",
17+
"editorconfig.editorconfig",
18+
"GitHub.copilot",
19+
"github.vscode-pull-request-github",
20+
"ms-azuretools.vscode-docker",
21+
"ms-python.python",
22+
"ms-python.vscode-pylance",
23+
"ms-python.pylint",
24+
"ms-python.isort",
25+
"ms-python.flake8",
26+
"ms-python.black-formatter@prerelease",
27+
"ms-vsliveshare.vsliveshare",
28+
"ms-vscode-remote.remote-containers"
29+
],
30+
"settings": {
31+
"python.defaultInterpreterPath": "/usr/local/bin/python"
32+
}
33+
}
34+
},
35+
"postCreateCommand": "nox --session setup"
36+
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ node_modules
88
bundled/libs/
99
**/__pycache__
1010
**/.pytest_cache
11-
**/.vs
11+
**/.vs
12+
src/test/python_tests/test_data/sample1/*.py

.pylintrc

-4
This file was deleted.

.vscode/settings.json

+28-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,34 @@
1010
},
1111
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
1212
"typescript.tsc.autoDetect": "off",
13-
"python.testing.pytestArgs": ["src/test/python_tests"],
13+
"editor.formatOnSave": true,
14+
"editor.formatOnPaste": true,
15+
"files.trimTrailingWhitespace": true,
16+
"files.autoSave": "onFocusChange",
17+
"git.autofetch": true,
18+
"githubPullRequests.pullBranch": "always",
19+
"[jsonc]": {
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
},
22+
"[python]": {
23+
"editor.defaultFormatter": "ms-python.black-formatter"
24+
},
25+
"python.testing.pytestArgs": [
26+
"src/test/python_tests"
27+
],
1428
"python.testing.unittestEnabled": false,
1529
"python.testing.pytestEnabled": true,
1630
"python.testing.cwd": "${workspaceFolder}",
17-
"editor.formatOnSave": true
18-
}
31+
"pylint.args": [
32+
"--rcfile=pyproject.toml"
33+
],
34+
"black-formatter.args": [
35+
"--config=pyproject.toml"
36+
],
37+
"flake8.args": [
38+
"--toml-config=pyproject.toml"
39+
],
40+
"isort.args": [
41+
"--settings-path=pyproject.toml"
42+
]
43+
}

dev-requirements.in

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is used to generate requirements.txt.
2+
# To update requirements.txt, run the following commands.
3+
# Use Python 3.7 when creating the environment or using pip-tools
4+
# --resolver=backtracking is required because current flake8 expects Python >= 3.8.1
5+
# 1) pip install pip-tools
6+
# 2) pip-compile --generate-hashes --upgrade ./dev-requirements.in --resolver=backtracking
7+
8+
black
9+
flake8
10+
flake8-pyproject
11+
isort
12+
nox
13+
pip-tools
14+
wheel

dev-requirements.txt

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.7
3+
# by the following command:
4+
#
5+
# pip-compile --generate-hashes --resolver=backtracking ./dev-requirements.in
6+
#
7+
argcomplete==2.1.1 \
8+
--hash=sha256:17041f55b8c45099428df6ce6d0d282b892471a78c71375d24f227e21c13f8c5 \
9+
--hash=sha256:72e08340852d32544459c0c19aad1b48aa2c3a96de8c6e5742456b4f538ca52f
10+
# via nox
11+
black==23.1.0 \
12+
--hash=sha256:0052dba51dec07ed029ed61b18183942043e00008ec65d5028814afaab9a22fd \
13+
--hash=sha256:0680d4380db3719ebcfb2613f34e86c8e6d15ffeabcf8ec59355c5e7b85bb555 \
14+
--hash=sha256:121ca7f10b4a01fd99951234abdbd97728e1240be89fde18480ffac16503d481 \
15+
--hash=sha256:162e37d49e93bd6eb6f1afc3e17a3d23a823042530c37c3c42eeeaf026f38468 \
16+
--hash=sha256:2a951cc83ab535d248c89f300eccbd625e80ab880fbcfb5ac8afb5f01a258ac9 \
17+
--hash=sha256:2bf649fda611c8550ca9d7592b69f0637218c2369b7744694c5e4902873b2f3a \
18+
--hash=sha256:382998821f58e5c8238d3166c492139573325287820963d2f7de4d518bd76958 \
19+
--hash=sha256:49f7b39e30f326a34b5c9a4213213a6b221d7ae9d58ec70df1c4a307cf2a1580 \
20+
--hash=sha256:57c18c5165c1dbe291d5306e53fb3988122890e57bd9b3dcb75f967f13411a26 \
21+
--hash=sha256:7a0f701d314cfa0896b9001df70a530eb2472babb76086344e688829efd97d32 \
22+
--hash=sha256:8178318cb74f98bc571eef19068f6ab5613b3e59d4f47771582f04e175570ed8 \
23+
--hash=sha256:8b70eb40a78dfac24842458476135f9b99ab952dd3f2dab738c1881a9b38b753 \
24+
--hash=sha256:9880d7d419bb7e709b37e28deb5e68a49227713b623c72b2b931028ea65f619b \
25+
--hash=sha256:9afd3f493666a0cd8f8df9a0200c6359ac53940cbde049dcb1a7eb6ee2dd7074 \
26+
--hash=sha256:a29650759a6a0944e7cca036674655c2f0f63806ddecc45ed40b7b8aa314b651 \
27+
--hash=sha256:a436e7881d33acaf2536c46a454bb964a50eff59b21b51c6ccf5a40601fbef24 \
28+
--hash=sha256:a59db0a2094d2259c554676403fa2fac3473ccf1354c1c63eccf7ae65aac8ab6 \
29+
--hash=sha256:a8471939da5e824b891b25751955be52ee7f8a30a916d570a5ba8e0f2eb2ecad \
30+
--hash=sha256:b0bd97bea8903f5a2ba7219257a44e3f1f9d00073d6cc1add68f0beec69692ac \
31+
--hash=sha256:b6a92a41ee34b883b359998f0c8e6eb8e99803aa8bf3123bf2b2e6fec505a221 \
32+
--hash=sha256:bb460c8561c8c1bec7824ecbc3ce085eb50005883a6203dcfb0122e95797ee06 \
33+
--hash=sha256:bfffba28dc52a58f04492181392ee380e95262af14ee01d4bc7bb1b1c6ca8d27 \
34+
--hash=sha256:c1c476bc7b7d021321e7d93dc2cbd78ce103b84d5a4cf97ed535fbc0d6660648 \
35+
--hash=sha256:c91dfc2c2a4e50df0026f88d2215e166616e0c80e86004d0003ece0488db2739 \
36+
--hash=sha256:e6663f91b6feca5d06f2ccd49a10f254f9298cc1f7f49c46e498a0771b507104
37+
# via -r ./dev-requirements.in
38+
build==0.10.0 \
39+
--hash=sha256:af266720050a66c893a6096a2f410989eeac74ff9a68ba194b3f6473e8e26171 \
40+
--hash=sha256:d5b71264afdb5951d6704482aac78de887c80691c52b88a9ad195983ca2c9269
41+
# via pip-tools
42+
click==8.1.3 \
43+
--hash=sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e \
44+
--hash=sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48
45+
# via
46+
# black
47+
# pip-tools
48+
colorlog==6.7.0 \
49+
--hash=sha256:0d33ca236784a1ba3ff9c532d4964126d8a2c44f1f0cb1d2b0728196f512f662 \
50+
--hash=sha256:bd94bd21c1e13fac7bd3153f4bc3a7dc0eb0974b8bc2fdf1a989e474f6e582e5
51+
# via nox
52+
distlib==0.3.6 \
53+
--hash=sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46 \
54+
--hash=sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e
55+
# via virtualenv
56+
filelock==3.10.0 \
57+
--hash=sha256:3199fd0d3faea8b911be52b663dfccceb84c95949dd13179aa21436d1a79c4ce \
58+
--hash=sha256:e90b34656470756edf8b19656785c5fea73afa1953f3e1b0d645cef11cab3182
59+
# via virtualenv
60+
flake8==5.0.4 \
61+
--hash=sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db \
62+
--hash=sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248
63+
# via
64+
# -r ./dev-requirements.in
65+
# flake8-pyproject
66+
flake8-pyproject==1.2.2 \
67+
--hash=sha256:52d412219e7db6227faa654675b1435947b11d49b453f3eced760f19bdd6f06a
68+
# via -r ./dev-requirements.in
69+
importlib-metadata==4.2.0 \
70+
--hash=sha256:057e92c15bc8d9e8109738a48db0ccb31b4d9d5cfbee5a8670879a30be66304b \
71+
--hash=sha256:b7e52a1f8dec14a75ea73e0891f3060099ca1d8e6a462a4dff11c3e119ea1b31
72+
# via
73+
# argcomplete
74+
# build
75+
# click
76+
# flake8
77+
# nox
78+
# virtualenv
79+
isort==5.11.5 \
80+
--hash=sha256:6be1f76a507cb2ecf16c7cf14a37e41609ca082330be4e3436a18ef74add55db \
81+
--hash=sha256:ba1d72fb2595a01c7895a5128f9585a5cc4b6d395f1c8d514989b9a7eb2a8746
82+
# via -r ./dev-requirements.in
83+
mccabe==0.7.0 \
84+
--hash=sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325 \
85+
--hash=sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e
86+
# via flake8
87+
mypy-extensions==1.0.0 \
88+
--hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \
89+
--hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782
90+
# via black
91+
nox==2022.11.21 \
92+
--hash=sha256:0e41a990e290e274cb205a976c4c97ee3c5234441a8132c8c3fd9ea3c22149eb \
93+
--hash=sha256:e21c31de0711d1274ca585a2c5fde36b1aa962005ba8e9322bf5eeed16dcd684
94+
# via -r ./dev-requirements.in
95+
packaging==23.0 \
96+
--hash=sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2 \
97+
--hash=sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97
98+
# via
99+
# black
100+
# build
101+
# nox
102+
pathspec==0.11.1 \
103+
--hash=sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687 \
104+
--hash=sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293
105+
# via black
106+
pip-tools==6.12.3 \
107+
--hash=sha256:480d44fae6e09fad3f9bd3d0a7e8423088715d10477e8ef0663440db25e3114f \
108+
--hash=sha256:8510420f46572b2e26c357541390593d9365eb6edd2d1e7505267910ecaec080
109+
# via -r ./dev-requirements.in
110+
platformdirs==2.6.2 \
111+
--hash=sha256:83c8f6d04389165de7c9b6f0c682439697887bca0aa2f1c87ef1826be3584490 \
112+
--hash=sha256:e1fea1fe471b9ff8332e229df3cb7de4f53eeea4998d3b6bfff542115e998bd2
113+
# via
114+
# black
115+
# virtualenv
116+
pycodestyle==2.9.1 \
117+
--hash=sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785 \
118+
--hash=sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b
119+
# via flake8
120+
pyflakes==2.5.0 \
121+
--hash=sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2 \
122+
--hash=sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3
123+
# via flake8
124+
pyproject-hooks==1.0.0 \
125+
--hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \
126+
--hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5
127+
# via build
128+
tomli==2.0.1 \
129+
--hash=sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc \
130+
--hash=sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f
131+
# via
132+
# black
133+
# build
134+
# flake8-pyproject
135+
# pyproject-hooks
136+
typed-ast==1.5.4 \
137+
--hash=sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2 \
138+
--hash=sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1 \
139+
--hash=sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6 \
140+
--hash=sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62 \
141+
--hash=sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac \
142+
--hash=sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d \
143+
--hash=sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc \
144+
--hash=sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2 \
145+
--hash=sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97 \
146+
--hash=sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35 \
147+
--hash=sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6 \
148+
--hash=sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1 \
149+
--hash=sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4 \
150+
--hash=sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c \
151+
--hash=sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e \
152+
--hash=sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec \
153+
--hash=sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f \
154+
--hash=sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72 \
155+
--hash=sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47 \
156+
--hash=sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72 \
157+
--hash=sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe \
158+
--hash=sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6 \
159+
--hash=sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3 \
160+
--hash=sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66
161+
# via black
162+
typing-extensions==4.5.0 \
163+
--hash=sha256:5cb5f4a79139d699607b3ef622a1dedafa84e115ab0024e0d9c044a9479ca7cb \
164+
--hash=sha256:fb33085c39dd998ac16d1431ebc293a8b3eedd00fd4a32de0ff79002c19511b4
165+
# via
166+
# black
167+
# importlib-metadata
168+
# nox
169+
# platformdirs
170+
virtualenv==20.16.2 \
171+
--hash=sha256:0ef5be6d07181946891f5abc8047fda8bc2f0b4b9bf222c64e6e8963baee76db \
172+
--hash=sha256:635b272a8e2f77cb051946f46c60a54ace3cb5e25568228bd6b57fc70eca9ff3
173+
# via nox
174+
wheel==0.40.0 \
175+
--hash=sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873 \
176+
--hash=sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247
177+
# via
178+
# -r ./dev-requirements.in
179+
# pip-tools
180+
zipp==3.15.0 \
181+
--hash=sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b \
182+
--hash=sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556
183+
# via importlib-metadata
184+
185+
# WARNING: The following packages were not pinned, but pip requires them to be
186+
# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
187+
# pip
188+
# setuptools

pyproject.toml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[tool.black]
2+
line_length = 88
3+
4+
[tool.flake8]
5+
max-line-length = 99
6+
select = "F,E,W,B,B901,B902,B903"
7+
exclude = [
8+
".eggs",
9+
".git",
10+
".tox",
11+
"nssm",
12+
"obj",
13+
"out",
14+
"packages",
15+
"pywin32",
16+
"tests",
17+
"swagger_client"
18+
]
19+
ignore = [
20+
"E722",
21+
"B001",
22+
"W503",
23+
"E203",
24+
"E402"
25+
]
26+
27+
[tool.isort]
28+
multi_line_output = 3
29+
line_length = 99
30+
include_trailing_comma = true
31+
32+
[tool.pylint.'FORMAT']
33+
max-line-length=99
34+
35+
[tool.pylint.'MESSAGES CONTROL']
36+
disable= [
37+
"bare-except",
38+
"broad-except",
39+
"consider-using-with",
40+
"consider-using-generator",
41+
"duplicate-code",
42+
"import-outside-toplevel",
43+
"invalid-name",
44+
"import-error",
45+
"too-few-public-methods",
46+
"too-many-arguments",
47+
"too-many-branches",
48+
"too-many-instance-attributes",
49+
"unspecified-encoding",
50+
"wrong-import-position",
51+
]
52+
53+
[tool.pyright]
54+
reportOptionalMemberAccess = false
55+
reportGeneralTypeIssues = false
56+
reportOptionalSubscript = false
57+
reportUnboundVariable = false

0 commit comments

Comments
 (0)