mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Swift: teach bazel to install python dependencies
This commit is contained in:
7
.github/workflows/swift-codegen.yml
vendored
7
.github/workflows/swift-codegen.yml
vendored
@@ -15,13 +15,6 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/fetch-codeql
|
||||
- uses: bazelbuild/setup-bazelisk@v2
|
||||
- uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '~3.8'
|
||||
cache: 'pip'
|
||||
- name: Install python dependencies
|
||||
run: |
|
||||
pip install -r swift/codegen/requirements.txt
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
bazel test //swift/codegen/test --test_output=errors
|
||||
|
||||
7
.github/workflows/swift-qltest.yml
vendored
7
.github/workflows/swift-qltest.yml
vendored
@@ -29,13 +29,6 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/fetch-codeql
|
||||
- uses: bazelbuild/setup-bazelisk@v2
|
||||
- uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '~3.8'
|
||||
cache: 'pip'
|
||||
- name: Install python dependencies
|
||||
run: |
|
||||
pip install -r codegen/requirements.txt
|
||||
- name: Build Swift extractor
|
||||
run: |
|
||||
bazel run //swift:create-extractor-pack
|
||||
|
||||
@@ -45,3 +45,14 @@ def codeql_workspace(repository_name = "codeql"):
|
||||
"https://github.com/bazelbuild/platforms/releases/download/0.0.3/platforms-0.0.3.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
maybe(
|
||||
repo_rule = http_archive,
|
||||
name = "rules_python",
|
||||
sha256 = "cdf6b84084aad8f10bf20b46b77cb48d83c319ebe6458a18e9d2cebf57807cdd",
|
||||
strip_prefix = "rules_python-0.8.1",
|
||||
urls = [
|
||||
"https://github.com/bazelbuild/rules_python/archive/refs/tags/0.8.1.tar.gz",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
|
||||
load("@rules_python//python:pip.bzl", "pip_install")
|
||||
|
||||
def codeql_workspace_deps():
|
||||
def codeql_workspace_deps(repository_name = "codeql"):
|
||||
pip_install(
|
||||
name = "swift_codegen_deps",
|
||||
requirements = "@%s//swift/codegen:requirements.txt" % repository_name,
|
||||
)
|
||||
rules_pkg_dependencies()
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
load("@swift_codegen_deps//:requirements.bzl", "requirement")
|
||||
py_library(
|
||||
name = "lib",
|
||||
srcs = glob(["*.py"]),
|
||||
deps = [
|
||||
requirement("pystache"),
|
||||
requirement("pyyaml"),
|
||||
requirement("inflection"),
|
||||
],
|
||||
visibility = ["//swift/codegen:__subpackages__"],
|
||||
)
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
load("@swift_codegen_deps//:requirements.bzl", "requirement")
|
||||
|
||||
py_library(
|
||||
name = "utils",
|
||||
testonly = True,
|
||||
srcs = ["utils.py"],
|
||||
deps = ["//swift/codegen/lib"],
|
||||
deps = [
|
||||
"//swift/codegen/lib",
|
||||
requirement("pytest"),
|
||||
],
|
||||
)
|
||||
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user