From 0c4cf1e49761a27806e498e2dd8257a749207800 Mon Sep 17 00:00:00 2001 From: Young Joon Lee Date: Wed, 1 Mar 2023 04:38:29 +0000 Subject: [PATCH] feat: initial version --- .copier-config.yaml | 25 ++- .github/workflows/deploy-docs.yaml | 7 - .github/workflows/lint_and_test.yaml | 7 - .../workflows/prerelease-to-test-pypi.yaml | 7 - .github/workflows/prerelease.yaml | 7 - .github/workflows/release-patch.yaml | 7 - .github/workflows/release-test.yaml | 7 - .github/workflows/release.yaml | 7 - .gitignore | 7 - .readthedocs.yaml | 24 +++ .version | 1 + CHANGELOG.md | 111 ------------- CONTRIBUTING.md | 8 +- Makefile | 9 +- README.md | 148 +++--------------- book/_config.yml | 79 ++++++++++ book/_toc.yml | 9 ++ book/api.md | 1 + book/examples.md | 34 ++++ book/index.md | 53 +++++++ book/logo.png | Bin 0 -> 9854 bytes book/references.bib | 3 + book/requirements.txt | 8 + book/usage.md | 1 + docs/api.md | 1 + docs/index.md | 8 + docs/requirements.txt | 4 + docs/usage.md | 1 + mkdocs.yaml | 11 ++ pyproject.toml | 12 +- src/hyfi/__cli__.py | 15 ++ src/hyfi/__init__.py | 6 + src/hyfi/_version.py | 1 + src/hyfi/py.typed | 0 tests/hyfi/test_cli.py | 22 +++ tests/hyfi/test_init.py | 12 ++ 36 files changed, 339 insertions(+), 324 deletions(-) create mode 100644 .readthedocs.yaml create mode 100644 .version create mode 100644 book/_config.yml create mode 100644 book/_toc.yml create mode 100644 book/api.md create mode 100644 book/examples.md create mode 100644 book/index.md create mode 100644 book/logo.png create mode 100644 book/references.bib create mode 100644 book/requirements.txt create mode 100644 book/usage.md create mode 100644 docs/api.md create mode 100644 docs/index.md create mode 100644 docs/requirements.txt create mode 100644 docs/usage.md create mode 100644 mkdocs.yaml create mode 100644 src/hyfi/__cli__.py create mode 100644 src/hyfi/__init__.py create mode 100644 src/hyfi/_version.py create mode 100644 src/hyfi/py.typed create mode 100644 tests/hyfi/test_cli.py create mode 100644 tests/hyfi/test_init.py diff --git a/.copier-config.yaml b/.copier-config.yaml index 8b10980a..b5fdc9ec 100644 --- a/.copier-config.yaml +++ b/.copier-config.yaml @@ -1,21 +1,20 @@ # Changes here will be overwritten by Copier; do NOT edit manually -_commit: v0.1.3 -_src_path: . +_commit: v0.1.9 +_src_path: gh:entelecheia/hyperfast-python-template author: Young Joon Lee copyright_year: 2023 documentaion_tool: jupyter-book -documentation_url: https://hyperfast-python.entelecheia.cc +documentation_url: https://hyfi.entelecheia.cc email: entelecheia@hotmail.com -friendly_name: Hyperfast Python Template -github_repo_name: hyperfast-python-template +friendly_name: 'HyFI: Hydra Fast Interface' +github_repo_name: hyfi github_username: entelecheia -package_name: hyperfastpy -project_description: Hyperfast Python Template is a self-contained template that helps - you initialize your Python project inside the template. It is hyperfast in the - sense that the template itself is converted into a Python project in the blink - of an eye. It is also hyperfast in the sense that it helps you jump start your - project with the best practices in the Python community. +package_name: hyfi +project_description: HyFI is a framework for building interfaces for Python applications. + It is based on [Hydra] and [Pydantic] and provides a set of tools to build interfaces + for Python applications. project_license: MIT -project_name: hyperfast-python-template -project_short_description: A python template that helps you jump start your project +project_name: hyfi +project_short_description: Hydra Fast Interface (Hydra and Pydantic based interface + framework) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 79ecefba..b3ee8456 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -20,13 +20,6 @@ jobs: steps: - uses: actions/checkout@v3 - # init project - - name: Init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - - uses: actions/setup-python@v4 with: python-version: 3.x diff --git a/.github/workflows/lint_and_test.yaml b/.github/workflows/lint_and_test.yaml index a083c114..275c1039 100644 --- a/.github/workflows/lint_and_test.yaml +++ b/.github/workflows/lint_and_test.yaml @@ -29,13 +29,6 @@ jobs: with: fetch-depth: 0 - # init project - - name: Init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # install poetry - name: Install poetry run: pipx install poetry>=1.3.2 diff --git a/.github/workflows/prerelease-to-test-pypi.yaml b/.github/workflows/prerelease-to-test-pypi.yaml index 25f89e50..11c97b5d 100644 --- a/.github/workflows/prerelease-to-test-pypi.yaml +++ b/.github/workflows/prerelease-to-test-pypi.yaml @@ -29,13 +29,6 @@ jobs: with: fetch-depth: 0 - # install copier and init project - - name: Install copier and init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # set env variable - name: Set env variable run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV diff --git a/.github/workflows/prerelease.yaml b/.github/workflows/prerelease.yaml index eda6ca42..185c4c09 100644 --- a/.github/workflows/prerelease.yaml +++ b/.github/workflows/prerelease.yaml @@ -36,13 +36,6 @@ jobs: with: fetch-depth: 0 - # install copier and init project - - name: Install copier and init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # set env variable - name: Set env variable run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV diff --git a/.github/workflows/release-patch.yaml b/.github/workflows/release-patch.yaml index 6f6bbde7..e82f3912 100644 --- a/.github/workflows/release-patch.yaml +++ b/.github/workflows/release-patch.yaml @@ -32,13 +32,6 @@ jobs: with: fetch-depth: 0 - # install copier and init project - - name: Install copier and init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # set env variable - name: Set env variable run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV diff --git a/.github/workflows/release-test.yaml b/.github/workflows/release-test.yaml index 98edd54e..b7416f2b 100644 --- a/.github/workflows/release-test.yaml +++ b/.github/workflows/release-test.yaml @@ -31,13 +31,6 @@ jobs: with: fetch-depth: 0 - # install copier and init project - - name: Install copier and init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # set env variable - name: Set env variable run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0e39b32c..881b9450 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -32,13 +32,6 @@ jobs: with: fetch-depth: 0 - # install copier and init project - - name: Install copier and init project - if: github.repository == 'entelecheia/hyperfast-python-template' - run: | - pipx install copier>=7.0.0 - make reinit-project-force - # set env variable - name: Set env variable run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index c8eb442d..eb92d80f 100644 --- a/.gitignore +++ b/.gitignore @@ -25,10 +25,3 @@ coverage.xml htmlcov/ pytest-coverage.* -# for template test -src/hyperfastpy/ -tests/hyperfastpy/ -/book/ -/docs/ -/mkdocs.yaml -/.readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..a9a8fc0d --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,24 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.10" + jobs: + pre_build: + # Generate on-the-fly Sphinx configuration from Jupyter Book's _config.yml + - "jupyter-book config sphinx docs/" + +formats: + - pdf + - epub +# Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: docs/requirements.txt diff --git a/.version b/.version new file mode 100644 index 00000000..bcb7623c --- /dev/null +++ b/.version @@ -0,0 +1 @@ +VERSION=0.0.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index df190790..61f3ce43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,112 +1 @@ - -## v0.1.8 (2023-02-27) -### Fix -* Docs requirements.txt ([`7404bb4`](https://github.com/entelecheia/hyperfast-python-template/commit/7404bb46d5205957a02c7497dcd3e93df29b2f66)) - -## v0.1.7 (2023-02-27) -### Fix -* README template ext ([`c3a26ce`](https://github.com/entelecheia/hyperfast-python-template/commit/c3a26ceadae4fd4936e20d376d1b7530ff1f8f80)) - -### Documentation -* Update README ([`6233d2d`](https://github.com/entelecheia/hyperfast-python-template/commit/6233d2d3b1206cae51b2942c31e7acebabb45e9c)) -* Add google analytics ([`0d72551`](https://github.com/entelecheia/hyperfast-python-template/commit/0d7255182e4fe341db9f91693afaf93c48feebad)) - -## v0.1.6 (2023-02-24) -### Fix -* Github action templates ([`d3eadb0`](https://github.com/entelecheia/hyperfast-python-template/commit/d3eadb04c3514c55668f9d46934fab2ae97e2ae0)) - -## v0.1.5 (2023-02-24) -### Fix -* Index of mkdocs template ([`40a1d0e`](https://github.com/entelecheia/hyperfast-python-template/commit/40a1d0e0cefde85843fca78860b738288cd636ae)) - -## v0.1.4 (2023-02-24) -### Fix -* Makefile ([`56c76a4`](https://github.com/entelecheia/hyperfast-python-template/commit/56c76a42de67a646efc77e0de4cb096a22ec7ffb)) - -## v0.1.3 (2023-02-24) -### Fix -* Release actions ([`4412d46`](https://github.com/entelecheia/hyperfast-python-template/commit/4412d46a93cbdec94215a84a4313fa4fb0ac2fdb)) - -## v0.1.2 (2023-02-24) -### Fix -* Release actions ([`cbb191d`](https://github.com/entelecheia/hyperfast-python-template/commit/cbb191df537ae6ca40524f443ad3d77d31dcefa5)) - -## v0.1.2-rc.2 (2023-02-24) - - -## v0.1.2-rc.1 (2023-02-24) - - -## v0.1.1 (2023-02-24) -### Fix -* Add CNAME github variable for gh-pages action ([`535401d`](https://github.com/entelecheia/hyperfast-python-template/commit/535401de5aa5c0e956790addcdf2ee63c0464370)) - -## v0.1.0 (2023-02-24) -### Feature -* Initial version ([`323d59b`](https://github.com/entelecheia/hyperfast-python-template/commit/323d59bfc75e7527653f22338ee7f16c268478ed)) - -### Documentation -* Update README ([`0dbeddf`](https://github.com/entelecheia/hyperfast-python-template/commit/0dbeddf1c8e07371a48d34bdc466ba3ad09c262f)) -* Update README ([`6f21e8b`](https://github.com/entelecheia/hyperfast-python-template/commit/6f21e8b7bfdd512ead7e9b709dcd35d54e50f4e4)) - -## v0.0.1-rc.18 (2023-02-24) - - -## v0.0.1-rc.17 (2023-02-24) - - -## v0.0.1-rc.16 (2023-02-24) - - -## v0.0.1-rc.15 (2023-02-24) - - -## v0.0.1-rc.14 (2023-02-20) - - -## v0.0.1-rc.13 (2023-02-20) -### Documentation -* **jupyter-book:** Add templates for jupyter-book ([`eb10902`](https://github.com/entelecheia/hyperfast-python-template/commit/eb10902285cecf903add44efdeb4548d5eef5556)) - -## v0.0.1-rc.12 (2023-02-20) -### Documentation -* **mkdocs:** Add mkdocs template ([`2016814`](https://github.com/entelecheia/hyperfast-python-template/commit/201681498c2242518c77eaf089b06e49ad1ecfd0)) -* **readme:** Add explanation ([`61e072e`](https://github.com/entelecheia/hyperfast-python-template/commit/61e072e929a289f59def43130ba03c77ba247406)) - -## v0.0.1-rc.11 (2023-02-20) - - -## v0.0.1-rc.10 (2023-02-20) -### Documentation -* **readme:** Update README ([`72b3b4b`](https://github.com/entelecheia/hyperfast-python-template/commit/72b3b4b5e00392bc1ffcc8519a6ee72e8696c9ea)) -* **conduct:** Add code of conduct ([`b82c6c9`](https://github.com/entelecheia/hyperfast-python-template/commit/b82c6c9bcf6c0348eaba5065b973553b92b3d94e)) - -## v0.0.1-rc.9 (2023-02-19) - - -## v0.0.1-rc.8 (2023-02-19) -### Fix -* **test:** Add github step summary ([`0134591`](https://github.com/entelecheia/pypi-template/commit/0134591c4d6b815843110ad8cbe2f4974c893ff8)) - -## v0.0.1-rc.7 (2023-02-17) -### Fix -* **tests:** Add test codes and related configs ([`9125ccd`](https://github.com/entelecheia/pypi-template/commit/9125ccd2c41af688283b3d5bc53669e2dfda0a9c)) - -## v0.0.1-rc.6 (2023-02-17) - - -## v0.0.1-rc.5 (2023-02-17) - - -## v0.0.1-rc.4 (2023-02-17) - - -## v0.0.1-rc.3 (2023-02-17) - - -## v0.0.1-rc.2 (2023-02-17) - - -## v0.0.1-rc.1 (2023-02-17) - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6c6ec50..ef1f3520 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,8 +25,8 @@ and "help wanted" is open to whoever wants to implement it. ## Write Documentation -Hyperfast Python Template could always use more documentation, whether as part of the -official Hyperfast Python Template docs, in docstrings, or even on the web in blog posts, +HyFI: Hydra Fast Interface could always use more documentation, whether as part of the +official HyFI: Hydra Fast Interface docs, in docstrings, or even on the web in blog posts, articles, and such. ## Submit Feedback @@ -42,7 +42,7 @@ If you are proposing a feature: ## Get Started -Ready to contribute? Here's how to set up `Hyperfast Python Template` for local development. +Ready to contribute? Here's how to set up `HyFI: Hydra Fast Interface` for local development. 1. Fork the repo on GitHub. 2. Clone your fork locally. @@ -52,4 +52,4 @@ Ready to contribute? Here's how to set up `Hyperfast Python Template` for local ## Code of Conduct -Please note that the Hyperfast Python Template project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms. +Please note that the HyFI: Hydra Fast Interface project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project you agree to abide by its terms. diff --git a/Makefile b/Makefile index 57a7746a..0a770975 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ lint: lint-black lint-isort lint-flake8 lint-mypy ## run all linters .PHONY: run run: ## run the main script - @poetry run hyperfastpy + @poetry run hyfi ##@ Testing @@ -191,10 +191,11 @@ remove-template: ## remove the template files (Warning: if you do this, you can' @rm -rf .copier-template init-project: install-copier install-precommit-hooks ## initialize the project (Warning: do this only once!) - @copier gh:entelecheia/hyperfast-template . + @copier gh:entelecheia/hyperfast-python-template . init-git: ## initialize git @git init -reinit-project-force: install-copier ## initialize the project ignoring existing files (*Warning* this will overwrite existing files!) - @copier --answers-file .copier-config.yaml --force --vcs-ref=HEAD . . + +reinit-project: install-copier ## reinitialize the project + @copier --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template . diff --git a/README.md b/README.md index 9eb5477c..7c0fbb51 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Hyperfast Python Template +# HyFI: Hydra Fast Interface [![license-image]][license-url] [![version-image]][release-url] @@ -7,142 +7,30 @@ [![jupyter-book-image]][jupyter book] -[hyperfast python template]: https://github.com/entelecheia/hyperfast-python-template - -[license-image]: https://img.shields.io/github/license/entelecheia/hyperfast-python-template -[license-url]: https://github.com/entelecheia/hyperfast-python-template/blob/main/LICENSE -[version-image]: https://img.shields.io/github/v/release/entelecheia/hyperfast-python-template?sort=semver -[release-date-image]: https://img.shields.io/github/release-date/entelecheia/hyperfast-python-template -[release-url]: https://github.com/entelecheia/hyperfast-python-template/releases +[license-image]: https://img.shields.io/github/license/entelecheia/hyfi +[license-url]: https://github.com/entelecheia/hyfi/blob/main/LICENSE +[version-image]: https://img.shields.io/github/v/release/entelecheia/hyfi?sort=semver +[release-date-image]: https://img.shields.io/github/release-date/entelecheia/hyfi +[release-url]: https://github.com/entelecheia/hyfi/releases [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white +[conventional commits]: https://conventionalcommits.org [jupyter-book-image]: https://jupyterbook.org/en/stable/_images/badge.svg +[jupyter book]: https://jupyterbook.org -[repo-url]: https://github.com/entelecheia/hyperfast-python-template -[pypi-url]: https://pypi.org/project/hyperfast-python-template -[docs-url]: https://hyperfast-python.entelecheia.cc -[changelog]: https://github.com/entelecheia/hyperfast-python-template/blob/main/CHANGELOG.md -[contributing guidelines]: https://github.com/entelecheia/hyperfast-python-template/blob/main/CONTRIBUTING.md +[repo-url]: https://github.com/entelecheia/hyfi +[pypi-url]: https://pypi.org/project/hyfi +[docs-url]: https://hyfi.entelecheia.cc +[changelog]: https://github.com/entelecheia/hyfi/blob/main/CHANGELOG.md +[contributing guidelines]: https://github.com/entelecheia/hyfi/blob/main/CONTRIBUTING.md -A python template that helps you jump start your project - -- Documentation: [https://hyperfast-python.entelecheia.cc][docs-url] -- GitHub: [https://github.com/entelecheia/hyperfast-python-template][repo-url] -- PyPI: [https://pypi.org/project/hyperfast-python-template][pypi-url] - -Hyperfast Python Template is a self-contained template that helps you initialize your Python project inside the template. It is hyperfast in the sense that the template itself is converted into a Python project in the blink of an eye. It is also hyperfast in the sense that it helps you jump start your project with the best practices in the Python community. - -## Quickstart - -There are three ways to use this project: - -- Use [Hyperfast Python Template] to create a new repository -- Use [Copier] to create a project to your local machine directly -- Inject [Hyperfast Python Template] into an existing project - -### I. Use the template - -1. Click the `Use this template` button -2. Enter a name for your repository -3. Click `Create repository from template` -4. Clone your new repository to your local machine -5. Initialize your project - ```bash - make init-project - ``` -6. Do your work +Hydra Fast Interface (Hydra and Pydantic based interface framework) -### II. Use Copier +- Documentation: [https://hyfi.entelecheia.cc][docs-url] +- GitHub: [https://github.com/entelecheia/hyfi][repo-url] +- PyPI: [https://pypi.org/project/hyfi][pypi-url] -1. Install Copier - ```bash - pipx install copier - ``` -2. Run - ```bash - copier gh:entelecheia/hyperfast-python-template path/to/destination - ``` -3. Do your work - -### III. Inject the template - -1. Install Copier - ```bash - pipx install copier - ``` -2. From the root of your project, run - ```bash - copier gh:entelecheia/hyperfast-python-template . - ``` -3. Do your work - -## Features - - -- [x] Automated changelog with [Conventional Commits] and [Python Semantic Release] -- [x] Automated dependency updates with [Dependabot] -- [x] Automated semantic versioning with [Python Semantic Release] -- [x] Automated uploads to [PyPI] and [TestPyPI] -- [x] Code coverage with [Pytest-Cov] -- [x] Code formatting with [Black] and [Prettier] -- [x] Continuous integration with [GitHub Actions] -- [x] Coverage reporting with [Codecov] -- [x] Documentation with [MkDocs], [Jupyter Book], and [Read the Docs] -- [x] Hyperfast rendering of the template into a new project with [Copier] -- [x] Import sorting with [isort] -- [x] Linting with [pre-commit] and [Flake8] -- [x] Managing project labels with [GitHub Labeler] -- [x] Managing projects with [Make] -- [x] Packaging and dependency management with [Poetry] -- [x] Static type-checking with [mypy] -- [x] Support for [Conventional Commits] -- [x] Support for [Semantic Versioning] -- [x] Testing with [pytest] - -- [ ] Automated Python syntax upgrades with [pyupgrade] -- [ ] Automatic documentation from sources for [MkDocs] with [mkdocstrings] -- [ ] Check documentation examples with [xdoctest] -- [ ] Runtime type-checking with [Typeguard] -- [ ] Security audit with [Bandit] and [Safety] -- [ ] Test automation with [Nox] - -The template supports Python 3.7, 3.8, 3.9, and 3.10. - -[bandit]: https://github.com/PyCQA/bandit -[black]: https://github.com/psf/black -[click]: https://click.palletsprojects.com/ -[codecov]: https://codecov.io/ -[conventional commits]: https://conventionalcommits.org -[conventional release labels]: https://github.com/marketplace/actions/conventional-release-labels -[copier]: https://copier.readthedocs.io -[coverage.py]: https://coverage.readthedocs.io/ -[dependabot]: https://dependabot.com/ -[flake8]: http://flake8.pycqa.org -[github actions]: https://github.com/features/actions -[github labeler]: https://github.com/marketplace/actions/github-labeler -[isort]: https://pycqa.github.io/isort/ -[jupyter book]: https://jupyterbook.org -[make]: https://www.gnu.org/software/make/ -[mkdocs]: https://www.mkdocs.org -[mkdocstrings]: https://mkdocstrings.github.io -[mypy]: http://mypy-lang.org/ -[myst]: https://myst-parser.readthedocs.io/ -[nox]: https://nox.thea.codes/ -[poetry]: https://python-poetry.org/ -[pre-commit]: https://pre-commit.com/ -[prettier]: https://prettier.io/ -[pypi]: https://pypi.org/ -[pytest-cov]: https://pytest-cov.readthedocs.io/ -[pytest]: https://docs.pytest.org/en/latest/ -[python semantic release]: https://python-semantic-release.readthedocs.io/en/latest/ -[pyupgrade]: https://github.com/asottile/pyupgrade -[read the docs]: https://readthedocs.org/ -[release drafter]: https://github.com/release-drafter/release-drafter -[safety]: https://github.com/pyupio/safety -[semantic versioning]: https://semver.org -[testpypi]: https://test.pypi.org/ -[typeguard]: https://github.com/agronholm/typeguard -[xdoctest]: https://github.com/Erotemic/xdoctest +HyFI is a framework for building interfaces for Python applications. It is based on [Hydra] and [Pydantic] and provides a set of tools to build interfaces for Python applications. ## Changelog diff --git a/book/_config.yml b/book/_config.yml new file mode 100644 index 00000000..ea79b876 --- /dev/null +++ b/book/_config.yml @@ -0,0 +1,79 @@ +####################################################################################### +# A default configuration that will be loaded for all jupyter books +# See the documentation for help and more options: +# https://jupyterbook.org/customize/config.html + +####################################################################################### +# Book settings +title: "HyFI: Hydra Fast Interface" # The title of the book. Will be placed in the left navbar. +author: "Young Joon Lee" # The author of the book +copyright: "2023" # Copyright year to be placed in the footer +# logo: logo.png # A path to the book logo + +# Force re-execution of notebooks on each build. +# See https://jupyterbook.org/content/execute.html +execute: + execute_notebooks: force + +# Define the name of the latex output file for PDF builds +latex: + latex_documents: + targetname: book.tex + +# Add a bibtex file so that we can create citations +bibtex_bibfiles: + - references.bib + +# Information about where the book exists on the web +repository: + url: https://github.com/entelecheia/hyfi # Online location of your book + path_to_book: book # Optional path to your book, relative to the repository root + branch: main # Which branch of the repository should be used when creating links (optional) + +# Add GitHub buttons to your book +# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository +html: + use_issues_button: true + use_repository_button: true + +sphinx: + config: + html_theme: furo + intersphinx_mapping: + ebp: + - "https://executablebooks.org/en/latest/" + - null + myst-parser: + - "https://myst-parser.readthedocs.io/en/latest/" + - null + myst-nb: + - "https://myst-nb.readthedocs.io/en/latest/" + - null + sphinx: + - "https://www.sphinx-doc.org/en/master" + - null + nbformat: + - "https://nbformat.readthedocs.io/en/latest" + - null + sd: + - "https://sphinx-design.readthedocs.io/en/latest" + - null + sphinxproof: + - "https://sphinx-proof.readthedocs.io/en/latest/" + - null + hoverxref_intersphinx: + - "sphinxproof" + mathjax3_config: + tex: + macros: + "N": "\\mathbb{N}" + "floor": ["\\lfloor#1\\rfloor", 1] + "bmat": ["\\left[\\begin{array}"] + "emat": ["\\end{array}\\right]"] + + extra_extensions: + - sphinx.ext.intersphinx + - sphinx_inline_tabs + - sphinx_proof + - sphinx_examples + - hoverxref.extension diff --git a/book/_toc.yml b/book/_toc.yml new file mode 100644 index 00000000..1072fa3d --- /dev/null +++ b/book/_toc.yml @@ -0,0 +1,9 @@ +# Table of contents +# Learn more at https://jupyterbook.org/customize/toc.html + +format: jb-book +root: index +chapters: +- file: usage +- file: api +- file: examples diff --git a/book/api.md b/book/api.md new file mode 100644 index 00000000..b0d5c88f --- /dev/null +++ b/book/api.md @@ -0,0 +1 @@ +# API Reference diff --git a/book/examples.md b/book/examples.md new file mode 100644 index 00000000..a00bc5e9 --- /dev/null +++ b/book/examples.md @@ -0,0 +1,34 @@ +--- +jupytext: + cell_metadata_filter: -all + formats: md:myst + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.11.5 +kernelspec: + display_name: Python 3 + language: python + name: python3 +--- + +# Examples + +This page contains a few examples of how you can use HyFI: Hydra Fast Interface package. + +## Installation + +You can install HyFI: Hydra Fast Interface using `pip`: + +```{code-cell} +pip install hyfi +``` + +## Usage + +```python +from hyfi import get_version + +print(get_version()) +``` diff --git a/book/index.md b/book/index.md new file mode 100644 index 00000000..87b15958 --- /dev/null +++ b/book/index.md @@ -0,0 +1,53 @@ +# HyFI: Hydra Fast Interface + +[![license-image]][license-url] +[![version-image]][release-url] +[![release-date-image]][release-url] +[![conventional-commits-image]][conventional commits] +[![jupyter-book-image]][jupyter book] + + +[hyperfast python template]: https://github.com/entelecheia/hyperfast-python-template + +[license-image]: https://img.shields.io/github/license/entelecheia/hyfi +[license-url]: https://github.com/entelecheia/hyfi/blob/main/LICENSE +[version-image]: https://img.shields.io/github/v/release/entelecheia/hyfi?sort=semver +[release-date-image]: https://img.shields.io/github/release-date/entelecheia/hyfi +[release-url]: https://github.com/entelecheia/hyfi/releases +[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white +[jupyter-book-image]: https://jupyterbook.org/en/stable/_images/badge.svg + +[repo-url]: https://github.com/entelecheia/hyfi +[pypi-url]: https://pypi.org/project/hyfi +[docs-url]: https://hyfi.entelecheia.cc +[changelog]: https://github.com/entelecheia/hyfi/blob/main/CHANGELOG.md +[contributing guidelines]: https://github.com/entelecheia/hyfi/blob/main/CONTRIBUTING.md + + +Hydra Fast Interface (Hydra and Pydantic based interface framework) + +- Documentation: [https://hyfi.entelecheia.cc][docs-url] +- GitHub: [https://github.com/entelecheia/hyfi][repo-url] +- PyPI: [https://pypi.org/project/hyfi][pypi-url] + +HyFI is a framework for building interfaces for Python applications. It is based on [Hydra] and [Pydantic] and provides a set of tools to build interfaces for Python applications. + + + +## Changelog + +See the [CHANGELOG] for more information. + +## Contributing + +Contributions are welcome! Please see the [contributing guidelines] for more information. + +## License + +This project is released under the [MIT License][license-url]. + + +## Table of Contents + +```{tableofcontents} +``` diff --git a/book/logo.png b/book/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..06d56f40c838b64eb048a63e036125964a069a3a GIT binary patch literal 9854 zcmcJ#_ghoX7cGn*K?4W`P^xr9dX-2=s)7_L0g)Pd2}GoYu8}Goq=uqY=^(vJ3q7D9 zgx&ncihTY58>yQhyHVAq6+lGO~MVagOauq5m9v<`6Yyea8LU7g^33d5#6JIpIaLG z-1|gCJhU3BN``QY-K@=)`@JW9M^t~b7uLWQYei|mDOJQ5UUg0~vIqbGt~C8wn@$P% z5pl~zRjG%ihlB(HjNnDEe-dDz2JixSk(`6?==a`q;3sz5kB=vYkB^Usv)VI9k21rD zJiTz9qguh+nKE8m#+pE4C16PIb7Iqf7uN3q_3Quydk+ycREf|Kaf=g!AT$7Pt5%T^ z8aVDmSdkMNlHc+OU`GfMo(G6M`@b>}|7lC2WNZAX;dG{O$?=D%iOq{^-7HrB zcK+ZB)!$jy15VseoVKDTyWDkjAxOOZ*QX8d#=@20sP;i@Xow95<_tP$?zwjiu96e z>w=n(W1oxV>vfZL+?;M$rHrbr-j~Q4Z0#f{{?B_kL)V~b;Ypj(r`bl+t51=jl6us% zisP0c%+gd*@NjHx-9P?#e$1%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9dDzM}v3-DxU~SIgW9;-IvqR%OnBm4Ejqg0G}YnQC~*J|RZ=pB5-~vu$W~ z)Un>6^zlydKLzhIZ?b;=zuG68MC1PzKM`{<{lBe>Vh5EBTCLDuB`X-584ml0{G L>8MsHTOs~GC;Fmw literal 0 HcmV?d00001 diff --git a/book/references.bib b/book/references.bib new file mode 100644 index 00000000..ec380ec4 --- /dev/null +++ b/book/references.bib @@ -0,0 +1,3 @@ +--- +--- + diff --git a/book/requirements.txt b/book/requirements.txt new file mode 100644 index 00000000..10530e8c --- /dev/null +++ b/book/requirements.txt @@ -0,0 +1,8 @@ +jupyter-book +matplotlib +numpy +sphinx-inline-tabs +sphinx-examples +sphinx-proof +sphinx-hoverxref +furo>=2021.1.1 diff --git a/book/usage.md b/book/usage.md new file mode 100644 index 00000000..8f04b05a --- /dev/null +++ b/book/usage.md @@ -0,0 +1 @@ +# Usage diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000..b0d5c88f --- /dev/null +++ b/docs/api.md @@ -0,0 +1 @@ +# API Reference diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..9093a342 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,8 @@ +{!README.md!} + +Check out the [usage](usage) section for further information. + + +!!! note + + This project is under active development. diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..09cda521 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,4 @@ +mkdocs +mkdocstrings[python] +markdown-include +mkdocs-material diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 00000000..8f04b05a --- /dev/null +++ b/docs/usage.md @@ -0,0 +1 @@ +# Usage diff --git a/mkdocs.yaml b/mkdocs.yaml new file mode 100644 index 00000000..1619e377 --- /dev/null +++ b/mkdocs.yaml @@ -0,0 +1,11 @@ +site_name: "HyFI: Hydra Fast Interface" +plugins: + - search +markdown_extensions: + - markdown_include.include: + base_path: . + - admonition +theme: + name: material + palette: + scheme: slate diff --git a/pyproject.toml b/pyproject.toml index 81c27101..75af5e10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,14 @@ [tool.poetry] -name = "hyperfast-python-template" -version = "0.1.8" -description = "A python template that helps you jump start your project" +name = "hyfi" +version = "0.0.0" +description = "Hydra Fast Interface (Hydra and Pydantic based interface framework)" authors = ["Young Joon Lee "] license = "MIT" readme = "README.md" -packages = [{ include = "hyperfastpy", from = "src" }] +packages = [{ include = "hyfi", from = "src" }] [tool.poetry.scripts] -hyperfastpy = 'hyperfastpy.__cli__:main' +hyfi = 'hyfi.__cli__:main' [tool.poetry.dependencies] python = "^3.8.1" @@ -75,7 +75,7 @@ version = "1.0.1" tag_format = "v$version" [tool.setuptools_scm] -write_to = "src/hyperfastpy/_version.py" +write_to = "src/hyfi/_version.py" write_to_template = '__version__ = "{version}"' tag_regex = '^(?Pv)?(?P[^\+]+)(?P.*)?$' diff --git a/src/hyfi/__cli__.py b/src/hyfi/__cli__.py new file mode 100644 index 00000000..569a0189 --- /dev/null +++ b/src/hyfi/__cli__.py @@ -0,0 +1,15 @@ +"""Command line interface for hyfi""" + +# Importing the libraries + +from . import __version__ + + +def main() -> None: + """This is the cli function of the package""" + print("This is the cli function of the package") + print(f"The version of the package is: {__version__}") + + +if __name__ == "__main__": + main() diff --git a/src/hyfi/__init__.py b/src/hyfi/__init__.py new file mode 100644 index 00000000..18471e1b --- /dev/null +++ b/src/hyfi/__init__.py @@ -0,0 +1,6 @@ +from ._version import __version__ + + +def get_version() -> str: + """This is the cli function of the package""" + return __version__ diff --git a/src/hyfi/_version.py b/src/hyfi/_version.py new file mode 100644 index 00000000..7602829c --- /dev/null +++ b/src/hyfi/_version.py @@ -0,0 +1 @@ +__version__ = "" diff --git a/src/hyfi/py.typed b/src/hyfi/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/tests/hyfi/test_cli.py b/tests/hyfi/test_cli.py new file mode 100644 index 00000000..aae98c82 --- /dev/null +++ b/tests/hyfi/test_cli.py @@ -0,0 +1,22 @@ +""" +test cli module +""" +import subprocess +from typing import List, Tuple + + +def capture(command: List[str]) -> Tuple[bytes, bytes, int]: + proc = subprocess.Popen( + command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + out, err = proc.communicate() + return out, err, proc.returncode + + +def test_cli() -> None: + """Test cli module""" + command = ["hyfi"] + out, err, exitcode = capture(command) + assert exitcode == 0 diff --git a/tests/hyfi/test_init.py b/tests/hyfi/test_init.py new file mode 100644 index 00000000..b298a84c --- /dev/null +++ b/tests/hyfi/test_init.py @@ -0,0 +1,12 @@ +from hyfi import get_version + + +def test_get_version() -> None: + """ + Test the get_version function. + + version format: major.minor.patch[.devN+g] + """ + version = get_version() + # check version format + assert version.count(".") in range(2, 5)