-
Notifications
You must be signed in to change notification settings - Fork 17
Fresh setup #198
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
Merged
antoinejeannot
merged 7 commits into
Cornerstone-OnDemand:main
from
antoinejeannot:fresh-setup
Sep 26, 2023
Merged
Fresh setup #198
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c1a06f9
refactor package setup
antoinejeannot 6bf66e3
use bump-my-version for releases
antoinejeannot 737bfb9
improve git & lint workflows
antoinejeannot db7bbd0
refactor dev workflows
antoinejeannot ad32d27
add pre-commit hooks
antoinejeannot 7decbbe
restrict scopes of github workflows
antoinejeannot 358ceb6
refactor dev workflows
antoinejeannot 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
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 |
---|---|---|
|
@@ -76,6 +76,9 @@ output/*/index.html | |
# pytest | ||
.pytest_cache | ||
|
||
# ruff | ||
.ruff_cache | ||
|
||
# tmp files | ||
/tmp/ | ||
/*.json | ||
|
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,47 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
# - id: trailing-whitespace # TODO: enable this | ||
# - id: end-of-file-fixer # TODO: enable this | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
args: ["--target-version", "py38"] | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.0.290' | ||
hooks: | ||
- id: ruff | ||
args: ["--fix"] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.5.1 | ||
hooks: | ||
- id: mypy | ||
types: [python] | ||
args: [] # TODO: enable this: "--check-untyped-defs" | ||
# TODO: narrow tests exclusion down to: ^tests/testdata/typing/*$ | ||
exclude: | | ||
(?x)^( | ||
.vulture.py| | ||
tests/.* | ||
)$ | ||
additional_dependencies: [ | ||
pydantic==1.*, | ||
types-python-dateutil, | ||
types-requests, | ||
types-urllib3, | ||
types-redis, | ||
types-cachetools, | ||
types-tabulate | ||
] | ||
|
||
- repo: https://github.com/jendrikseipp/vulture | ||
rev: v2.9.1 | ||
hooks: | ||
- id: vulture | ||
args: ["--min-confidence", "90", "modelkit", "bin", ".vulture.py"] |
Empty file.
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,3 @@ | ||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
recursive-exclude tests * |
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,60 @@ | ||
SHELL := /bin/bash | ||
.SHELLFLAGS := -e -x -c -o pipefail | ||
.PHONY: setup setup_lint lint tests coverage ci_tests requirements upgrade | ||
|
||
setup_lint: | ||
pip install --upgrade pip pre-commit | ||
pre-commit install | ||
|
||
lint: | ||
pre-commit run --all-files | ||
|
||
tests: | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
pytest | ||
|
||
coverage: | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
coverage run -m pytest; \ | ||
coverage report -m; \ | ||
coverage xml | ||
|
||
setup: | ||
pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
pip install -e .[lint,tensorflow,cli,api,assets-s3,assets-gcs,assets-az] | ||
pre-commit install | ||
|
||
ci_tests: | ||
pip install --upgrade pip nox | ||
@if [ "$(OS_NAME)" = "ubuntu-latest" ]; then \ | ||
export ENABLE_TF_SERVING_TEST=True; \ | ||
export ENABLE_TF_TEST=True; \ | ||
export ENABLE_REDIS_TEST=True; \ | ||
export ENABLE_S3_TEST=True; \ | ||
export ENABLE_GCS_TEST=True; \ | ||
export ENABLE_AZ_TEST=True; \ | ||
nox --error-on-missing-interpreters -s "coverage-$(PYTHON_VERSION)"; \ | ||
else \ | ||
nox --error-on-missing-interpreters -s "tests-$(PYTHON_VERSION)"; \ | ||
fi | ||
|
||
requirements: | ||
pip install --upgrade pip pip-compile | ||
pip-compile --extra=dev --output-file=requirements-dev.txt | ||
|
||
upgrade: | ||
pip install --upgrade pip pip-tools pre-commit | ||
pre-commit autoupdate | ||
pip-compile --upgrade --extra=dev --output-file=requirements-dev.txt | ||
pip install -r requirements-dev.txt |
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
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.