Add Flit and change namer
This commit is contained in:
parent
50db7b8cb2
commit
f188724d4b
13 changed files with 138 additions and 119 deletions
2
.github/workflows/docker.yaml
vendored
2
.github/workflows/docker.yaml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: schmelczera/great-ai
|
images: schmelczera/great_ai
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
|
|
|
||||||
17
.github/workflows/publish.yaml
vendored
17
.github/workflows/publish.yaml
vendored
|
|
@ -16,14 +16,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
|
|
||||||
- name: Install pypa/build
|
- name: Install Flit
|
||||||
run: python -m pip install build --user
|
run: pip install --upgrade flit --user
|
||||||
|
|
||||||
- name: Build a binary wheel and a source tarball
|
- name: Build and publish
|
||||||
run: python -m build --sdist --wheel --outdir dist/
|
run: flit publish --setup-py
|
||||||
|
env:
|
||||||
- name: Publish distribution to PyPI
|
FLIT_USERNAME: __token__
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
with:
|
|
||||||
user: __token__
|
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
|
|
|
||||||
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
|
@ -30,11 +30,10 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
pip install --upgrade --requirement dev-requirements.txt
|
pip install --upgrade './[dev]'
|
||||||
pip install --upgrade .
|
|
||||||
|
|
||||||
- name: Check code and formatting
|
- name: Check code and formatting
|
||||||
run: scripts/check-python.sh .
|
run: scripts/check-python.sh . tests
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: python3 -m pytest --doctest-modules --cov=. --cov-report=xml --junit-xml pytest.xml --asyncio-mode=strict || true
|
run: python3 -m pytest --doctest-modules --cov=. --cov-report=xml --junit-xml pytest.xml --asyncio-mode=strict || true
|
||||||
|
|
|
||||||
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
|
|
@ -4,9 +4,9 @@
|
||||||
{
|
{
|
||||||
"label": "Format and lint",
|
"label": "Format and lint",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "source .env/bin/activate && scripts/format-python.sh .",
|
"command": "source .env/bin/activate && scripts/format-python.sh . tests",
|
||||||
"windows": {
|
"windows": {
|
||||||
"command": ".env\\bin\\activate.bat; scripts\\format-python.sh ."
|
"command": ".env\\bin\\activate.bat; scripts\\format-python.sh . tests"
|
||||||
},
|
},
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ FROM python:3.10.4-slim-bullseye
|
||||||
LABEL org.opencontainers.image.title="GreatAI package wrapper container"
|
LABEL org.opencontainers.image.title="GreatAI package wrapper container"
|
||||||
LABEL org.opencontainers.image.vendor="ScoutinScience B.V."
|
LABEL org.opencontainers.image.vendor="ScoutinScience B.V."
|
||||||
LABEL org.opencontainers.image.authors="andras@schmelczer.dev"
|
LABEL org.opencontainers.image.authors="andras@schmelczer.dev"
|
||||||
LABEL org.opencontainers.image.source="https://github.com/ScoutinScience/great-ai"
|
LABEL org.opencontainers.image.source="https://github.com/ScoutinScience/great_ai"
|
||||||
|
|
||||||
ENV ENVIRONMENT=production
|
ENV ENVIRONMENT=production
|
||||||
EXPOSE 6060
|
EXPOSE 6060
|
||||||
|
|
|
||||||
18
README.md
18
README.md
|
|
@ -2,22 +2,26 @@
|
||||||
|
|
||||||
**work in progress, do not use!**
|
**work in progress, do not use!**
|
||||||
|
|
||||||
[](https://github.com/ScoutinScience/great_ai/actions/workflows/check.yml) [](https://sonar.scoutinscience.com/dashboard?id=great-ai) [](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml) [](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml)
|
[](https://github.com/ScoutinScience/great_ai/actions/workflows/check.yml)
|
||||||
|
[](https://sonar.scoutinscience.com/dashboard?id=great_ai)
|
||||||
|
[](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml)
|
||||||
|
[](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml)
|
||||||
|
[](https://pepy.tech/project/great_ai)
|
||||||
|
|
||||||
|
|
||||||
## Find `great-ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai)
|
## Find `great_ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great_ai)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -p6060:6060 schmelczera/great-ai
|
docker run -p6060:6060 schmelczera/great_ai
|
||||||
```
|
```
|
||||||
|
|
||||||
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
||||||
|
|
||||||
|
|
||||||
## Find `great-ai` on [PyPI](https://pypi.org/project/great-ai/)
|
## Find `great_ai` on [PyPI](https://pypi.org/project/great_ai/)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install great-ai
|
pip install great_ai
|
||||||
```
|
```
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|
@ -29,13 +33,13 @@ def hello_world(name: str) -> str:
|
||||||
```
|
```
|
||||||
> Create a new file called `main.py`
|
> Create a new file called `main.py`
|
||||||
|
|
||||||
Deploy by executing `python3 -m great-ai main.py`
|
Deploy by executing `python3 -m great_ai main.py`
|
||||||
|
|
||||||
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/).
|
||||||
|
|
||||||
### Contribute
|
### Contribute
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install --upgrade --requirement dev-requirements.txt
|
pip install 'great_ai[dev]'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
build
|
|
||||||
mkdocs
|
|
||||||
mkdocstrings[python]
|
|
||||||
mkdocs-material
|
|
||||||
autoflake
|
|
||||||
isort
|
|
||||||
black[jupyter]
|
|
||||||
mypy
|
|
||||||
flake8
|
|
||||||
pytest
|
|
||||||
pytest-cov
|
|
||||||
pytest-subtests
|
|
||||||
pytest-asyncio
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
"""GreatAI"""
|
||||||
|
__version__ = "0.0.12"
|
||||||
|
|
||||||
|
|
||||||
from .context import configure
|
from .context import configure
|
||||||
from .deploy import GreatAI
|
from .deploy import GreatAI
|
||||||
from .exceptions import (
|
from .exceptions import (
|
||||||
|
|
|
||||||
14
mkdocs.yml
Normal file
14
mkdocs.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
site_name: GreatAI documentation
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: "material"
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- mkdocstrings
|
||||||
|
|
||||||
|
nav:
|
||||||
|
- Home: index.md
|
||||||
|
- tutorials.md
|
||||||
|
- How-To Guides: how-to-guides.md
|
||||||
|
- reference.md
|
||||||
|
- explanation.md
|
||||||
|
|
@ -1,7 +1,65 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = [
|
requires = ["flit_core >=3.2,<4"]
|
||||||
"setuptools>=42",
|
build-backend = "flit_core.buildapi"
|
||||||
"setuptools-git",
|
|
||||||
"wheel"
|
[project]
|
||||||
|
name = "great_ai"
|
||||||
|
dynamic = ["version", "description"]
|
||||||
|
readme = "README.md"
|
||||||
|
authors = [{ name = "András Schmelczer", email = "andras@schmelczer.dev" }]
|
||||||
|
license = { file = "LICENSE" }
|
||||||
|
classifiers = [
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"
|
||||||
]
|
]
|
||||||
build-backend = "setuptools.build_meta"
|
keywords = ["SE4ML", "MLOps", "AI engineering", "general", "robust", "end-to-end", "automated", "trustworthy", "ai", "deployment"]
|
||||||
|
requires-python = ">= 3.8"
|
||||||
|
dependencies = [
|
||||||
|
"scikit-learn",
|
||||||
|
"matplotlib",
|
||||||
|
"numpy",
|
||||||
|
"nbconvert",
|
||||||
|
"ipython",
|
||||||
|
"unidecode >= 1.3.0",
|
||||||
|
"syntok >= 1.4.0",
|
||||||
|
"langcodes[data] >= 3.3.0",
|
||||||
|
"langdetect >= 1.0.9",
|
||||||
|
"tinydb >= 4.7.0",
|
||||||
|
"boto3 >= 1.23.0",
|
||||||
|
"plotly >= 5.8.0",
|
||||||
|
"pandas",
|
||||||
|
"dash >= 2.4.0",
|
||||||
|
"fastapi >= 0.70.0",
|
||||||
|
"uvicorn[standard] >= 0.18.0",
|
||||||
|
"watchdog >= 2.1.0",
|
||||||
|
"typeguard >= 2.10.0",
|
||||||
|
"pymongo >= 3.0.0",
|
||||||
|
"dill >= 0.3.5.0",
|
||||||
|
"aiohttp[speedups] >= 3.8.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"flit",
|
||||||
|
"mkdocs",
|
||||||
|
"mkdocstrings[python]",
|
||||||
|
"mkdocs-material",
|
||||||
|
"autoflake",
|
||||||
|
"isort",
|
||||||
|
"black[jupyter]",
|
||||||
|
"mypy",
|
||||||
|
"flake8",
|
||||||
|
"pytest",
|
||||||
|
"pytest-cov",
|
||||||
|
"pytest-subtests",
|
||||||
|
"pytest-asyncio"
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Homepage = "https://github.com/ScoutinScience/great_ai"
|
||||||
|
DockerHub = "https://hub.docker.com/repository/docker/schmelczera/great_ai"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
great_ai = "great_ai:main"
|
||||||
|
large_file = "great_ai.large_file:main"
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,24 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "Checking $1"
|
echo "Installing dependencies if necessary"
|
||||||
|
python3 -m pip install --upgrade autoflake isort black[jupyter] mypy flake8
|
||||||
|
|
||||||
cd $1
|
for dir in "$@"; do
|
||||||
|
echo "Checking $dir"
|
||||||
|
|
||||||
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r . --check
|
cd "$dir"
|
||||||
python3 -m isort --profile black --skip .env . --check
|
|
||||||
python3 -m black . --exclude .env --check
|
|
||||||
|
|
||||||
if ls *.py 1> /dev/null 2>&1; then
|
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r . --check
|
||||||
yes | python3 -m mypy . --install-types > /dev/null || true
|
python3 -m isort --profile black --skip .env . --check
|
||||||
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty .
|
python3 -m black . --exclude .env --check
|
||||||
fi
|
|
||||||
|
|
||||||
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E722,E402,W503,E203
|
if find . -name "*.py" 2>/dev/null | grep -q .; then
|
||||||
|
yes | python3 -m mypy . --install-types > /dev/null || true
|
||||||
|
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty .
|
||||||
|
fi
|
||||||
|
|
||||||
cd -
|
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E402,F821,W503,E722,E203
|
||||||
|
|
||||||
echo "Finished checking"
|
cd -
|
||||||
|
done
|
||||||
|
|
|
||||||
|
|
@ -2,27 +2,29 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
echo "Formatting and checking $1"
|
for dir in "$@"; do
|
||||||
|
echo "Formatting and checking $dir"
|
||||||
|
|
||||||
cd $1
|
cd "$dir"
|
||||||
|
|
||||||
echo Running autoflake
|
echo Running autoflake
|
||||||
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r .
|
python3 -m autoflake --expand-star-imports --remove-all-unused-imports --ignore-init-module-imports --remove-unused-variables --in-place -r .
|
||||||
|
|
||||||
echo Running isort
|
echo Running isort
|
||||||
python3 -m isort --profile black --skip .env .
|
python3 -m isort --profile black --skip .env .
|
||||||
|
|
||||||
echo Running black
|
echo Running black
|
||||||
python3 -m black . --exclude .env
|
python3 -m black . --exclude .env
|
||||||
|
|
||||||
if ls *.py 1> /dev/null 2>&1; then
|
if find . -name "*.py" 2>/dev/null | grep -q .; then
|
||||||
echo Running mypy
|
echo Running mypy
|
||||||
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --pretty --follow-imports=silent --exclude=external/ --exclude=/build/ .
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo Running Flake8
|
if [ ! -d .mypy_cache ]; then
|
||||||
python3 -m flake8 . --count --show-source --statistics --exclude=__init__.py,.env,external --ignore=E501,E722,E402,W503,E203
|
python3 -m mypy --namespace-packages --ignore-missing-imports --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty . || true
|
||||||
|
fi
|
||||||
|
|
||||||
cd -
|
python3 -m mypy --namespace-packages --ignore-missing-imports --install-types --non-interactive --disallow-untyped-defs --disallow-incomplete-defs --follow-imports=silent --exclude=external/ --exclude=/build/ --pretty . || true
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Finished formatting"
|
cd -
|
||||||
|
done
|
||||||
|
|
|
||||||
49
setup.cfg
49
setup.cfg
|
|
@ -1,49 +0,0 @@
|
||||||
[metadata]
|
|
||||||
name = great-ai
|
|
||||||
version = 0.0.11
|
|
||||||
author = András Schmelczer
|
|
||||||
author_email = andras@scoutinscience.com
|
|
||||||
description =
|
|
||||||
long_description = file: README.md
|
|
||||||
long_description_content_type = text/markdown
|
|
||||||
url = https://github.com/ScoutinScience/great-ai
|
|
||||||
project_urls =
|
|
||||||
Bug Tracker = https://github.com/ScoutinScience/great-ai/issues
|
|
||||||
classifiers =
|
|
||||||
Programming Language :: Python :: 3
|
|
||||||
Operating System :: OS Independent
|
|
||||||
|
|
||||||
[options]
|
|
||||||
package_dir =
|
|
||||||
great_ai = great_ai
|
|
||||||
|
|
||||||
include_package_data = True
|
|
||||||
python_requires = >= 3.8
|
|
||||||
install_requires =
|
|
||||||
scikit-learn
|
|
||||||
matplotlib
|
|
||||||
numpy
|
|
||||||
nbconvert
|
|
||||||
ipython
|
|
||||||
unidecode >= 1.3.0
|
|
||||||
syntok >= 1.4.0
|
|
||||||
langcodes[data] >= 3.3.0
|
|
||||||
langdetect >= 1.0.9
|
|
||||||
tinydb >= 4.7.0
|
|
||||||
boto3 >= 1.23.0
|
|
||||||
plotly >= 5.8.0
|
|
||||||
pandas
|
|
||||||
dash >= 2.4.0
|
|
||||||
fastapi >= 0.70.0
|
|
||||||
uvicorn[standard] >= 0.18.0
|
|
||||||
watchdog >= 2.1.0
|
|
||||||
typeguard >= 2.10.0
|
|
||||||
pymongo >= 3.0.0
|
|
||||||
dill >= 0.3.5.0
|
|
||||||
aiohttp[speedups] >= 3.8.0
|
|
||||||
|
|
||||||
[options.package_data]
|
|
||||||
* = *.conf, *.css, *.png
|
|
||||||
|
|
||||||
[options.packages.find]
|
|
||||||
where = .
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue