Skip to content

Commit

Permalink
Fix CI components (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
jashparekh authored Oct 9, 2023
1 parent bc4208c commit 937654a
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 83 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Run mypy
uses: jashparekh/mypy-action@a4eb0d0a6f3dca7c6f03d7723f0f1cf12091fa19 # v3
with:
path: 'gbq tests'
path: "gbq"

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -147,6 +147,14 @@ jobs:
with:
package-import-name: "gbq"

build-devbox-image:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Build devbox image
run: "docker-compose build devbox"

build-docs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Expand Down
17 changes: 7 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ version: '3.4'

x-mount-app-and-user-git-config: &mount-app-and-user-git-config
volumes:
- ./:/app
- ~/.gitconfig:/home/gbq/.gitconfig # allow script to commit as user
- "./:/app"
- "~/.gitconfig:/home/gbq/.gitconfig" # allow script to commit as user

services:

Expand All @@ -16,10 +16,9 @@ services:
stdin_open: true # docker run -i
tty: true # docker run -t
volumes:
- ./:/app
- "./:/app"

# run all the tests and linting locally
# - black & isort will format code to address issues
# Run the test & lint suite in a dedicated container
test:
<<: *devbox
command: "docker/run_tests.sh --format-code"
Expand All @@ -38,11 +37,9 @@ services:
command: [ "serve", "--dev-addr=0.0.0.0:8000" ]

mike:
<<: *mkdocs
<<: *mount-app-and-user-git-config
<<: [ *mkdocs, *mount-app-and-user-git-config ]
entrypoint: "mike"

bump:
<<: *devbox
<<: *mount-app-and-user-git-config
entrypoint: docker/bump_version.sh
<<: [ *devbox, *mount-app-and-user-git-config ]
entrypoint: "docker/bump_version.sh"
2 changes: 1 addition & 1 deletion docker/devbox.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ USER ${_USER}
COPY --chown=${UID}:${GID} ./requirements* /app/
WORKDIR /app

RUN pip install -r requirements.txt -r requirements-test.txt -r requirements-docs.txt
RUN pip install -r requirements.lock -r requirements-test.txt -r requirements-docs.txt

CMD bash
8 changes: 4 additions & 4 deletions docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pytest tests --cov-report html
echo "Running autoflake..."
autoflake -irv --remove-all-unused-import gbq tests

echo "Running iSort..."
echo "Running isort..."
isort ${ISORT_ACTION} gbq tests

echo "Running black..."
Expand All @@ -49,8 +49,8 @@ black ${BLACK_ACTION} gbq tests
echo "Running flake8..."
flake8 gbq tests

echo "Running MyPy..."
mypy gbq tests
echo "Running mypy..."
mypy gbq

echo "Running bandit..."
bandit --ini .bandit --quiet -r gbq
bandit --ini .bandit --quiet -r gbq
2 changes: 1 addition & 1 deletion gbq/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _get_structure(json_schema: Union[Dict, List[Dict]]) -> Structure:
if isinstance(json_schema, dict):
return Structure(**json_schema)
elif isinstance(json_schema, list):
return Structure(**{"schema": json_schema})
return Structure(**{"schema": json_schema}) # type: ignore[arg-type]

return # type: ignore

Expand Down
28 changes: 14 additions & 14 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# THIS IS AN AUTOGENERATED LOCKFILE. DO NOT EDIT MANUALLY.
cachetools==5.2.0
certifi==2022.12.7
charset-normalizer==2.1.1
cachetools==5.3.1
certifi==2023.7.22
charset-normalizer==3.3.0
click==8.1.3
dataclasses==0.6
google-api-core==2.11.0
Expand All @@ -11,22 +11,22 @@ google-cloud-core==2.3.2
google-crc32c==1.5.0
google-resumable-media==2.4.0
googleapis-common-protos==1.57.0
grpcio==1.51.1
grpcio-status==1.51.1
grpcio==1.59.0
grpcio-status==1.59.0
idna==3.4
packaging==21.3
pip==22.2.1
proto-plus==1.22.1
protobuf==4.21.12
pyasn1==0.4.8
pyasn1-modules==0.2.8
pydantic==1.10.2
pyparsing==3.0.9
proto-plus==1.22.3
protobuf==4.24.4
pyasn1==0.5.0
pyasn1-modules==0.3.0
pydantic==1.10.4
pyparsing==3.1.1
python-dateutil==2.8.2
requests==2.28.1
requests==2.31.0
rsa==4.9
setuptools==63.2.0
six==1.16.0
typing_extensions==4.4.0
urllib3==1.26.13
typing_extensions==4.5.0
urllib3==2.0.6
wheel==0.37.1
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ python_requires = >=3.8
install_requires =
typing_extensions~=4.3; python_version < '3.8'
google-cloud-bigquery
pydantic
pydantic<2
packages = find:

[options.package_data]
Expand Down

0 comments on commit 937654a

Please sign in to comment.