diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08119c3a..4fef3201 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: env: PROJECT_NAME: mloq PROJECT_DIR: src/mloq - VERSION_FILE: src/mloq/version.py + VERSION_FILE: "src/mloq/version.py .bumpversion.cfg docs/_config.yml" DEFAULT_BRANCH: main BOT_NAME: fragile-bot BOT_EMAIL: bot@fragile.tech diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..46421ecd --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,42 @@ +############################################################################### +# Auto-generated by `jupyter-book config` +# If you wish to continue using _config.yml, make edits to that file and +# re-generate this one. +############################################################################### +author = 'Guillem Duran Ballester' +autoapi_add_toctree_entry = True +autoapi_dirs = ['../src'] +autodoc_typehints = 'description' +comments_config = {'hypothesis': False, 'utterances': False} +copyright = '2024' +exclude_patterns = ['**.ipynb_checkpoints', '.DS_Store', 'Thumbs.db', '_build'] +extensions = ['sphinx_togglebutton', 'sphinx_copybutton', 'myst_nb', 'jupyter_book', 'sphinx_thebe', 'sphinx_comments', 'sphinx_external_toc', 'sphinx.ext.intersphinx', 'sphinx_design', 'sphinx_book_theme', 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon', 'sphinx.ext.autosectionlabel', 'sphinx.ext.autodoc.typehints', 'sphinx.ext.githubpages', 'sphinxcontrib.mermaid', 'autoapi.extension', 'sphinx_jupyterbook_latex', 'sphinx_multitoc_numbering'] +external_toc_exclude_missing = False +external_toc_path = '_toc.yml' +html_baseurl = '' +html_favicon = 'favicon.png' +html_logo = 'logo.png' +html_sourcelink_suffix = '' +html_theme = 'sphinx_book_theme' +html_theme_options = {'search_bar_text': 'Search this book...', 'launch_buttons': {'notebook_interface': 'classic', 'binderhub_url': '', 'jupyterhub_url': '', 'thebe': False, 'colab_url': ''}, 'path_to_docs': '', 'repository_url': 'https://github.com/FragileTech/ml-ops-quickstart', 'repository_branch': 'main', 'extra_footer': '', 'home_page_in_toc': True, 'announcement': '', 'analytics': {'google_analytics_id': ''}, 'use_repository_button': False, 'use_edit_page_button': False, 'use_issues_button': False} +html_title = 'ML Ops Quickstart' +imgmath_latex = '/usr/bin/latex' +latex_engine = 'pdflatex' +myst_enable_extensions = ['amsmath', 'colon_fence', 'deflist', 'dollarmath', 'html_admonition', 'html_image', 'linkify', 'replacements', 'smartquotes', 'substitution', 'tasklist'] +myst_url_schemes = ['mailto', 'http', 'https'] +napoleon_google_docstring = True +napoleon_numpy_docstring = False +nb_execution_allow_errors = False +nb_execution_cache_path = '' +nb_execution_excludepatterns = [] +nb_execution_in_temp = False +nb_execution_mode = 'auto' +nb_execution_timeout = 30 +nb_output_stderr = 'show' +numfig = True +pygments_style = 'sphinx' +release = '0.1.0' +suppress_warnings = ['myst.domains'] +use_jupyterbook_latex = True +use_multitoc_numbering = True +version = '0.1.0' diff --git a/docs/requirements.txt b/docs/requirements.txt index 38e82580..7c3a5646 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,16 +1,20 @@ accessible-pygments==0.0.5 alabaster==0.7.16 +arrow==1.3.0 astroid==3.3.4 asttokens==2.4.1 attrs==24.2.0 autoapi==2.0.1 babel==2.16.0 beautifulsoup4==4.12.3 +binaryornot==0.4.4 certifi==2024.8.30 cfgv==3.4.0 +chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 comm==0.2.2 +cookiecutter==2.6.0 debugpy==1.8.6 decorator==5.1.1 distlib==0.3.8 @@ -30,6 +34,7 @@ ipykernel==6.29.5 ipython==8.27.0 jedi==0.19.1 jinja2==3.1.4 +jinja2-time==0.2.0 jsonschema==4.23.0 jsonschema-specifications==2023.12.1 jupyter-book==1.0.2 @@ -64,10 +69,12 @@ pybtex-docutils==1.0.3 pydata-sphinx-theme==0.15.4 pygments==2.18.0 python-dateutil==2.9.0.post0 +python-slugify==8.0.4 pyyaml==6.0.2 pyzmq==26.2.0 referencing==0.35.1 requests==2.32.3 +rich==13.9.2 rpds-py==0.20.0 ruyaml==0.91.0 setuptools==75.1.0 @@ -100,9 +107,11 @@ sphinxext-opengraph==0.9.1 sqlalchemy==2.0.35 stack-data==0.6.3 tabulate==0.9.0 +text-unidecode==1.3 tomli==2.0.2 tornado==6.4.1 traitlets==5.14.3 +types-python-dateutil==2.9.0.20241003 typing-extensions==4.12.2 uc-micro-py==1.0.3 urllib3==2.2.3 diff --git a/docs/source/project/AUTHORS.md b/docs/source/project/AUTHORS.md new file mode 100644 index 00000000..537dea30 --- /dev/null +++ b/docs/source/project/AUTHORS.md @@ -0,0 +1,3 @@ +# Authors + +* Guillem Duran Ballester - fragile.tech diff --git a/docs/source/project/CHANGELOG.md b/docs/source/project/CHANGELOG.md new file mode 100644 index 00000000..fe5f7be2 --- /dev/null +++ b/docs/source/project/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + + +0.1.0 (2024-10-06) +------------------ + +* First release on PyPI. diff --git a/docs/source/project/CONTRIBUTING.md b/docs/source/project/CONTRIBUTING.md new file mode 100644 index 00000000..a2da7ad3 --- /dev/null +++ b/docs/source/project/CONTRIBUTING.md @@ -0,0 +1,75 @@ +# Contributing + +Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. + +```{contents} +``` + +## Bug reports + +When [reporting a bug](https://github.com/FragileTech/ml-ops-quickstart/issues) please include: + +- Your operating system name and version. +- Any details about your local setup that might be helpful in troubleshooting. +- Detailed steps to reproduce the bug. + +## Documentation improvements + +ML Ops Quickstart could always use more documentation, whether as part of the official ML Ops Quickstart docs, in docstrings, or even on the web in blog posts, articles, and such. + +## Feature requests and feedback + +The best way to send feedback is to file an issue at [https://github.com/FragileTech/ml-ops-quickstart/issues](https://github.com/FragileTech/ml-ops-quickstart/issues). + +If you are proposing a feature: + +- Explain in detail how it would work. +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that code contributions are welcome :) + +## Development + +To set up `ml-ops-quickstart` for local development: + +1. Fork [ml-ops-quickstart](https://github.com/FragileTech/ml-ops-quickstart) (look for the "Fork" button). +2. Clone your fork locally: + + ```bash + git clone git@github.com:YOURGITHUBNAME/ml-ops-quickstart.git + ``` + +3. Create a branch for local development: + + ```bash + git checkout -b name-of-your-bugfix-or-feature + ``` + + Now you can make your changes locally. + +4. When you're done making changes run all the checks and docs builder with one command: + + ```bash + rye run all + ``` + +5. Commit your changes and push your branch to GitHub: + + ```bash + git add . + git commit -m "Your detailed description of your changes." + git push origin name-of-your-bugfix-or-feature + ``` + +6. Submit a pull request through the GitHub website. + +## Pull Request Guidelines + +If you need some code review or feedback while you're developing the code just make the pull request. + +For merging, you should: + +1. Include passing tests (run `hatch test`). +2. Update documentation when there's new API, functionality etc. +3. Add a note to `CHANGELOG.md` about the changes. +4. Add yourself to `AUTHORS.md`. + diff --git a/docs/source/project/README.md b/docs/source/project/README.md new file mode 100644 index 00000000..2de89179 --- /dev/null +++ b/docs/source/project/README.md @@ -0,0 +1,385 @@ +# Welcome to ML Ops Quickstart + +Automate project creation following ML best practices. + + +* License: MIT license + + +## Features + +This is an "all inclusive" sort of template. + +- Choice of various licenses. +- [Pytest](http://pytest.org/) for testing Python 3.10. +- *Optional* support for creating a tests matrix out of dependencies and Python versions. + +- [Codecov](http://codecov.io/) for coverage tracking. + + +- Documentation with [Sphinx](http://sphinx-doc.org/), ready for [ReadTheDocs](https://readthedocs.org/). + +- Configurations for: + - [isort](https://pypi.org/project/isort) + - [bumpversion](https://pypi.org/project/bump2version) ([bump2version](https://github.com/c4urself/bump2version) required) + - [ruff](https://docs.astral.sh/ruff/) for linting and formatting your code. +- Packaging and code quality checks. This template comes with a Hatch environment (`check`) that will: + - Check if your `README.md` is valid. + - Check if the `MANIFEST.in` has any issues. + +## Requirements + +Projects using this template have these minimal dependencies: + +- [Cookiecutter](https://github.com/audreyr/cookiecutter) - just for creating the project. +- [Setuptools](https://pypi.org/project/setuptools) - for building the package, wheels, etc. Nowadays Setuptools is widely available, it shouldn't pose a problem :) + +To get quickly started on a new system, just [install setuptools](https://pypi.org/project/setuptools#installation-instructions) and then [install pip](https://pip.pypa.io/en/latest/installing.html). That's the bare minimum required to install Hatch and Cookiecutter. To install them, just run this in your shell or command prompt: + +```bash +pip install cookiecutter +``` + +## Usage and options + +This template is more involved than the regular [cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage). + +First generate your project: + +```bash +cookiecutter gh:FragileTech/ml-ops-quickstart +``` + +You will be asked for these fields: + +> **Note**: Fields that work together usually use the same prefix. If you answer "no" on the first one, then the rest won't have any effect so just ignore them. Maybe in the future Cookiecutter will allow option hiding or something like a wizard. + +### `full_name` + +**Default**: + +```python +"Guillem Duran Ballester" +``` + +Main author of this library or application (used in `AUTHORS.md` and `pyproject.toml`). + +Can be set in your `~/.cookiecutterrc` config file. + +### `email` + +**Default**: + +```python +"guillem@fragile.tech" +``` + +Contact email of the author (used in `AUTHORS.md` and `pyproject.toml`). + +Can be set in your `~/.cookiecutterrc` config file. + +### `website` + +**Default**: + +```python +"fragile.tech" +``` + +Website of the author (used in `AUTHORS.md`). + +Can be set in your `~/.cookiecutterrc` config file. + +### `repo_username` + +**Default**: + +```python +"FragileTech" +``` + +Repository username of this project (used for repository link). + +Can be set in your `~/.cookiecutterrc` config file. + +### `project_name` + +**Default**: + +```python +"ML Ops Quickstart" +``` + +Verbose project name, used in headings (docs, README, etc). + +### `repo_hosting_domain` + +**Default**: + +```python +"github.com" +``` + +Use `"no"` for no hosting (various links will disappear). You can also use `"gitlab.com"` and such, but various things will be broken. + +### `repo_name` + +**Default**: + +```python +"ml-ops-quickstart" +``` + +Repository name on hosting service (and project's root directory name). + +### `package_name` + +**Default**: + +```python +"mloq" +``` + +Python package name (whatever you would import). + +### `distribution_name` + +**Default**: + +```python +"mloq" +``` + +PyPI distribution name (what you would `pip install`). + +### `module_name` + +**Default**: + +```python +"core" +``` + +This template assumes there's going to be an "implementation" module inside your package. + +### `project_short_description` + +**Default**: + +```python +"Automate project creation following ML best practices." +``` + +One-line description of the project (used in `README.md` and `pyproject.toml`). + +### `release_date` + +**Default**: + +```python +"today" +``` + +Release date of the project (ISO 8601 format), defaults to today (used in `CHANGELOG.md`). + +### `year_from` + +**Default**: + +```python +"2024" +``` + +Copyright start year. + +### `year_to` + +**Default**: + +```python +"2024" +``` + +Copyright end year. + +### `version` + +**Default**: + +```python +"0.1.0" +``` + +Release version (see `.bumpversion.cfg` and in Sphinx `conf.py`). + +### `command_line_interface` + +**Default**: + +```python +"click" +``` + +Option to enable a CLI (a bin/executable file). Available options: + +- `plain` - a very simple command. +- `argparse` - a command implemented with `argparse`. +- `click` - a command implemented with [click](http://click.pocoo.org/) - which you can use to build more complex commands. +- `no` - no CLI at all. + +### `command_line_interface_bin_name` + +**Default**: + +```python +"mloq" +``` + +Name of the CLI bin/executable file (set the console script name in `pyproject.toml`). + +### `license` + +**Default**: + +```python +"MIT license" +``` + +License to use. Available options: + +- MIT license +- BSD 2-Clause License +- BSD 3-Clause License +- ISC license +- Apache Software License 2.0 +- GNU Lesser General Public License v3 or later (LGPLv3+) +- GNU Lesser General Public License v3 (LGPLv3) +- GNU Lesser General Public License v2.1 or later (LGPLv2+) +- GNU Lesser General Public License v2.1 (LGPLv2) +- no + +What license to pick? https://choosealicense.com/ + +### `codecov` + +**Default**: + +```python +"yes" +``` + +Enable pushing coverage data to Codecov and add badge in `README.md`. + +### `sphinx_docs` + +**Default**: + +```python +"yes" +``` + +Have Sphinx documentation. + +### `sphinx_docs_hosting` + +**Default**: + +```python +"https://ml-ops-quickstart.readthedocs.io/" +``` + +Leave as default if your documentation will be hosted on ReadTheDocs. If your documentation will be hosted elsewhere (such as GitHub Pages or GitLab Pages), enter the top-level URL. + +### `pypi_badge` + +**Default**: + +```python +"yes" +``` + +By default, this will insert links to your project's page on PyPI.org. If you choose `"no"`, then these links will not be created. + +### `pypi_disable_upload` + +**Default**: + +```python +"no" +``` + +If you specifically want to be sure your package will never be accidentally uploaded to PyPI, you can pick `"yes"`. + +## Developing the project + +To format and lint the code: + +```bash +rye run style +``` + +To run all the tests, just run: + +```bash +rye run test +``` + +To see all the Hatch environments: + +```bash +rye run hatch env show +``` + +To only build the docs: + +```bash +rye run build-docs +``` + +To build and verify that the built package is proper and perform other code QA checks: + +```bash +rye run check +``` + +## Releasing the project + +Before releasing your package on PyPI, you should have all the tests in the different environments passing. + +### Version management + +This template provides a basic bumpversion configuration. It's as simple as running: + +- `bumpversion patch` to increase version from `1.0.0` to `1.0.1`. +- `bumpversion minor` to increase version from `1.0.0` to `1.1.0`. +- `bumpversion major` to increase version from `1.0.0` to `2.0.0`. + +You should read [Semantic Versioning 2.0.0](http://semver.org/) before bumping versions. + +### Building and uploading + +TODO + +## Changelog + +See [CHANGELOG.md](https://github.com/FragileTech/ml-ops-quickstart/blob/main/CHANGELOG.md). + +## Questions & answers + +**There's no Makefile?** + +Sorry, no `Makefile` yet. The Hatch environments stand for whatever you'd have in a `Makefile`. + +**Why is the version stored in several files (`pkg/__init__.py`, `pyproject.toml`, `docs/conf.py`)?** + +We cannot use a metadata/version file[^1] because this template is to be used with both distributions of packages (dirs with `__init__.py`) and modules (simple `.py` files that go straight into `site-packages`). There's no good place for that extra file if you're distributing modules. + +But this isn't so bad—bumpversion manages the version string quite neatly. + +[^1]: Example, an `__about__.py` file. + +## Not Exactly What You Want? + +No way, this is the best. 😜 + +If you have criticism or suggestions, please open up an Issue or Pull Request. diff --git a/pyproject.toml b/pyproject.toml index b64132df..fb1c07d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,6 +46,8 @@ dependencies = [ "flogging", "pre-commit", "click", + "cookiecutter", + "jinja2_time", ] # ToDo: Modify according to your needs! [project.urls] # important URLs for this project @@ -56,7 +58,7 @@ Tracker = "https://github.com/FragileTech/ml-ops-quickstart/issues" mloq = "mloq.__main__:run" [project.optional-dependencies] -lint= ["mypy", "ruff"] +lint= ["mypy", "ruff", "mypy", "isort", "colorama"] test = ["pytest", "pytest-cov", "pytest-xdist"] docs = [ "autoapi", @@ -98,6 +100,14 @@ exclude = [ ] [tool.rye.scripts] +build = {chain=[ + "cookiecutter templates/mlops -f --replay", + "hatch run template:build" +]} +template = {chain=[ + "cookiecutter templates/mlops -f --replay", + "hatch run template:all" +]} lint = { cmd = "hatch run lint:all" } style = { cmd = "hatch run lint:style" } check = { cmd = "hatch run lint:check" } @@ -151,6 +161,7 @@ exclude = [ "config", "mloq-template", "templates", + "docs/conf.py", ] # Same as Black. line-length = 99 @@ -162,7 +173,7 @@ select = [ "FLY", "FIX", "FURB", "N", "NPY", "INP", "ISC", "PERF", "PIE", "PL", "PTH", "RET", "RUF", "S", "T10", - "TD", "T20", "UP", "YTT", "W", + "TD", "T20", "UP", "YTT", "W", "I", ] ignore = [ "D100", "D211", "D213", "D104", "D203", "D301", "D407", "S101", @@ -195,7 +206,7 @@ docstring-quotes = "double" [tool.ruff.lint.per-file-ignores] "__init__.py" = ["E402", "F401"] "cli.py" = ["PLC0415", "D205", "D400", "D415"] -"**/docs/**" = ["INP001", "PTH100"] +"**/docs/**" = ["INP001", "PTH100", "E501"] "**/{tests,docs}/*" = [ "E402", "F401", "F811", "D", "S101", "PLR2004", "S105", "PLW1514", "PTH123", "PTH107", "N811", "PLC0415", "ARG002", @@ -211,7 +222,7 @@ quote-style = "double" [tool.isort] profile = "black" -line_length = "99" +line_length = 99 multi_line_output = 3 order_by_type = false force_alphabetical_sort_within_sections = true @@ -221,13 +232,18 @@ include_trailing_comma = true color_output = true lines_after_imports = 2 honor_noqa = true -skip = [".venv", "venv"] -skip_glob = ["*.pyx"] +skip = [".venv", "venv", "docs/conf.py", "mloq-template/docs/conf.py", "templates", "mloq-template"] +skip_glob = ["*.pyx", "*/docs/conf.py"] [tool.ruff.lint.isort] known-first-party = ["mloq"] forced-separate = ["conftest"] force-single-line = true +order-by-type = false +force-sort-within-sections = true +combine-as-imports = true +lines-after-imports = 2 +detect-same-package = true [tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false @@ -238,6 +254,7 @@ ban-relative-imports = "all" [tool.mypy] files = ["src/mloq", "tests"] +exclude = ["docs/conf.py", "mloq-template/docs/conf.py", "templates"] disallow_untyped_defs = false follow_imports = "normal" # "silent" for not following ignore_missing_imports = true @@ -247,7 +264,7 @@ warn_no_return = false warn_unused_ignores = true [[tool.mypy.overrides]] -module = "*.templates.*" +module = "*templates*" ignore_errors = true [tool.pylint.master] @@ -340,6 +357,7 @@ build = [ "cp CHANGELOG.md docs/source/project/", "cp CONTRIBUTING.md docs/source/project/", "cp README.md docs/source/project/", + "jupyter-book config sphinx docs/", "jupyter-book build docs/ ", "uv pip freeze > docs/requirements.txt", ] @@ -347,22 +365,29 @@ validate = "linkchecker --config .linkcheckerrc --ignore-url=/reference --ignore build-check = ["build"] #, "validate"] serve = "python3 -m http.server --directory docs/_build/html {args}" sphinx = [ - "jupyter-book config sphinx docs/ --overwrite", + "jupyter-book config sphinx docs/", "sphinx-build -b html docs/ docs/_build/html", "uv pip freeze > docs/requirements.txt", ] docs = ["build", "serve"] +# Environment to build the template repository +[tool.hatch.envs.template] +description = "Build and and test the project's mloq-template" +features = ["docs", "lint", "test"] +[tool.hatch.envs.template.scripts] +docs = ["cd mloq-template", "rye run build-docs"] +lint = ["cd mloq-template", "rye run lint"] +test = ["cd mloq-template", "rye run test"] +build = ["lint", "docs", "test"] +all = ["build", "python3 -m http.server --directory mloq-template/docs/_build/html {args}"] + # Lint environment [tool.hatch.envs.lint] description = "Run linting checks with ruff and mypi" template = "lint" # don't inherit from default! features = ["lint"] skip-install = true -dependencies = [ - "mypy", - "ruff", -] [tool.hatch.envs.lint.scripts] typing = [ "echo \"MYPY VERSION: `mypy --version`\"", @@ -372,14 +397,8 @@ style = [ "echo \"RUFF VERSION: `ruff --version`\"", "ruff check --fix-only --unsafe-fixes {args:.}", "ruff format {args:.}", ] -check = [ - "ruff check {args:.}", "ruff format --diff {args:.}","mypy {args:}" , -] -all = [ - "style", - "check", - "typing", -] +check = ["ruff check {args:.}", "ruff format --diff {args:.}"] +all = ["style", "check", "typing"] # Test matrix for various Python versions replacing the functionality of tox [[tool.hatch.envs.py-test.matrix]] diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 00000000..7a5b3129 --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,475 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false +# generate-hashes: false +# universal: true + +-e file:. +accessible-pygments==0.0.5 + # via pydata-sphinx-theme +alabaster==0.7.16 + # via sphinx +anyio==4.6.0 + # via httpx +appnope==0.1.4 ; platform_system == 'Darwin' + # via ipykernel +arrow==1.3.0 + # via cookiecutter + # via jinja2-time +astroid==3.3.5 + # via sphinx-autoapi + # via sphinx-autodoc2 +asttokens==2.4.1 + # via stack-data +attrs==24.2.0 + # via jsonschema + # via jupyter-cache + # via referencing +autoapi==2.0.1 + # via ml-ops-quickstart +babel==2.16.0 + # via pydata-sphinx-theme + # via sphinx +backports-tarfile==1.2.0 ; python_full_version < '3.12' + # via jaraco-context +beautifulsoup4==4.12.3 + # via pydata-sphinx-theme +binaryornot==0.4.4 + # via cookiecutter +certifi==2024.8.30 + # via httpcore + # via httpx + # via requests +cffi==1.17.1 ; (platform_python_implementation != 'PyPy' and sys_platform == 'linux') or platform_python_implementation == 'PyPy' or implementation_name == 'pypy' + # via cryptography + # via pyzmq + # via zstandard +cfgv==3.4.0 + # via pre-commit +chardet==5.2.0 + # via binaryornot +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via cookiecutter + # via hatch + # via jupyter-book + # via jupyter-cache + # via ml-ops-quickstart + # via sphinx-external-toc + # via userpath +colorama==0.4.6 + # via click + # via ipython + # via ml-ops-quickstart + # via pytest + # via sphinx +comm==0.2.2 + # via ipykernel +cookiecutter==2.6.0 + # via ml-ops-quickstart +coverage==7.6.1 + # via pytest-cov +cryptography==43.0.1 ; sys_platform == 'linux' + # via secretstorage +debugpy==1.8.6 + # via ipykernel +decorator==5.1.1 + # via ipython +distlib==0.3.8 + # via virtualenv +distro==1.9.0 + # via ruyaml +docutils==0.20.1 + # via myst-parser + # via pybtex-docutils + # via pydata-sphinx-theme + # via sphinx + # via sphinx-rtd-theme + # via sphinx-togglebutton + # via sphinxcontrib-bibtex +exceptiongroup==1.2.2 ; python_full_version < '3.11' + # via anyio + # via ipython + # via pytest +execnet==2.1.1 + # via pytest-xdist +executing==2.1.0 + # via stack-data +fastjsonschema==2.20.0 + # via nbformat +filelock==3.16.1 + # via virtualenv +flogging==0.0.23 + # via ml-ops-quickstart +greenlet==3.1.1 ; (python_full_version < '3.13' and platform_machine == 'AMD64') or (python_full_version < '3.13' and platform_machine == 'WIN32') or (python_full_version < '3.13' and platform_machine == 'aarch64') or (python_full_version < '3.13' and platform_machine == 'amd64') or (python_full_version < '3.13' and platform_machine == 'ppc64le') or (python_full_version < '3.13' and platform_machine == 'win32') or (python_full_version < '3.13' and platform_machine == 'x86_64') + # via sqlalchemy +h11==0.14.0 + # via httpcore +hatch==1.12.0 +hatchling==1.25.0 + # via hatch +httpcore==1.0.6 + # via httpx +httpx==0.27.2 + # via hatch +hyperlink==21.0.0 + # via hatch +identify==2.6.1 + # via pre-commit +idna==3.10 + # via anyio + # via httpx + # via hyperlink + # via requests +imagesize==1.4.1 + # via sphinx +importlib-metadata==8.5.0 + # via jupyter-cache + # via keyring + # via myst-nb +iniconfig==2.0.0 + # via pytest +ipykernel==6.29.5 + # via myst-nb +ipython==8.28.0 + # via ipykernel + # via myst-nb +isort==5.13.2 + # via ml-ops-quickstart +jaraco-classes==3.4.0 + # via keyring +jaraco-context==6.0.1 + # via keyring +jaraco-functools==4.1.0 + # via keyring +jedi==0.19.1 + # via ipython +jeepney==0.8.0 ; sys_platform == 'linux' + # via keyring + # via secretstorage +jinja2==3.1.4 + # via cookiecutter + # via jinja2-time + # via jupyter-book + # via myst-parser + # via sphinx + # via sphinx-autoapi +jinja2-time==0.2.0 + # via ml-ops-quickstart +jsonschema==4.23.0 + # via jupyter-book + # via nbformat +jsonschema-specifications==2023.12.1 + # via jsonschema +jupyter-book==1.0.2 + # via ml-ops-quickstart +jupyter-cache==1.0.0 + # via ml-ops-quickstart + # via myst-nb +jupyter-client==8.6.3 + # via ipykernel + # via nbclient +jupyter-core==5.7.2 + # via ipykernel + # via jupyter-client + # via nbclient + # via nbformat +keyring==25.4.1 + # via hatch +latexcodec==3.0.0 + # via pybtex +linkify-it-py==2.0.3 + # via jupyter-book + # via ml-ops-quickstart +markdown-it-py==3.0.0 + # via mdit-py-plugins + # via myst-parser + # via rich +markupsafe==2.1.5 + # via jinja2 +matplotlib-inline==0.1.7 + # via ipykernel + # via ipython +mdit-py-plugins==0.4.2 + # via myst-parser +mdurl==0.1.2 + # via markdown-it-py +more-itertools==10.5.0 + # via jaraco-classes + # via jaraco-functools +mypy==1.11.2 + # via ml-ops-quickstart +mypy-extensions==1.0.0 + # via mypy +myst-nb==1.1.2 + # via jupyter-book + # via ml-ops-quickstart +myst-parser==2.0.0 + # via jupyter-book + # via ml-ops-quickstart + # via myst-nb +nbclient==0.10.0 + # via jupyter-cache + # via myst-nb +nbformat==5.10.4 + # via jupyter-cache + # via myst-nb + # via nbclient +nest-asyncio==1.6.0 + # via ipykernel +nodeenv==1.9.1 + # via pre-commit +packaging==24.1 + # via hatch + # via hatchling + # via ipykernel + # via pydata-sphinx-theme + # via pytest + # via sphinx + # via sphinx-jupyterbook-latex +parso==0.8.4 + # via jedi +pathspec==0.12.1 + # via hatchling +pexpect==4.9.0 + # via hatch + # via ipython +platformdirs==4.3.6 + # via hatch + # via jupyter-core + # via virtualenv +pluggy==1.5.0 + # via hatchling + # via pytest +pre-commit==4.0.0 + # via ml-ops-quickstart +prompt-toolkit==3.0.48 + # via ipython +psutil==6.0.0 + # via ipykernel +ptyprocess==0.7.0 + # via pexpect +pure-eval==0.2.3 + # via stack-data +pybtex==0.24.0 + # via pybtex-docutils + # via sphinxcontrib-bibtex +pybtex-docutils==1.0.3 + # via sphinxcontrib-bibtex +pycparser==2.22 ; (platform_python_implementation != 'PyPy' and sys_platform == 'linux') or platform_python_implementation == 'PyPy' or implementation_name == 'pypy' + # via cffi +pydata-sphinx-theme==0.15.4 + # via ml-ops-quickstart + # via sphinx-book-theme +pygments==2.18.0 + # via accessible-pygments + # via ipython + # via pydata-sphinx-theme + # via rich + # via sphinx +pytest==8.3.3 + # via ml-ops-quickstart + # via pytest-cov + # via pytest-xdist +pytest-cov==5.0.0 + # via ml-ops-quickstart +pytest-xdist==3.6.1 + # via ml-ops-quickstart +python-dateutil==2.9.0.post0 + # via arrow + # via jupyter-client +python-slugify==8.0.4 + # via cookiecutter +pywin32==307 ; platform_python_implementation != 'PyPy' and sys_platform == 'win32' + # via jupyter-core +pywin32-ctypes==0.2.3 ; sys_platform == 'win32' + # via keyring +pyyaml==6.0.2 + # via cookiecutter + # via jupyter-book + # via jupyter-cache + # via myst-nb + # via myst-parser + # via pre-commit + # via pybtex + # via sphinx-autoapi + # via sphinx-external-toc +pyzmq==26.2.0 + # via ipykernel + # via jupyter-client +referencing==0.35.1 + # via jsonschema + # via jsonschema-specifications +requests==2.32.3 + # via cookiecutter + # via sphinx +rich==13.9.2 + # via cookiecutter + # via hatch +rpds-py==0.20.0 + # via jsonschema + # via referencing +ruff==0.6.9 + # via ml-ops-quickstart +ruyaml==0.91.0 + # via ml-ops-quickstart +secretstorage==3.3.3 ; sys_platform == 'linux' + # via keyring +setuptools==75.1.0 + # via ruyaml + # via sphinx-togglebutton + # via sphinxcontrib-bibtex +shellingham==1.5.4 + # via hatch +six==1.16.0 + # via asttokens + # via pybtex + # via python-dateutil +sniffio==1.3.1 + # via anyio + # via httpx +snowballstemmer==2.2.0 + # via sphinx +soupsieve==2.6 + # via beautifulsoup4 +sphinx==7.4.7 + # via autoapi + # via jupyter-book + # via ml-ops-quickstart + # via myst-nb + # via myst-parser + # via pydata-sphinx-theme + # via sphinx-autoapi + # via sphinx-book-theme + # via sphinx-comments + # via sphinx-copybutton + # via sphinx-design + # via sphinx-external-toc + # via sphinx-jupyterbook-latex + # via sphinx-multitoc-numbering + # via sphinx-rtd-theme + # via sphinx-thebe + # via sphinx-togglebutton + # via sphinxcontrib-bibtex + # via sphinxcontrib-jquery + # via sphinxext-opengraph +sphinx-autoapi==3.3.2 + # via ml-ops-quickstart +sphinx-autodoc2==0.5.0 + # via ml-ops-quickstart +sphinx-book-theme==1.1.3 + # via jupyter-book + # via ml-ops-quickstart +sphinx-comments==0.0.3 + # via jupyter-book +sphinx-copybutton==0.5.2 + # via jupyter-book + # via ml-ops-quickstart +sphinx-design==0.6.1 + # via jupyter-book +sphinx-external-toc==1.0.1 + # via jupyter-book +sphinx-jupyterbook-latex==1.0.0 + # via jupyter-book +sphinx-multitoc-numbering==0.1.3 + # via jupyter-book +sphinx-rtd-theme==2.0.0 + # via ml-ops-quickstart +sphinx-thebe==0.3.1 + # via jupyter-book +sphinx-togglebutton==0.3.2 + # via jupyter-book + # via ml-ops-quickstart +sphinxcontrib-applehelp==2.0.0 + # via sphinx +sphinxcontrib-bibtex==2.6.3 + # via jupyter-book + # via ml-ops-quickstart +sphinxcontrib-devhelp==2.0.0 + # via sphinx +sphinxcontrib-htmlhelp==2.1.0 + # via sphinx +sphinxcontrib-jquery==4.1 + # via sphinx-rtd-theme +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-mermaid==0.9.2 + # via ml-ops-quickstart +sphinxcontrib-qthelp==2.0.0 + # via sphinx +sphinxcontrib-serializinghtml==2.0.0 + # via sphinx +sphinxext-opengraph==0.9.1 + # via ml-ops-quickstart +sqlalchemy==2.0.35 + # via jupyter-cache +stack-data==0.6.3 + # via ipython +tabulate==0.9.0 + # via jupyter-cache +text-unidecode==1.3 + # via python-slugify +tomli==2.0.2 ; python_full_version <= '3.11' + # via coverage + # via hatchling + # via mypy + # via pytest + # via sphinx + # via sphinx-autodoc2 +tomli-w==1.0.0 + # via hatch +tomlkit==0.13.2 + # via hatch +tornado==6.4.1 + # via ipykernel + # via jupyter-client +traitlets==5.14.3 + # via comm + # via ipykernel + # via ipython + # via jupyter-client + # via jupyter-core + # via matplotlib-inline + # via nbclient + # via nbformat +trove-classifiers==2024.9.12 + # via hatchling +types-python-dateutil==2.9.0.20241003 + # via arrow +typing-extensions==4.12.2 + # via anyio + # via astroid + # via ipython + # via mypy + # via myst-nb + # via pydata-sphinx-theme + # via rich + # via sphinx-autodoc2 + # via sqlalchemy +uc-micro-py==1.0.3 + # via linkify-it-py +urllib3==2.2.3 + # via requests +userpath==1.9.2 + # via hatch +uv==0.4.18 + # via hatch +virtualenv==20.26.6 + # via hatch + # via pre-commit +wcwidth==0.2.13 + # via prompt-toolkit +wheel==0.44.0 + # via sphinx-togglebutton +xxhash==3.5.0 + # via flogging +zipp==3.20.2 + # via importlib-metadata +zstandard==0.23.0 + # via hatch diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 00000000..875f34b9 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,401 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false +# generate-hashes: false +# universal: true + +-e file:. +accessible-pygments==0.0.5 + # via pydata-sphinx-theme +alabaster==0.7.16 + # via sphinx +appnope==0.1.4 ; platform_system == 'Darwin' + # via ipykernel +arrow==1.3.0 + # via cookiecutter + # via jinja2-time +astroid==3.3.5 + # via sphinx-autoapi + # via sphinx-autodoc2 +asttokens==2.4.1 + # via stack-data +attrs==24.2.0 + # via jsonschema + # via jupyter-cache + # via referencing +autoapi==2.0.1 + # via ml-ops-quickstart +babel==2.16.0 + # via pydata-sphinx-theme + # via sphinx +beautifulsoup4==4.12.3 + # via pydata-sphinx-theme +binaryornot==0.4.4 + # via cookiecutter +certifi==2024.8.30 + # via requests +cffi==1.17.1 ; implementation_name == 'pypy' + # via pyzmq +cfgv==3.4.0 + # via pre-commit +chardet==5.2.0 + # via binaryornot +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via cookiecutter + # via jupyter-book + # via jupyter-cache + # via ml-ops-quickstart + # via sphinx-external-toc +colorama==0.4.6 + # via click + # via ipython + # via ml-ops-quickstart + # via pytest + # via sphinx +comm==0.2.2 + # via ipykernel +cookiecutter==2.6.0 + # via ml-ops-quickstart +coverage==7.6.1 + # via pytest-cov +debugpy==1.8.6 + # via ipykernel +decorator==5.1.1 + # via ipython +distlib==0.3.8 + # via virtualenv +distro==1.9.0 + # via ruyaml +docutils==0.20.1 + # via myst-parser + # via pybtex-docutils + # via pydata-sphinx-theme + # via sphinx + # via sphinx-rtd-theme + # via sphinx-togglebutton + # via sphinxcontrib-bibtex +exceptiongroup==1.2.2 ; python_full_version < '3.11' + # via ipython + # via pytest +execnet==2.1.1 + # via pytest-xdist +executing==2.1.0 + # via stack-data +fastjsonschema==2.20.0 + # via nbformat +filelock==3.16.1 + # via virtualenv +flogging==0.0.23 + # via ml-ops-quickstart +greenlet==3.1.1 ; (python_full_version < '3.13' and platform_machine == 'AMD64') or (python_full_version < '3.13' and platform_machine == 'WIN32') or (python_full_version < '3.13' and platform_machine == 'aarch64') or (python_full_version < '3.13' and platform_machine == 'amd64') or (python_full_version < '3.13' and platform_machine == 'ppc64le') or (python_full_version < '3.13' and platform_machine == 'win32') or (python_full_version < '3.13' and platform_machine == 'x86_64') + # via sqlalchemy +identify==2.6.1 + # via pre-commit +idna==3.10 + # via requests +imagesize==1.4.1 + # via sphinx +importlib-metadata==8.5.0 + # via jupyter-cache + # via myst-nb +iniconfig==2.0.0 + # via pytest +ipykernel==6.29.5 + # via myst-nb +ipython==8.28.0 + # via ipykernel + # via myst-nb +isort==5.13.2 + # via ml-ops-quickstart +jedi==0.19.1 + # via ipython +jinja2==3.1.4 + # via cookiecutter + # via jinja2-time + # via jupyter-book + # via myst-parser + # via sphinx + # via sphinx-autoapi +jinja2-time==0.2.0 + # via ml-ops-quickstart +jsonschema==4.23.0 + # via jupyter-book + # via nbformat +jsonschema-specifications==2023.12.1 + # via jsonschema +jupyter-book==1.0.2 + # via ml-ops-quickstart +jupyter-cache==1.0.0 + # via ml-ops-quickstart + # via myst-nb +jupyter-client==8.6.3 + # via ipykernel + # via nbclient +jupyter-core==5.7.2 + # via ipykernel + # via jupyter-client + # via nbclient + # via nbformat +latexcodec==3.0.0 + # via pybtex +linkify-it-py==2.0.3 + # via jupyter-book + # via ml-ops-quickstart +markdown-it-py==3.0.0 + # via mdit-py-plugins + # via myst-parser + # via rich +markupsafe==2.1.5 + # via jinja2 +matplotlib-inline==0.1.7 + # via ipykernel + # via ipython +mdit-py-plugins==0.4.2 + # via myst-parser +mdurl==0.1.2 + # via markdown-it-py +mypy==1.11.2 + # via ml-ops-quickstart +mypy-extensions==1.0.0 + # via mypy +myst-nb==1.1.2 + # via jupyter-book + # via ml-ops-quickstart +myst-parser==2.0.0 + # via jupyter-book + # via ml-ops-quickstart + # via myst-nb +nbclient==0.10.0 + # via jupyter-cache + # via myst-nb +nbformat==5.10.4 + # via jupyter-cache + # via myst-nb + # via nbclient +nest-asyncio==1.6.0 + # via ipykernel +nodeenv==1.9.1 + # via pre-commit +packaging==24.1 + # via ipykernel + # via pydata-sphinx-theme + # via pytest + # via sphinx + # via sphinx-jupyterbook-latex +parso==0.8.4 + # via jedi +pexpect==4.9.0 ; sys_platform != 'emscripten' and sys_platform != 'win32' + # via ipython +platformdirs==4.3.6 + # via jupyter-core + # via virtualenv +pluggy==1.5.0 + # via pytest +pre-commit==4.0.0 + # via ml-ops-quickstart +prompt-toolkit==3.0.48 + # via ipython +psutil==6.0.0 + # via ipykernel +ptyprocess==0.7.0 ; sys_platform != 'emscripten' and sys_platform != 'win32' + # via pexpect +pure-eval==0.2.3 + # via stack-data +pybtex==0.24.0 + # via pybtex-docutils + # via sphinxcontrib-bibtex +pybtex-docutils==1.0.3 + # via sphinxcontrib-bibtex +pycparser==2.22 ; implementation_name == 'pypy' + # via cffi +pydata-sphinx-theme==0.15.4 + # via ml-ops-quickstart + # via sphinx-book-theme +pygments==2.18.0 + # via accessible-pygments + # via ipython + # via pydata-sphinx-theme + # via rich + # via sphinx +pytest==8.3.3 + # via ml-ops-quickstart + # via pytest-cov + # via pytest-xdist +pytest-cov==5.0.0 + # via ml-ops-quickstart +pytest-xdist==3.6.1 + # via ml-ops-quickstart +python-dateutil==2.9.0.post0 + # via arrow + # via jupyter-client +python-slugify==8.0.4 + # via cookiecutter +pywin32==307 ; platform_python_implementation != 'PyPy' and sys_platform == 'win32' + # via jupyter-core +pyyaml==6.0.2 + # via cookiecutter + # via jupyter-book + # via jupyter-cache + # via myst-nb + # via myst-parser + # via pre-commit + # via pybtex + # via sphinx-autoapi + # via sphinx-external-toc +pyzmq==26.2.0 + # via ipykernel + # via jupyter-client +referencing==0.35.1 + # via jsonschema + # via jsonschema-specifications +requests==2.32.3 + # via cookiecutter + # via sphinx +rich==13.9.2 + # via cookiecutter +rpds-py==0.20.0 + # via jsonschema + # via referencing +ruff==0.6.9 + # via ml-ops-quickstart +ruyaml==0.91.0 + # via ml-ops-quickstart +setuptools==75.1.0 + # via ruyaml + # via sphinx-togglebutton + # via sphinxcontrib-bibtex +six==1.16.0 + # via asttokens + # via pybtex + # via python-dateutil +snowballstemmer==2.2.0 + # via sphinx +soupsieve==2.6 + # via beautifulsoup4 +sphinx==7.4.7 + # via autoapi + # via jupyter-book + # via ml-ops-quickstart + # via myst-nb + # via myst-parser + # via pydata-sphinx-theme + # via sphinx-autoapi + # via sphinx-book-theme + # via sphinx-comments + # via sphinx-copybutton + # via sphinx-design + # via sphinx-external-toc + # via sphinx-jupyterbook-latex + # via sphinx-multitoc-numbering + # via sphinx-rtd-theme + # via sphinx-thebe + # via sphinx-togglebutton + # via sphinxcontrib-bibtex + # via sphinxcontrib-jquery + # via sphinxext-opengraph +sphinx-autoapi==3.3.2 + # via ml-ops-quickstart +sphinx-autodoc2==0.5.0 + # via ml-ops-quickstart +sphinx-book-theme==1.1.3 + # via jupyter-book + # via ml-ops-quickstart +sphinx-comments==0.0.3 + # via jupyter-book +sphinx-copybutton==0.5.2 + # via jupyter-book + # via ml-ops-quickstart +sphinx-design==0.6.1 + # via jupyter-book +sphinx-external-toc==1.0.1 + # via jupyter-book +sphinx-jupyterbook-latex==1.0.0 + # via jupyter-book +sphinx-multitoc-numbering==0.1.3 + # via jupyter-book +sphinx-rtd-theme==2.0.0 + # via ml-ops-quickstart +sphinx-thebe==0.3.1 + # via jupyter-book +sphinx-togglebutton==0.3.2 + # via jupyter-book + # via ml-ops-quickstart +sphinxcontrib-applehelp==2.0.0 + # via sphinx +sphinxcontrib-bibtex==2.6.3 + # via jupyter-book + # via ml-ops-quickstart +sphinxcontrib-devhelp==2.0.0 + # via sphinx +sphinxcontrib-htmlhelp==2.1.0 + # via sphinx +sphinxcontrib-jquery==4.1 + # via sphinx-rtd-theme +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-mermaid==0.9.2 + # via ml-ops-quickstart +sphinxcontrib-qthelp==2.0.0 + # via sphinx +sphinxcontrib-serializinghtml==2.0.0 + # via sphinx +sphinxext-opengraph==0.9.1 + # via ml-ops-quickstart +sqlalchemy==2.0.35 + # via jupyter-cache +stack-data==0.6.3 + # via ipython +tabulate==0.9.0 + # via jupyter-cache +text-unidecode==1.3 + # via python-slugify +tomli==2.0.2 ; python_full_version <= '3.11' + # via coverage + # via mypy + # via pytest + # via sphinx + # via sphinx-autodoc2 +tornado==6.4.1 + # via ipykernel + # via jupyter-client +traitlets==5.14.3 + # via comm + # via ipykernel + # via ipython + # via jupyter-client + # via jupyter-core + # via matplotlib-inline + # via nbclient + # via nbformat +types-python-dateutil==2.9.0.20241003 + # via arrow +typing-extensions==4.12.2 + # via astroid + # via ipython + # via mypy + # via myst-nb + # via pydata-sphinx-theme + # via rich + # via sphinx-autodoc2 + # via sqlalchemy +uc-micro-py==1.0.3 + # via linkify-it-py +urllib3==2.2.3 + # via requests +virtualenv==20.26.6 + # via pre-commit +wcwidth==0.2.13 + # via prompt-toolkit +wheel==0.44.0 + # via sphinx-togglebutton +xxhash==3.5.0 + # via flogging +zipp==3.20.2 + # via importlib-metadata diff --git a/src/mloq/__init__.py b/src/mloq/__init__.py index 693f041b..ee52a23e 100644 --- a/src/mloq/__init__.py +++ b/src/mloq/__init__.py @@ -1,7 +1,8 @@ -__version__ = "0.1.0" +import flogging from .core import compute + __all__ = [ "compute", ] diff --git a/src/mloq/__main__.py b/src/mloq/__main__.py index 416f8755..eff51480 100644 --- a/src/mloq/__main__.py +++ b/src/mloq/__main__.py @@ -8,8 +8,12 @@ """ import sys + +import flogging + from mloq.cli import run if __name__ == "__main__": + flogging.setup() sys.exit(run()) diff --git a/templates/mlops b/templates/mlops index ec8a25de..063686ac 160000 --- a/templates/mlops +++ b/templates/mlops @@ -1 +1 @@ -Subproject commit ec8a25de84e0b3ebfb464b8957206f5c28c2dc9e +Subproject commit 063686acac8ba07964df2eb6ef8cc2e50133732a