Skip to content

Commit

Permalink
copy 3p stubs example from fwingerter-Ocient/bazel-mypy-pypi-example
Browse files Browse the repository at this point in the history
Repro for #39
  • Loading branch information
alexeagle committed May 6, 2022
1 parent 2351b78 commit afb77df
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ jobs:
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v2

- name: Setup Bazel
uses: abhinavsingh/setup-bazel@v3
with:
# Must match version in repo's .bazelversion file.
version: 5.1.0

- name: Run tests
run: ./test.sh
- name: Check examples
working-directory: examples
run: bazel test //...
3 changes: 1 addition & 2 deletions examples/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
build --aspects //tools/linting:aspect.bzl%lint
build --output_groups=+report
test --test_output=errors
15 changes: 15 additions & 0 deletions examples/third_party/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@my_deps//:requirements.bzl", "requirement")
load("@mypy_integration//:mypy.bzl", "mypy_test")

py_binary(
name = "uses-deps",
srcs = ["uses-deps.py"],
deps = [
requirement("types_python_dateutil"),
],
)

mypy_test(
name = "uses_deps_mypy",
deps = [":uses-deps"],
)
4 changes: 3 additions & 1 deletion examples/third_party/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
parse==1.12.1
parse==1.12.1
types-python-dateutil==0.1.4

4 changes: 4 additions & 0 deletions examples/third_party/uses-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import dateutil
from dateutil import parser

dateutil.parser.parse("1970")
3 changes: 2 additions & 1 deletion examples/tools/typing/mypy_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mypy==0.750
mypy==0.910
typed_ast

0 comments on commit afb77df

Please sign in to comment.