-
Notifications
You must be signed in to change notification settings - Fork 179
CI Linting #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewfulton9
wants to merge
26
commits into
tensorflow:master
Choose a base branch
from
andrewfulton9:ci_lint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CI Linting #267
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
d091052
add testing workflow
aktech 867f1a5
single python
aktech 3bac60c
trigger
aktech 87d8bfe
install in build job
aktech 0d8c14b
install pytest
aktech 619e800
install test dependencies
aktech dfa6ea2
add xfail to tests
aktech bb45d3f
add reusable workflows and add pr number in xfail
aktech d0a177a
fix composite action
aktech eae0818
add more xfails
aktech 1e4d94c
xfail top_k_uniques_stats_generator_test.py
aktech 1f1c584
xfails in partitioned_stats_generator_test.py
aktech 53beec9
more xfails
aktech d39ccbd
add missing imports
aktech 57c1e5b
fix extra decorators
aktech da5b290
more xfails
aktech 703684a
Merge branch 'master' into testing-workflow
aktech ec7c05b
use xfail instead of skip
aktech 94c6af2
remove xfails that are passing
aktech ec0e02a
dont run xfail + add test deps
aktech 5f41842
fix build failure by pinning tensorflow_metadata
andrewfulton9 7438b3c
update setup.py to current build
andrewfulton9 ea9f097
adds linting configuration and workflow
andrewfulton9 58bee19
linting
andrewfulton9 f67374f
update error codes
andrewfulton9 498e8e5
reformat linting ignore rules
andrewfulton9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Resusable steps to build data-validation | ||
|
||
inputs: | ||
python-version: | ||
description: 'Python version' | ||
required: true | ||
upload-artifact: | ||
description: 'Should upload build artifact or not' | ||
default: false | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Build the package for Python ${{ inputs.python-version }} | ||
shell: bash | ||
run: | | ||
version="${{ matrix.python-version }}" | ||
docker compose run -e PYTHON_VERSION=$(echo "$version" | sed 's/\.//') manylinux2010 | ||
|
||
- name: Upload wheel artifact for Python ${{ matrix.python-version }} | ||
if: ${{ inputs.upload-artifact == 'true' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: data-validation-wheel-py${{ matrix.python-version }} | ||
path: dist/*.whl | ||
|
||
- name: Install built wheel | ||
shell: bash | ||
run: | | ||
pip install twine | ||
twine check dist/* | ||
pip install dist/*.whl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build data-validation | ||
id: build-data-validation | ||
uses: ./.github/reusable-build | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
upload-artifact: true | ||
|
||
upload_to_pypi: | ||
name: Upload to PyPI | ||
runs-on: ubuntu-latest | ||
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch') | ||
needs: [build] | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/tensorflow-data-validation/ | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Retrieve wheels | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
path: wheels | ||
|
||
- name: List the build artifacts | ||
run: | | ||
ls -lAs wheels/ | ||
|
||
- name: Upload to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.9 | ||
with: | ||
packages_dir: wheels/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
# Ensure the full history is fetched | ||
# This is required to run pre-commit on a specific set of commits | ||
# TODO: Remove this when all the pre-commit issues are fixed | ||
fetch-depth: 0 | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: 3.13 | ||
- uses: pre-commit/[email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build data-validation | ||
id: build-data-validation | ||
uses: ./.github/reusable-build | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install test dependencies | ||
run: | | ||
pip install pytest scikit-learn scipy | ||
|
||
- name: Run Test | ||
run: | | ||
rm -rf bazel-* | ||
# run tests | ||
pytest -vv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,4 +126,4 @@ dmypy.json | |
.pyre/ | ||
|
||
# pb2.py files | ||
*_pb2.py | ||
*_pb2.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# pre-commit is a tool to perform a predefined set of tasks manually and/or | ||
# automatically before git commits are made. | ||
# | ||
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level | ||
# | ||
# Common tasks | ||
# | ||
# - Register git hooks: pre-commit install --install-hooks | ||
# - Run on all files: pre-commit run --all-files | ||
# | ||
# These pre-commit hooks are run as CI. | ||
# | ||
# NOTE: if it can be avoided, add configs/args in pyproject.toml or below instead of creating a new `.config.file`. | ||
# https://pre-commit.ci/#configuration | ||
ci: | ||
autoupdate_schedule: monthly | ||
autofix_commit_msg: | | ||
[pre-commit.ci] Apply automatic pre-commit fixes | ||
|
||
repos: | ||
# general | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
exclude: '\.svg$' | ||
- id: trailing-whitespace | ||
exclude: '\.svg$' | ||
- id: check-json | ||
- id: check-yaml | ||
args: [--allow-multiple-documents, --unsafe] | ||
- id: check-toml | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.5.6 | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
- id: ruff-format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.