Skip to content

Commit eae387b

Browse files
IDE: Support Codespaces (#179)
As described in the linked issue, this switches py_binary and py_library to aspect_rules_py. This way there is no dependency to the system python executable. Python is included anyway, since 'format.fix' requires a system python installation
1 parent 49d8db4 commit eae387b

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

.devcontainer/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# One devcontainer?
2+
In the main repository eclipse-score/score the focus is on documentation, therefore the devcontainer
3+
is specifically tailored to that purpose. To simplify the setup, only one devcontainer is used,
4+
for both documentation and development of documentation tooling.
5+
6+
In other eclipse-score repositories, the situation is different and either a combined devcontainer
7+
or multiple devcontainers is more appropriate.
8+
9+
# Why is Python included?
10+
Unfortunately multiple python related bazel targets rely on the system python installation.
11+
12+
`py_library` and `py_binary` targets are prominent examples, however they can trivially
13+
be fixed by using `aspect_rules_py` instead of `rules_python`. Bug-report: https://github.com/bazelbuild/rules_python/issues/691
14+
15+
16+
Others are not as easy to work around, e.g. `format.fix`.

.devcontainer/devcontainer.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/python:1.2-3.12",
3+
"features": {
4+
"ghcr.io/devcontainers-community/features/bazel:1": {}
5+
},
6+
"customizations": {
7+
"vscode": {
8+
"extensions": [
9+
"ms-python.python",
10+
"usernamehw.errorlens",
11+
"hediet.vscode-drawio",
12+
"swyddfa.esbonio",
13+
"lextudio.restructuredtext"
14+
]
15+
}
16+
}
17+
}

.vscode/extensions.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"lextudio.restructuredtext",
88

99
// Linting and live preview for score docs
10-
"swyddfa.esbonio"
10+
"swyddfa.esbonio",
11+
12+
// ErrorLens highlights errors and warnings in your code / docs
13+
"usernamehw.errorlens",
1114
]
1215
}

docs/BUILD

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@
3737
#
3838
# For user-facing documentation, refer to `/README.md`.
3939

40-
load("@aspect_rules_py//py:defs.bzl", "py_venv")
40+
load("@aspect_rules_py//py:defs.bzl", "py_binary", "py_library", "py_venv")
4141
load("@pip_sphinx//:requirements.bzl", "all_requirements", "requirement")
4242
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
4343
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
44-
load("@rules_python//python:defs.bzl", "py_library")
4544
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
4645
load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
4746

docs/_tooling/sphinx_extensions/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13+
load("@aspect_rules_py//py:defs.bzl", "py_library")
1314
load("@pip_sphinx//:requirements.bzl", "all_requirements", "requirement")
14-
load("@rules_python//python:defs.bzl", "py_library")
1515
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
1616
load("@rules_python//sphinxdocs:sphinx.bzl", "sphinx_build_binary", "sphinx_docs")
1717

0 commit comments

Comments
 (0)