diff --git a/.github/workflows/documentation.yml b/.github/archived_flows/documentation.yml similarity index 100% rename from .github/workflows/documentation.yml rename to .github/archived_flows/documentation.yml diff --git a/.github/workflows/release.yml b/.github/archived_flows/release.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/archived_flows/release.yml diff --git a/.github/workflows/cruft.yml b/.github/workflows/cruft.yml deleted file mode 100644 index 714de36..0000000 --- a/.github/workflows/cruft.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Cruft Check - -on: - pull_request: - branches: - - main - -jobs: - cruft-check: - runs-on: ubuntu-latest - permissions: - pull-requests: write - - steps: - # Avoid infinite loop where main - # Feature PR -> cruft check from main -> - # Cruft update PR -> cruft check from main -> - # Cruft update PR ... - - name: Check if pull request is from a fork - run: | - if [ "${{ github.event.pull_request.head.repo.fork }}" = "true" ]; then - echo "Pull request is from a fork and does not have permissions for PR creation. Exiting gracefully." - exit 0 - elif [ "${{github.event.pull_request.title}}" == "ci - update cruft" ]; then - echo "Pull request is already a cruft update. Exiting gracefully." - exit 0 - else - echo "Pull request is not from a fork, continuing." - fi - - - name: Checkout code - uses: actions/checkout@v3 - with: - ref: main - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: "3.9" - - - name: Install Cruft - run: pip install cruft - - - name: Update cruft - id: cruft_check - run: | - cruft_output=$(cruft update --skip-apply-ask) - if echo "$cruft_output" | grep -q "Good work!"; then - echo "$cruft_output" - echo "cruft_updated=true" >> $GITHUB_OUTPUT - else - echo "$cruft_output" - echo "cruft_updated=false" >> $GITHUB_OUTPUT - fi - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 - if: ${{ steps.cruft_check.outputs.cruft_updated == 'true' && github.event.pull_request.title != 'ci - update cruft' }} - continue-on-error: true - with: - title: "ci - update cruft" - branch: "update-cruft" - body: "🌲 Cruft updates" - token: ${{ secrets.PAT }} - commit-message: "ci: update cruft" - labels: "dependencies" # This makes the PR exempt from the stale bot diff --git a/.gitignore b/.gitignore index fd3f138..127d49a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,5 @@ __pycache__/ _build/ .tox -# - -# VSCode -.vscode/ - # MacOS .DS_Store \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7a230e1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "src" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico deleted file mode 100644 index 19d2249..0000000 Binary files a/docs/_static/favicon.ico and /dev/null differ diff --git a/docs/_static/icon.png b/docs/_static/icon.png deleted file mode 100644 index f6d35c6..0000000 Binary files a/docs/_static/icon.png and /dev/null differ diff --git a/docs/api/docs_example.md b/docs/api/docs_example.md deleted file mode 100644 index 4e9b11c..0000000 --- a/docs/api/docs_example.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sample API - -A sample API page - -```{note} -This is a sample API page. Feel free to delete it. -``` - -and here is the function documentation: - -```{eval-rst} -.. autofunction:: gpt2anki.docs_example.sample_function -``` diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 97b8d99..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,107 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -from datetime import datetime - -# -- Project information ----------------------------------------------------- - -project = """Gpt2Anki""" - -author = "Jonathan RystrΓΈm & Martin Bernstorff" -github_user = "rysias" -repo_url = f"https://github.com/{github_user}/{project.lower()}" - -copyright = f"{datetime.now().year}, {author}" # noqa - -# -- General configuration --------------------------------------------------- - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.napoleon", - "sphinxext.opengraph", - "sphinx_copybutton", - "sphinx.ext.githubpages", - "myst_nb", - "sphinx_design", - "sphinx.ext.autodoc", - "sphinx.ext.viewcode", -] - -language = "en" - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - -# Do not execute the notebooks when building the docs (turned off by default) -nb_execution_raise_on_error = True # Raise an exception when a cell execution fails -nb_execution_mode = "cache" # Execute the notebooks only if the source has changed - -# Automatically extract typehints when specified and place them in -# descriptions of the relevant function/method. -# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration -autodoc_typehints = "description" - -# Don't show class signature with the class' name. -autodoc_class_signature = "separated" - -# -- Options for HTML output ------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_title = """Gpt2Anki""" -html_theme = "furo" -html_static_path = ["_static"] -html_favicon = "_static/favicon.ico" - -html_show_sourcelink = True - -html_context = { - "display_github": True, # Add 'Edit on Github' link instead of 'View page source' - "github_user": github_user, - "github_repo": project.lower(), - "github_version": "main", - "conf_py_path": "/docs/", -} - -source_suffix = { - ".rst": "restructuredtext", - ".md": "myst-nb", - ".ipynb": "myst-nb", -} - - -html_theme_options = { - # adds github footer icon with link to repo - "footer_icons": [ - { - "name": "GitHub", - "url": repo_url, - "html": """ - - - - """, - "class": "", - }, - ], - "source_repository": repo_url, - "source_branch": "main", - "source_directory": "docs/", - "light_logo": "icon.png", - "dark_logo": "icon.png", - "light_css_variables": { - "color-brand-primary": "#ff5454", - "color-brand-content": "#ff7575", - }, - "dark_css_variables": { - "color-brand-primary": "#ff8f8f", - "color-brand-content": "#ff8f8f", - }, - "sidebar_hide_name": False, - "navigation_with_keys": True, -} - -pygments_style = "monokai" -pygments_dark_style = "monokai" diff --git a/docs/faq.md b/docs/faq.md deleted file mode 100644 index b05926d..0000000 --- a/docs/faq.md +++ /dev/null @@ -1,60 +0,0 @@ - -# FAQ - - -## How do I test the code? - -This package comes with a test suite implemented using [pytest]. -In order to run the tests, you have to clone the repository and install the package. -This will also install the required tests dependencies -and test utilities defined in the extras_require section of the :code:`pyproject.toml`. - -```bash -# clone the repository -git clone https://github.com/rysias/gpt2anki - -# install package and test dependencies -pip install -e ".[tests]" - -# run all tests -python -m pytest -``` - -which will run all the test in the `tests` folder. - -Specific tests can be run using: - -```bash -python -m pytest tests/desired_test.py -``` - -If you want to check code coverage you can run the following: - -```bash -python -m pytest --cov=src -``` - -## How is the documentation generated? - -This package use [sphinx] to generate documentation. It uses the [Furo] theme with -custom styling. - -To make the documentation you can run: - - -```bash -# install sphinx, themes and extensions -pip install -e ".[docs]" - -# generate html from documentations -sphinx-build -b html docs docs/_build/html -``` - -### Credits - -This project was generated from the [Swift Python Cookiecutter] template. - -[swift python cookiecutter]: https://github.com/MartinBernstorff/swift-python-cookiecutter -[file an issue]: https://github.com/rysias/gpt2anki/issues -[sphinx]: https://www.sphinx-doc.org/en/master/index.html -[Furo]: https://github.com/pradyunsg/furo diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index dd6e98b..0000000 --- a/docs/index.md +++ /dev/null @@ -1,91 +0,0 @@ ---- -hide-toc: true ---- - -# Gpt2Anki - - -```{include} ../README.md -:start-after: -:end-before: -``` - ---- - -````{grid} 1 1 2 2 -:class-container: tuto-section-2 -```{grid-item-card} πŸ”§ Installation -:link: installation -:link-type: doc - -Installation instructions on how to install this package -``` - -```{grid-item-card} πŸ‘©β€πŸ’» Tutorials -:link: tutorials -:link-type: doc - -Tutorials to get you started uisng this package -``` - -```{grid-item-card} πŸ“š FAQ -:link: tutorials -:link-type: doc - -Frequently asked questions and answers -``` - -```{grid-item-card} 🚨 Bug Reports -:link: https://github.com/rysias/gpt2anki/issues - -Found a bug? Please report it as an issue -``` - -```{grid-item-card} 🎁 Feature Requests & Ideas -:link: https://github.com/rysias/gpt2anki/issues - -Have an idea for a new feature? Feel free to create an issue -``` - -```{grid-item-card} πŸ‘©β€πŸ’» Usage Questions -:link: https://github.com/rysias/gpt2anki/discussions - -Do you have a question about how to use this package? Feel to use the discussion forum -``` - -```{grid-item-card} πŸ—― General Discussion -:link: https://github.com/rysias/gpt2anki/discussions - -For genral dicussion about this package, please use the discussion forum -``` - -```{grid-item-card} πŸ“ Contributing -:link: https://github.com/rysias/gpt2anki/blob/main/CONTRIBUTING.md - -If you would like to contribute to this package, please read the contributing guidelines -``` -```` - - -```{toctree} -:hidden: -:caption: Getting Started - -installation -tutorials -faq -``` - -```{toctree} -:caption: API -:hidden: -api/docs_example -``` - -```{toctree} -:caption: GitHub -:hidden: - -Changelog -GitHub -``` diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 1a8c7e1..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,17 +0,0 @@ -# Installation - -You can install `gpt2anki` via pip from [PyPI]: - -```bash -pip install gpt2anki -``` - -or from [GitHub] using: - -```bash -pip install git+https://github.com/rysias/gpt2anki -``` - -[pip]: https://pip.pypa.io/en/stable/ -[PyPI]: https://pypi.org/project/gpt2anki/ -[GitHub]: https://github.com/rysias/gpt2anki \ No newline at end of file diff --git a/docs/tutorials.md b/docs/tutorials.md deleted file mode 100644 index 9c052c7..0000000 --- a/docs/tutorials.md +++ /dev/null @@ -1,12 +0,0 @@ -# Tutorials - -To get started using the package, we recommend going through the tutorials in the order -listed below. Each tutorial also a jupyter notebook which you can download and run -locally. - -```{eval-rst} -.. toctree:: - :maxdepth: 3 - - tutorials/usage -``` \ No newline at end of file diff --git a/docs/tutorials/usage.ipynb b/docs/tutorials/usage.ipynb deleted file mode 100644 index 2a1fd8d..0000000 --- a/docs/tutorials/usage.ipynb +++ /dev/null @@ -1,56 +0,0 @@ -{ - "cells": [ - { - "attachments": {}, - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Usage guide" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "put in your tutorial here\n" - ] - } - ], - "source": [ - "print(\"put in your tutorial here\")" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "dacy", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.8" - }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "b40b3901be4435b5a71cc3915f22553724b83a304e297d25655c4809f01488a8" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} diff --git a/src/gpt2anki/first_test.py b/src/gpt2anki/first_test.py new file mode 100644 index 0000000..eaa0b08 --- /dev/null +++ b/src/gpt2anki/first_test.py @@ -0,0 +1,2 @@ +def test_first(): + pass diff --git a/tasks.py b/tasks.py index eba651a..23add94 100644 --- a/tasks.py +++ b/tasks.py @@ -342,7 +342,7 @@ def test( if not pytest_args: pytest_args = [ - "tests", + "src", "-n auto", "-rfE", "--failed-first", @@ -382,7 +382,7 @@ def test( def test_for_rej(): # Get all paths in current directory or subdirectories that end in .rej - rej_files = list(Path(".").rglob("*.rej")) + rej_files = list(Path().rglob("*.rej")) if len(rej_files) > 0: print(f"\n{msg_type.FAIL} Found .rej files leftover from cruft update.\n") diff --git a/tests/__init.py b/tests/__init.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/first_test.py b/tests/first_test.py deleted file mode 100644 index 174b478..0000000 --- a/tests/first_test.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Start of the test suite for gpt2anki. This file is required for pytest to not throw an 'no tests found' error.""" - - -def test_first(): - pass