A flask project generator.

TTWShell, updated 🕥 2023-02-23 20:00:57

Hobbit-core

CircleCI Documentation Status PyPi-Version Python-version codecov License

A flask project generator. Based on Flask + SQLAlchemy + marshmallow + webargs.

https://hobbit-core.readthedocs.io/zh/latest/

Installation

Install and update using pip(Still using Python 2? It is time to upgrade.):

pip install -U "hobbit-core[hobbit]"  # just install hobbit cmd
pip install -U "hobbit-core[hobbit,hobbit_core]"  # recommended when use virtualenv

A Simple Example

Init project:

hobbit --echo new -n demo -d /tmp/demo -p 5000 -t rivendell
cd /tmp/demo
pipenv install -r requirements.txt --pre && pipenv install --dev pytest pytest-cov pytest-env ipython flake8 ipdb
pipenv shell

Run server:

(demo) ➜  demo FLASK_APP=app/run.py flask run
 * Serving Flask app "app/run.py"
 * Environment: production
 WARNING: This is a development server. Do not use it in a production deployment.
 Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Run test:

(demo) ➜  demo py.test
===================================================== test session starts ======================================================
platform darwin -- Python 3.7.0, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- /Users/Legolas/.virtualenvs/demo-OzheZQoG/bin/python3.7
cachedir: .pytest_cache
rootdir: /private/tmp/demo, inifile: pytest.ini
plugins: env-0.6.2, cov-2.7.1
collected 2 items

tests/test_option.py::TestOption::test_options PASSED
tests/test_ping.py::TestAPIExample::test_ping_api PASSED

---------- coverage: platform darwin, python 3.7.0-final-0 -----------
Name                         Stmts   Miss  Cover   Missing
----------------------------------------------------------
app/__init__.py                  0      0   100%
app/configs/__init__.py          0      0   100%
app/configs/default.py           6      0   100%
app/configs/development.py       1      1     0%   1
app/configs/production.py        2      2     0%   1-3
app/configs/testing.py           8      0   100%
app/core/__init__.py             0      0   100%
app/exts.py                      8      0   100%
app/models/__init__.py           2      0   100%
app/models/consts.py             1      0   100%
app/run.py                      35      1    97%   49
app/schemas/__init__.py          2      0   100%
app/services/__init__.py         2      0   100%
app/services/option.py           6      0   100%
app/tasks/__init__.py            1      1     0%   1
app/utils/__init__.py            0      0   100%
app/views/__init__.py            2      0   100%
app/views/option.py              5      0   100%
app/views/ping.py                7      0   100%
tests/__init__.py               17      1    94%   29
tests/conftest.py               11      0   100%
tests/test_option.py             5      0   100%
tests/test_ping.py               5      0   100%
----------------------------------------------------------
TOTAL                          126      6    95%


=================================================== 2 passed in 0.24 seconds ===================================================

Others

hobbit --help

Issues

Bump markdown-it-py from 2.1.0 to 2.2.0

opened on 2023-02-23 20:00:56 by dependabot[bot]

Bumps markdown-it-py from 2.1.0 to 2.2.0.

Release notes

Sourced from markdown-it-py's releases.

v2.2.0

What's Changed

New Contributors

Thanks to 🎉

Full Changelog: https://github.com/executablebooks/markdown-it-py/compare/v2.1.0...v2.2.0

Changelog

Sourced from markdown-it-py's changelog.

2.2.0 - 2023-02-22

What's Changed

New Contributors

Thanks to 🎉

Full Changelog: https://github.com/executablebooks/markdown-it-py/compare/v2.1.0...v2.2.0

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/TTWShell/hobbit-core/network/alerts).

Bump werkzeug from 2.2.2 to 2.2.3

opened on 2023-02-16 07:14:16 by dependabot[bot]

Bumps werkzeug from 2.2.2 to 2.2.3.

Release notes

Sourced from werkzeug's releases.

2.2.3

This is a fix release for the 2.2.x release branch.

This release contains security fixes for:

Changelog

Sourced from werkzeug's changelog.

Version 2.2.3

Released 2023-02-14

  • Ensure that URL rules using path converters will redirect with strict slashes when the trailing slash is missing. :issue:2533
  • Type signature for get_json specifies that return type is not optional when silent=False. :issue:2508
  • parse_content_range_header returns None for a value like bytes */-1 where the length is invalid, instead of raising an AssertionError. :issue:2531
  • Address remaining ResourceWarning related to the socket used by run_simple. Remove prepare_socket, which now happens when creating the server. :issue:2421
  • Update pre-existing headers for multipart/form-data requests with the test client. :issue:2549
  • Fix handling of header extended parameters such that they are no longer quoted. :issue:2529
  • LimitedStream.read works correctly when wrapping a stream that may not return the requested size in one read call. :issue:2558
  • A cookie header that starts with = is treated as an empty key and discarded, rather than stripping the leading ==.
  • Specify a maximum number of multipart parts, default 1000, after which a RequestEntityTooLarge exception is raised on parsing. This mitigates a DoS attack where a larger number of form/file parts would result in disproportionate resource use.
Commits
  • 22a254f release version 2.2.3
  • 517cac5 Merge pull request from GHSA-xg9f-g7g7-2323
  • babc8d9 rewrite docs about request data limits
  • 09449ee clean up docs
  • fe899d0 limit the maximum number of multipart form parts
  • cf275f4 Merge pull request from GHSA-px8h-6qxv-m22q
  • 8c2b4b8 don't strip leading = when parsing cookie
  • 7c7ce5c [pre-commit.ci] pre-commit autoupdate (#2585)
  • 19ae03e [pre-commit.ci] auto fixes from pre-commit.com hooks
  • a83d3b8 [pre-commit.ci] pre-commit autoupdate
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/TTWShell/hobbit-core/network/alerts).

Bump ipython from 8.7.0 to 8.10.0

opened on 2023-02-11 02:21:41 by dependabot[bot]

Bumps ipython from 8.7.0 to 8.10.0.

Commits
  • 15ea1ed release 8.10.0
  • 560ad10 DOC: Update what's new for 8.10 (#13939)
  • 7557ade DOC: Update what's new for 8.10
  • 385d693 Merge pull request from GHSA-29gw-9793-fvw7
  • e548ee2 Swallow potential exceptions from showtraceback() (#13934)
  • 0694b08 MAINT: mock slowest test. (#13885)
  • 8655912 MAINT: mock slowest test.
  • a011765 Isolate the attack tests with setUp and tearDown methods
  • c7a9470 Add some regression tests for this change
  • fd34cf5 Swallow potential exceptions from showtraceback()
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/TTWShell/hobbit-core/network/alerts).

deploy不再使用bash脚本,相关文件切换到 makefile + k8s

opened on 2021-06-21 03:19:16 by TTWShell None

Releases

3.1.0 2023-01-29 10:44:12

  • Support HOBBIT_RESPONSE_DETAIL config: Default return detail and must set to False in production env. Default is True. Only used in 500 server error response.

3.0.0 2022-12-12 05:55:45

3.0.0.rc4 2022-12-08 07:36:36

Upgrade flask-migrate

3.0.0rc3 2022-12-06 11:31:08

Fixed response inheritance: status is property and use with setter.

3.0.0rc2 2022-12-06 01:45:06

Fixed bugs in hobbit cmd & rm support of celery.

3.0.0rc1 2022-12-05 09:03:14

Test for upgrade of flask and sqlalchemy.

Legolas Bloom

势利纷华,不近者为洁,近之而不染者尤洁; 智械机巧,不知者为高,知之而不用者尤高。

GitHub Repository Homepage

flask sqlalchemy marshmallow restful restful-webservices hobbit python