generated from automl/automl_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b922853
commit 598a089
Showing
37 changed files
with
208 additions
and
1,069 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains 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 |
---|---|---|
|
@@ -20,7 +20,7 @@ permissions: | |
contents: write | ||
|
||
env: | ||
name: <<name>> | ||
name: mf-prior-bench | ||
|
||
jobs: | ||
build-and-deploy: | ||
|
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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,38 @@ | ||
# If you see me, please update my `rev` field using the provided links | ||
# Click the repo and update to latest tags. | ||
# If things break on update, raise an issue | ||
repos: | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
name: isort imports mfp_bench | ||
files: mfp_bench | ||
|
||
- id: isort | ||
name: isort imports tests | ||
files: tests | ||
|
||
- repo: https://github.com/ambv/black | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black | ||
name: black formatter mfp_bench | ||
files: mfp_bench | ||
|
||
- id: black | ||
name: black formatter tests | ||
files: tests | ||
|
||
- id: black | ||
name: black formatter examples | ||
files: examples | ||
|
||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.1.1 | ||
hooks: | ||
- id: pydocstyle | ||
files: mfp_bench | ||
additional_dependencies: ["toml"] # Needed to parse pyproject.toml | ||
|
||
|
File renamed without changes.
This file contains 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 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,120 @@ | ||
# These have been configured to only really run short tasks. Longer form tasks | ||
# are usually completed in github actions. | ||
|
||
NAME := mf-prior-bench | ||
PACKAGE_NAME := mfp_bench | ||
|
||
DIR := "${CURDIR}" | ||
SOURCE_DIR := ${PACKAGE_NAME} | ||
DIST := dist | ||
DOCDIR := docs | ||
INDEX_HTML := "file://${DIR}/docs/build/html/index.html" | ||
EXAMPLES_DIR := examples | ||
TESTS_DIR := tests | ||
|
||
.PHONY: help install-dev check format pre-commit clean docs clean-doc examples clean-build build publish test | ||
|
||
help: | ||
@echo "Makefile ${NAME}" | ||
@echo "* install-dev to install all dev requirements and install pre-commit" | ||
@echo "* clean to clean any doc or build files" | ||
@echo "* check to check the source code for issues" | ||
@echo "* format to format the code with black and isort" | ||
@echo "* pre-commit to run the pre-commit check" | ||
@echo "* build to build a dist" | ||
@echo "* docs to generate and view the html files, checks links" | ||
@echo "* examples to run and generate the examples" | ||
@echo "* publish to help publish the current branch to pypi" | ||
@echo "* test to run the tests" | ||
|
||
PYTHON ?= python | ||
PYTEST ?= python -m pytest | ||
PIP ?= python -m pip | ||
MAKE ?= make | ||
BLACK ?= black | ||
ISORT ?= isort | ||
PYDOCSTYLE ?= pydocstyle | ||
PRECOMMIT ?= pre-commit | ||
install-dev: | ||
$(PIP) install -e ".[dev]" | ||
pre-commit install | ||
|
||
check-black: | ||
$(BLACK) ${SOURCE_DIR} --check || : | ||
$(BLACK) ${EXAMPLES_DIR} --check || : | ||
$(BLACK) ${TESTS_DIR} --check || : | ||
|
||
check-isort: | ||
$(ISORT) ${SOURCE_DIR} --check || : | ||
$(ISORT) ${TESTS_DIR} --check || : | ||
|
||
check-pydocstyle: | ||
$(PYDOCSTYLE) ${SOURCE_DIR} || : | ||
|
||
check: check-black check-isort check-pydocstyle | ||
|
||
pre-commit: | ||
$(PRECOMMIT) run --all-files | ||
|
||
format-black: | ||
$(BLACK) ${SOURCE_DIR} | ||
$(BLACK) ${TESTS_DIR} | ||
$(BLACK) ${EXAMPLES_DIR} | ||
|
||
format-isort: | ||
$(ISORT) ${SOURCE_DIR} | ||
$(ISORT) ${TESTS_DIR} | ||
|
||
format: format-black format-isort | ||
|
||
test: | ||
$(PYTEST) ${TESTS_DIR} | ||
|
||
clean-doc: | ||
$(MAKE) -C ${DOCDIR} clean | ||
|
||
docs: | ||
$(MAKE) -C ${DOCDIR} docs | ||
@echo | ||
@echo "View docs at:" | ||
@echo ${INDEX_HTML} | ||
|
||
examples: | ||
$(MAKE) -C ${DOCDIR} examples | ||
@echo | ||
@echo "View docs at:" | ||
@echo ${INDEX_HTML} | ||
|
||
clean-build: | ||
$(PYTHON) setup.py clean | ||
rm -rf ${DIST} | ||
|
||
# Build a distribution in ./dist | ||
build: | ||
$(PYTHON) setup.py sdist | ||
|
||
# Publish to testpypi | ||
# Will echo the commands to actually publish to be run to publish to actual PyPi | ||
# This is done to prevent accidental publishing but provide the same conveniences | ||
publish: clean build | ||
read -p "Did you update the version number?" | ||
|
||
$(PIP) install twine | ||
$(PYTHON) -m twine upload --repository testpypi ${DIST}/* | ||
@echo | ||
@echo "Test with the following:" | ||
@echo "* Create a new virtual environment to install the uplaoded distribution into" | ||
@echo "* Run the following:" | ||
@echo | ||
@echo " pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ${NAME}" | ||
@echo | ||
@echo "* Run this to make sure it can import correctly, plus whatever else you'd like to test:" | ||
@echo | ||
@echo " python -c 'import ${PACKAGE_NAME}'" | ||
@echo | ||
@echo "Once you have decided it works, publish to actual pypi with" | ||
@echo | ||
@echo " python -m twine upload dist/*" | ||
|
||
# Clean up any builds in ./dist as well as doc, if present | ||
clean: clean-build clean-doc |
Oops, something went wrong.