Spaces:
Running
Running
freemt
commited on
Commit
·
e55a136
0
Parent(s):
first commit
Browse files- .flake8 +19 -0
- .github/workflows/codeql-analysis.yml- +67 -0
- .github/workflows/routine-tests.yml +30 -0
- .gitignore +143 -0
- LICENSE +21 -0
- README.md +18 -0
- mlbee/__init__.py +5 -0
- mlbee/__main__.py +45 -0
- mlbee/mlbee.py +7 -0
- nodemon.json +21 -0
- package.json +21 -0
- poetry.toml +3 -0
- pylintrc +7 -0
- pyproject.toml +67 -0
- pyrightconfig.json +9 -0
- tests/__init__.py +1 -0
- tests/test_mlbee.py +17 -0
.flake8
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[flake8]
|
2 |
+
ignore =
|
3 |
+
D203,
|
4 |
+
# line too long
|
5 |
+
E501
|
6 |
+
per-file-ignores =
|
7 |
+
# imported but unused
|
8 |
+
# __init__.py: F401
|
9 |
+
test_*.py: F401
|
10 |
+
exclude =
|
11 |
+
.git,
|
12 |
+
__pycache__,
|
13 |
+
docs/source/conf.py,
|
14 |
+
old,
|
15 |
+
build,
|
16 |
+
dist,
|
17 |
+
.venv
|
18 |
+
pad*.py
|
19 |
+
max-complexity = 25
|
.github/workflows/codeql-analysis.yml-
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# For most projects, this workflow file will not need changing; you simply need
|
2 |
+
# to commit it to your repository.
|
3 |
+
#
|
4 |
+
# You may wish to alter this file to override the set of languages analyzed,
|
5 |
+
# or to provide custom queries or build logic.
|
6 |
+
#
|
7 |
+
# ******** NOTE ********
|
8 |
+
# We have attempted to detect the languages in your repository. Please check
|
9 |
+
# the `language` matrix defined below to confirm you have the correct set of
|
10 |
+
# supported CodeQL languages.
|
11 |
+
#
|
12 |
+
name: "CodeQL"
|
13 |
+
|
14 |
+
on:
|
15 |
+
push:
|
16 |
+
branches: [ master ]
|
17 |
+
pull_request:
|
18 |
+
# The branches below must be a subset of the branches above
|
19 |
+
branches: [ master ]
|
20 |
+
schedule:
|
21 |
+
- cron: '16 15 * * 2'
|
22 |
+
|
23 |
+
jobs:
|
24 |
+
analyze:
|
25 |
+
name: Analyze
|
26 |
+
runs-on: ubuntu-latest
|
27 |
+
|
28 |
+
strategy:
|
29 |
+
fail-fast: false
|
30 |
+
matrix:
|
31 |
+
language: [ 'python' ]
|
32 |
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
33 |
+
# Learn more:
|
34 |
+
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
35 |
+
|
36 |
+
steps:
|
37 |
+
- name: Checkout repository
|
38 |
+
uses: actions/checkout@v2
|
39 |
+
|
40 |
+
# Initializes the CodeQL tools for scanning.
|
41 |
+
- name: Initialize CodeQL
|
42 |
+
uses: github/codeql-action/init@v1
|
43 |
+
with:
|
44 |
+
languages: ${{ matrix.language }}
|
45 |
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
46 |
+
# By default, queries listed here will override any specified in a config file.
|
47 |
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
48 |
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
49 |
+
|
50 |
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
51 |
+
# If this step fails, then you should remove it and run the build manually (see below)
|
52 |
+
- name: Autobuild
|
53 |
+
uses: github/codeql-action/autobuild@v1
|
54 |
+
|
55 |
+
# ℹ️ Command-line programs to run using the OS shell.
|
56 |
+
# 📚 https://git.io/JvXDl
|
57 |
+
|
58 |
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
59 |
+
# and modify them (or add more) to build your code if your project
|
60 |
+
# uses a compiled language
|
61 |
+
|
62 |
+
#- run: |
|
63 |
+
# make bootstrap
|
64 |
+
# make release
|
65 |
+
|
66 |
+
- name: Perform CodeQL Analysis
|
67 |
+
uses: github/codeql-action/analyze@v1
|
.github/workflows/routine-tests.yml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: pytest
|
2 |
+
|
3 |
+
on:
|
4 |
+
push:
|
5 |
+
|
6 |
+
jobs:
|
7 |
+
flake8-pytest:
|
8 |
+
strategy:
|
9 |
+
fail-fast: false
|
10 |
+
matrix:
|
11 |
+
python-version: [3.8]
|
12 |
+
poetry-version: [1.1.2]
|
13 |
+
os: [ubuntu-18.04, macos-latest, windows-latest]
|
14 |
+
runs-on: ${{ matrix.os }}
|
15 |
+
steps:
|
16 |
+
- uses: actions/checkout@v2
|
17 |
+
- uses: actions/setup-python@v2
|
18 |
+
with:
|
19 |
+
python-version: ${{ matrix.python-version }}
|
20 |
+
- uses: abatilo/[email protected]
|
21 |
+
with:
|
22 |
+
poetry-version: ${{ matrix.poetry-version }}
|
23 |
+
- name: Install packages
|
24 |
+
run: poetry install # --no-dev
|
25 |
+
- name: Run flake8
|
26 |
+
run: |
|
27 |
+
poetry run flake8 --exit-zero
|
28 |
+
# poetry run pytest
|
29 |
+
- name: Run pytest
|
30 |
+
run: poetry run pytest tests
|
.gitignore
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Byte-compiled / optimized / DLL files
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
+
|
6 |
+
# C extensions
|
7 |
+
*.so
|
8 |
+
|
9 |
+
# Distribution / packaging
|
10 |
+
.Python
|
11 |
+
build/
|
12 |
+
develop-eggs/
|
13 |
+
dist/
|
14 |
+
downloads/
|
15 |
+
eggs/
|
16 |
+
.eggs/
|
17 |
+
lib/
|
18 |
+
lib64/
|
19 |
+
parts/
|
20 |
+
sdist/
|
21 |
+
var/
|
22 |
+
wheels/
|
23 |
+
share/python-wheels/
|
24 |
+
*.egg-info/
|
25 |
+
.installed.cfg
|
26 |
+
*.egg
|
27 |
+
MANIFEST
|
28 |
+
|
29 |
+
# PyInstaller
|
30 |
+
# Usually these files are written by a python script from a template
|
31 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32 |
+
*.manifest
|
33 |
+
*.spec
|
34 |
+
|
35 |
+
# Installer logs
|
36 |
+
pip-log.txt
|
37 |
+
pip-delete-this-directory.txt
|
38 |
+
|
39 |
+
# Unit test / coverage reports
|
40 |
+
htmlcov/
|
41 |
+
.tox/
|
42 |
+
.nox/
|
43 |
+
.coverage
|
44 |
+
.coverage.*
|
45 |
+
.cache
|
46 |
+
nosetests.xml
|
47 |
+
coverage.xml
|
48 |
+
*.cover
|
49 |
+
*.py,cover
|
50 |
+
.hypothesis/
|
51 |
+
.pytest_cache/
|
52 |
+
cover/
|
53 |
+
|
54 |
+
# Translations
|
55 |
+
*.mo
|
56 |
+
*.pot
|
57 |
+
|
58 |
+
# Django stuff:
|
59 |
+
*.log
|
60 |
+
local_settings.py
|
61 |
+
db.sqlite3
|
62 |
+
db.sqlite3-journal
|
63 |
+
|
64 |
+
# Flask stuff:
|
65 |
+
instance/
|
66 |
+
.webassets-cache
|
67 |
+
|
68 |
+
# Scrapy stuff:
|
69 |
+
.scrapy
|
70 |
+
|
71 |
+
# Sphinx documentation
|
72 |
+
docs/_build/
|
73 |
+
|
74 |
+
# PyBuilder
|
75 |
+
.pybuilder/
|
76 |
+
target/
|
77 |
+
|
78 |
+
# Jupyter Notebook
|
79 |
+
.ipynb_checkpoints
|
80 |
+
|
81 |
+
# IPython
|
82 |
+
profile_default/
|
83 |
+
ipython_config.py
|
84 |
+
|
85 |
+
# pyenv
|
86 |
+
# For a library or package, you might want to ignore these files since the code is
|
87 |
+
# intended to run in multiple environments; otherwise, check them in:
|
88 |
+
# .python-version
|
89 |
+
|
90 |
+
# pipenv
|
91 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
92 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
93 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
94 |
+
# install all needed dependencies.
|
95 |
+
#Pipfile.lock
|
96 |
+
|
97 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
98 |
+
__pypackages__/
|
99 |
+
|
100 |
+
# Celery stuff
|
101 |
+
celerybeat-schedule
|
102 |
+
celerybeat.pid
|
103 |
+
|
104 |
+
# SageMath parsed files
|
105 |
+
*.sage.py
|
106 |
+
|
107 |
+
# Environments
|
108 |
+
.env
|
109 |
+
.venv
|
110 |
+
env/
|
111 |
+
venv/
|
112 |
+
ENV/
|
113 |
+
env.bak/
|
114 |
+
venv.bak/
|
115 |
+
|
116 |
+
# Spyder project settings
|
117 |
+
.spyderproject
|
118 |
+
.spyproject
|
119 |
+
|
120 |
+
# Rope project settings
|
121 |
+
.ropeproject
|
122 |
+
|
123 |
+
# mkdocs documentation
|
124 |
+
/site
|
125 |
+
|
126 |
+
# mypy
|
127 |
+
.mypy_cache/
|
128 |
+
.dmypy.json
|
129 |
+
dmypy.json
|
130 |
+
|
131 |
+
# Pyre type checker
|
132 |
+
.pyre/
|
133 |
+
|
134 |
+
# pytype static type analyzer
|
135 |
+
.pytype/
|
136 |
+
|
137 |
+
# Cython debug symbols
|
138 |
+
cython_debug/
|
139 |
+
*.bat
|
140 |
+
*.swp
|
141 |
+
links/
|
142 |
+
# .gitignore
|
143 |
+
node_modules
|
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2020 ffreemt
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
README.md
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# mlbee
|
2 |
+
[](https://github.com/ffreemt/mlbee/actions)[](https://www.python.org/downloads/)[](https://github.com/psf/black)[](https://opensource.org/licenses/MIT)[](https://badge.fury.io/py/mlbee)
|
3 |
+
|
4 |
+
mlbee descr
|
5 |
+
|
6 |
+
## Install it
|
7 |
+
|
8 |
+
```shell
|
9 |
+
pip install git+https://github.com/ffreemt/mlbee
|
10 |
+
# poetry add git+https://github.com/ffreemt/mlbee
|
11 |
+
# git clone https://github.com/ffreemt/mlbee && cd mlbee
|
12 |
+
```
|
13 |
+
|
14 |
+
## Use it
|
15 |
+
```python
|
16 |
+
from mlbee import mlbee
|
17 |
+
|
18 |
+
```
|
mlbee/__init__.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Init."""
|
2 |
+
__version__ = "0.1.0"
|
3 |
+
from .mlbee import mlbee
|
4 |
+
|
5 |
+
__all__ = ("mlbee",)
|
mlbee/__main__.py
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Prep __main__.py."""
|
2 |
+
# pylint: disable=invalid-name
|
3 |
+
from pathlib import Path
|
4 |
+
from typing import Optional
|
5 |
+
|
6 |
+
import logzero
|
7 |
+
import typer
|
8 |
+
from logzero import logger
|
9 |
+
from set_loglevel import set_loglevel
|
10 |
+
|
11 |
+
from mlbee import __version__, mlbee
|
12 |
+
|
13 |
+
logzero.loglevel(set_loglevel())
|
14 |
+
|
15 |
+
app = typer.Typer(
|
16 |
+
name="mlbee",
|
17 |
+
add_completion=False,
|
18 |
+
help="mlbee help",
|
19 |
+
)
|
20 |
+
|
21 |
+
|
22 |
+
def _version_callback(value: bool) -> None:
|
23 |
+
if value:
|
24 |
+
typer.echo(f"{app.info.name} v.{__version__} -- ...")
|
25 |
+
raise typer.Exit()
|
26 |
+
|
27 |
+
|
28 |
+
@app.command()
|
29 |
+
def main(
|
30 |
+
version: Optional[bool] = typer.Option( # pylint: disable=(unused-argument
|
31 |
+
None,
|
32 |
+
"--version",
|
33 |
+
"-v",
|
34 |
+
"-V",
|
35 |
+
help="Show version info and exit.",
|
36 |
+
callback=_version_callback,
|
37 |
+
is_eager=True,
|
38 |
+
),
|
39 |
+
):
|
40 |
+
"""Define."""
|
41 |
+
...
|
42 |
+
|
43 |
+
|
44 |
+
if __name__ == "__main__":
|
45 |
+
app()
|
mlbee/mlbee.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Define mlbee."""
|
2 |
+
from logzero import logger
|
3 |
+
|
4 |
+
|
5 |
+
def mlbee():
|
6 |
+
"""Define mlbee."""
|
7 |
+
logger.debug(" entry ")
|
nodemon.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"restartable": "rs",
|
3 |
+
"ignore": [
|
4 |
+
".venv",
|
5 |
+
".git",
|
6 |
+
"node_modules/**/node_modules"
|
7 |
+
],
|
8 |
+
"verbose": true,
|
9 |
+
"execMap": {
|
10 |
+
"js": "node --harmony"
|
11 |
+
},
|
12 |
+
"watch": [
|
13 |
+
"tests",
|
14 |
+
"test/fixtures/",
|
15 |
+
"test/samples/"
|
16 |
+
],
|
17 |
+
"env": {
|
18 |
+
"NODE_ENV": "development"
|
19 |
+
},
|
20 |
+
"ext": "js json py"
|
21 |
+
}
|
package.json
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"dependencies": {
|
3 |
+
"npm-run-all": "^4.1.5"
|
4 |
+
},
|
5 |
+
"scripts": {
|
6 |
+
"start": "pyright && pytest && yarn style",
|
7 |
+
"test": "nodemon -w tests -w mlbee -x pytest tests",
|
8 |
+
"pyright": "nodemon -w mlbee -w .venv -e .py -x pyright mlbee tests",
|
9 |
+
"pytest": "nodemon -w tests -w mlbee -e .py -x pytest tests mlbee",
|
10 |
+
"style": "nodemon -w mlbee -w tests -x \"black tests mlbee && python -m flake8\"",
|
11 |
+
"docstyle": "nodemon -w mlbee -w tests -x pydocstyle --convention=google tests mlbee",
|
12 |
+
"pylint": "nodemon -w mlbee -e .py -x pylint mlbee",
|
13 |
+
"test:mlbee": "nodemon -w tests -e .py -x pytest -k mlbee tests",
|
14 |
+
"publish": "poetry build && poetry publish",
|
15 |
+
"black": "black tests mlbee",
|
16 |
+
"flake8": "flake8 tests mlbee",
|
17 |
+
"pflake8": "pflake8 tests mlbee",
|
18 |
+
"pep257": "pep257 tests mlbee",
|
19 |
+
"final": "run-s docstyle black flake8 pytest"
|
20 |
+
}
|
21 |
+
}
|
poetry.toml
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
[virtualenvs]
|
2 |
+
create = true
|
3 |
+
in-project = true
|
pylintrc
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[EXCEPTIONS]
|
2 |
+
# C0301 line too long
|
3 |
+
# R0801 dup
|
4 |
+
# C0103 invalid-name
|
5 |
+
# W0612 unused-variable
|
6 |
+
# W0611 unused-import
|
7 |
+
disable=W0703,R0801,C0103,C0301,W0612,W0611
|
pyproject.toml
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool.poetry]
|
2 |
+
name = "mlbee"
|
3 |
+
version = "0.1.0-alpha.0"
|
4 |
+
description = "mlbee"
|
5 |
+
authors = ["ffreemt"]
|
6 |
+
license = "MIT"
|
7 |
+
readme = "README.md"
|
8 |
+
repository = "https://github.com/ffreemt/mlbee"
|
9 |
+
|
10 |
+
[tool.poetry.dependencies]
|
11 |
+
python = "^3.8.3"
|
12 |
+
logzero = "^1.7.0"
|
13 |
+
set-loglevel = "^0.1.2"
|
14 |
+
icecream = "^2.1.1"
|
15 |
+
install = "^1.3.5"
|
16 |
+
|
17 |
+
[tool.poe.executor]
|
18 |
+
type = "poetry"
|
19 |
+
|
20 |
+
[tool.poe.tasks]
|
21 |
+
memo = "echo poe test or poetry run poe test"
|
22 |
+
test = "pytest tests"
|
23 |
+
pyright = "pyright mlbee"
|
24 |
+
flake8 = "flake8 mlbee --ignore F401,E501,F841"
|
25 |
+
check = ["pyright", "flake8"]
|
26 |
+
export = "poetry export --without-hashes -f requirements.txt -o requirements.txt"
|
27 |
+
build = "poetry build"
|
28 |
+
publish = "poetry publish"
|
29 |
+
release = ["test", "build", "publish"]
|
30 |
+
lint = { cmd = "pylint mlbee" }
|
31 |
+
isort = "isort tests mlbee"
|
32 |
+
black = "black tests mlbee"
|
33 |
+
formt = ["isort", "black"]
|
34 |
+
docstyle = "pydocstyle --convention=google tests mlbee"
|
35 |
+
prerelease = {cmd = "poetry version prerelease && sync-version"}
|
36 |
+
tunnel = {cmd = "ssh -CN ip_or_hostname_defined_in_hosts -L 9091:127.0.0.1:9091"}
|
37 |
+
|
38 |
+
[tool.poetry.dev-dependencies]
|
39 |
+
pytest = "^7.1"
|
40 |
+
flake8 = "^3.9.2"
|
41 |
+
pydocstyle = "^6.1.1"
|
42 |
+
toml = "^0.10.2"
|
43 |
+
# tbump = "^6.3.2"
|
44 |
+
poethepoet = "^0.10.0"
|
45 |
+
|
46 |
+
[tool.poetry.scripts]
|
47 |
+
"mlbee" = "mlbee.__main__:app"
|
48 |
+
|
49 |
+
[build-system]
|
50 |
+
requires = ["poetry-core>=1.0.0"]
|
51 |
+
build-backend = "poetry.core.masonry.api"
|
52 |
+
|
53 |
+
[tool.pytest.ini_options]
|
54 |
+
minversion = "6.0"
|
55 |
+
addopts = "-ra -q --doctest-modules"
|
56 |
+
log_cli = true
|
57 |
+
testpaths = [
|
58 |
+
"tests",
|
59 |
+
# "integration",
|
60 |
+
]
|
61 |
+
|
62 |
+
[tool.black]
|
63 |
+
skip-string-normalization = 0
|
64 |
+
|
65 |
+
[tool.isort]
|
66 |
+
profile = "black"
|
67 |
+
multi_line_output = 3
|
pyrightconfig.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"include": ["tests", "mlbee"],
|
3 |
+
"venvPath": ".venv",
|
4 |
+
"reportTypeshedErrors": false,
|
5 |
+
"reportMissingImports": true,
|
6 |
+
"reportMissingTypeStubs": false,
|
7 |
+
"pythonVersion": "3.8",
|
8 |
+
"ignore": []
|
9 |
+
}
|
tests/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
"""Init."""
|
tests/test_mlbee.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Test mlbee."""
|
2 |
+
# pylint: disable=broad-except
|
3 |
+
from mlbee import __version__
|
4 |
+
from mlbee import mlbee
|
5 |
+
|
6 |
+
|
7 |
+
def test_version():
|
8 |
+
"""Test version."""
|
9 |
+
assert __version__[:3] == "0.1"
|
10 |
+
|
11 |
+
|
12 |
+
def test_sanity():
|
13 |
+
"""Check sanity."""
|
14 |
+
try:
|
15 |
+
assert not mlbee()
|
16 |
+
except Exception:
|
17 |
+
assert True
|