From 2b89571233bc937ecde599795eac33a687fe0eb6 Mon Sep 17 00:00:00 2001 From: Willem Pienaar Date: Sat, 29 May 2021 13:46:20 -0700 Subject: [PATCH] Update hooks and documentation building Signed-off-by: Willem Pienaar --- .pre-commit-config.yaml | 5 +++ CONTRIBUTING.md | 18 +++----- infra/netlify/requirements.txt | 39 ---------------- infra/netlify/runtime.txt | 1 - sdk/python/docs/Makefile | 1 - .../source/feast.infra.offline_stores.rst | 45 +++++++++++++++++++ sdk/python/docs/source/feast.infra.rst | 14 ++++-- sdk/python/docs/source/feast.rst | 30 ++++++++----- sdk/python/docs/source/index.rst | 9 +--- .../tensorflow_metadata/proto/v0/path_pb2.py | 2 +- .../proto/v0/schema_pb2.py | 2 +- .../proto/v0/statistics_pb2.py | 2 +- 12 files changed, 91 insertions(+), 77 deletions(-) delete mode 100644 infra/netlify/requirements.txt delete mode 100644 infra/netlify/runtime.txt create mode 100644 sdk/python/docs/source/feast.infra.offline_stores.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47ed7b479c..bc6dcfc6bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,11 @@ default_stages: repos: - repo: local hooks: + - id: format + name: Format + stages: [ push ] + language: system + entry: make format - id: lint name: Lint stages: [ push ] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0e821d202e..95757ccad7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,5 @@ # Development Guide: Main Feast Repository -> The higher level [Development Guide](https://docs.feast.dev/contributing/development-guide) -> gives guidance on contributing to Feast codebase as a whole. +> Please see [Development Guide](https://docs.feast.dev/contributing/development-guide) for project level development instructions. ### Overview This guide is targeted at developers looking to contribute to Feast components in @@ -9,25 +8,20 @@ the main Feast repository: - [Feast Go Client](#feast-go-client) - [Feast Terraform](#feast-terraform) -> Don't see the Feast component that you want to contribute to here? -> Check out the -> [Development Guide](https://docs.feast.dev/contributing/development-guide) -> to learn how Feast components are distributed over multiple repositories. - ### Pre-commit Hooks Setup [`pre-commit`](https://pre-commit.com/) to automatically lint and format the codebase on commit: -1. Ensure that you have Python (3.6 and above) with `pip`, installed. -2. Install `pre-commit` with `pip` & install pre-commit hooks +1. Ensure that you have Python (3.7 and above) with `pip`, installed. +2. Install `pre-commit` with `pip` & install pre-push hooks ```sh pip install pre-commit -pre-commit install +pre-commit install --hook-type pre-push ``` -3. On commit, the pre-commit hook will run. +3. On push, the pre-commit hook will run. This runs `make format` and `make lint`. ## Feast Python SDK / CLI ### Environment Setup Setting up your development environment for Feast Python SDK / CLI: -1. Ensure that you have `make`, Python (3.6 and above) with `pip`, installed. +1. Ensure that you have `make`, Python (3.7 and above) with `pip`, installed. 2. _Recommended:_ Create a virtual environment to isolate development dependencies to be installed ```sh # create & activate a virtual environment diff --git a/infra/netlify/requirements.txt b/infra/netlify/requirements.txt deleted file mode 100644 index 0b7bbac363..0000000000 --- a/infra/netlify/requirements.txt +++ /dev/null @@ -1,39 +0,0 @@ -google-api-core==1.* -google-auth==1.* -google-cloud-bigquery==1.* -google-cloud-bigquery-storage==0.* -google-cloud-storage==1.* -google-resumable-media>=0.5 -googleapis-common-protos==1.* -grpcio==1.* -numpy -mock==2.0.0 -pandas~=1.0.0 -protobuf==3.* -pytest -pytest-mock -pytest-timeout -PyYAML==5.1.2 -fastavro==0.21.* -grpcio-testing==1.* -pytest-ordering==0.6.* -pyarrow -Click==7.* -toml==0.10.* -tqdm==4.* -confluent_kafka -google -pandavro==1.5.* -kafka-python==1.* -tabulate==0.8.* -Sphinx==2.* -sphinx-autodoc-napoleon-typehints -sphinx-autodoc-typehints -sphinx-rtd-theme -sphinxcontrib-applehelp -sphinxcontrib-devhelp -sphinxcontrib-htmlhelp -sphinxcontrib-jsmath -sphinxcontrib-napoleon -sphinxcontrib-qthelp -sphinxcontrib-serializinghtml diff --git a/infra/netlify/runtime.txt b/infra/netlify/runtime.txt deleted file mode 100644 index 548d71365f..0000000000 --- a/infra/netlify/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -3.7 \ No newline at end of file diff --git a/sdk/python/docs/Makefile b/sdk/python/docs/Makefile index d893d893b7..a396b3903b 100644 --- a/sdk/python/docs/Makefile +++ b/sdk/python/docs/Makefile @@ -24,7 +24,6 @@ build-api-source: html: clean-html build-api-source sphinx-build -b html source html - rm -rf $(PROJECT_ROOT)/sdk/python/docs/source # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/sdk/python/docs/source/feast.infra.offline_stores.rst b/sdk/python/docs/source/feast.infra.offline_stores.rst new file mode 100644 index 0000000000..a40c8b115e --- /dev/null +++ b/sdk/python/docs/source/feast.infra.offline_stores.rst @@ -0,0 +1,45 @@ +feast.infra.offline\_stores package +=================================== + +Submodules +---------- + +feast.infra.offline\_stores.bigquery module +------------------------------------------- + +.. automodule:: feast.infra.offline_stores.bigquery + :members: + :undoc-members: + :show-inheritance: + +feast.infra.offline\_stores.file module +--------------------------------------- + +.. automodule:: feast.infra.offline_stores.file + :members: + :undoc-members: + :show-inheritance: + +feast.infra.offline\_stores.helpers module +------------------------------------------ + +.. automodule:: feast.infra.offline_stores.helpers + :members: + :undoc-members: + :show-inheritance: + +feast.infra.offline\_stores.offline\_store module +------------------------------------------------- + +.. automodule:: feast.infra.offline_stores.offline_store + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: feast.infra.offline_stores + :members: + :undoc-members: + :show-inheritance: diff --git a/sdk/python/docs/source/feast.infra.rst b/sdk/python/docs/source/feast.infra.rst index 9e0322c950..63dcb737ec 100644 --- a/sdk/python/docs/source/feast.infra.rst +++ b/sdk/python/docs/source/feast.infra.rst @@ -1,6 +1,14 @@ feast.infra package =================== +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + feast.infra.offline_stores + Submodules ---------- @@ -20,10 +28,10 @@ feast.infra.key\_encoding\_utils module :undoc-members: :show-inheritance: -feast.infra.local\_sqlite module --------------------------------- +feast.infra.local module +------------------------ -.. automodule:: feast.infra.local_sqlite +.. automodule:: feast.infra.local :members: :undoc-members: :show-inheritance: diff --git a/sdk/python/docs/source/feast.rst b/sdk/python/docs/source/feast.rst index ad7a873238..3e1ee90603 100644 --- a/sdk/python/docs/source/feast.rst +++ b/sdk/python/docs/source/feast.rst @@ -79,10 +79,10 @@ feast.entity module :undoc-members: :show-inheritance: -feast.example\_repo module --------------------------- +feast.errors module +------------------- -.. automodule:: feast.example_repo +.. automodule:: feast.errors :members: :undoc-members: :show-inheritance: @@ -127,14 +127,6 @@ feast.names module :undoc-members: :show-inheritance: -feast.offline\_store module ---------------------------- - -.. automodule:: feast.offline_store - :members: - :undoc-members: - :show-inheritance: - feast.online\_response module ----------------------------- @@ -183,6 +175,14 @@ feast.type\_map module :undoc-members: :show-inheritance: +feast.utils module +------------------ + +.. automodule:: feast.utils + :members: + :undoc-members: + :show-inheritance: + feast.value\_type module ------------------------ @@ -191,6 +191,14 @@ feast.value\_type module :undoc-members: :show-inheritance: +feast.version module +-------------------- + +.. automodule:: feast.version + :members: + :undoc-members: + :show-inheritance: + feast.wait module ----------------- diff --git a/sdk/python/docs/source/index.rst b/sdk/python/docs/source/index.rst index 5e6c03b85f..347f45ed73 100644 --- a/sdk/python/docs/source/index.rst +++ b/sdk/python/docs/source/index.rst @@ -15,13 +15,14 @@ Config .. automodule:: feast.repo_config :members: - :exclude-members: load_repo_config + :exclude-members: load_repo_config, FeastBaseModel Data Source ================== .. automodule:: feast.data_source :members: + :exclude-members: KafkaOptions, KafkaSource, KinesisOptions, KinesisSource Entity @@ -38,12 +39,6 @@ Feature View .. automodule:: feast.feature_view :members: -Feature Table -================== - -.. automodule:: feast.feature_table - :members: - Feature ================== diff --git a/sdk/python/tensorflow_metadata/proto/v0/path_pb2.py b/sdk/python/tensorflow_metadata/proto/v0/path_pb2.py index d732119ead..4b6dec828c 100644 --- a/sdk/python/tensorflow_metadata/proto/v0/path_pb2.py +++ b/sdk/python/tensorflow_metadata/proto/v0/path_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow_metadata/proto/v0/path.proto - +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection diff --git a/sdk/python/tensorflow_metadata/proto/v0/schema_pb2.py b/sdk/python/tensorflow_metadata/proto/v0/schema_pb2.py index 78fda8003d..d3bfc50616 100644 --- a/sdk/python/tensorflow_metadata/proto/v0/schema_pb2.py +++ b/sdk/python/tensorflow_metadata/proto/v0/schema_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow_metadata/proto/v0/schema.proto - +"""Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message diff --git a/sdk/python/tensorflow_metadata/proto/v0/statistics_pb2.py b/sdk/python/tensorflow_metadata/proto/v0/statistics_pb2.py index d8e12bd120..21473adc75 100644 --- a/sdk/python/tensorflow_metadata/proto/v0/statistics_pb2.py +++ b/sdk/python/tensorflow_metadata/proto/v0/statistics_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow_metadata/proto/v0/statistics.proto - +"""Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection