Skip to content

Commit

Permalink
Update to v.0.1.0b2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbot-ai committed May 4, 2023
0 parents commit a4c87d5
Show file tree
Hide file tree
Showing 163 changed files with 34,147 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Documentation to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [$default-branch]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
WEB_SITE_URL: ${{ vars.WEB_SITE_URL }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Build Docusaurus website
run: |
cd website
npm install
npm run build
- name: Setup Pages
uses: actions/configure-pages@v1
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: website/build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax: glob
.idea
.vscode/
.DS_Store
.project
.settings
.classpath
.pydevproject
.coverage
.pytest_cache
.env*
htmlcov
*.pyc
*.pyo
.*.sw*
.*.sv*
*.iml
target
.svn
*.o
*.lo
*.la
*.al
.libs
*.so
*.so.[0-9]*
*.a
*.rej
*~
#*#
.#*
report*.html
cookie.txt
dist
dialogs/stories/
assets/
__pycache__/
ipynb/.ipynb_checkpoints/

syntax: regexp
/target$
/.idea$
site/
*.egg-info
74 changes: 74 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
-
id: end-of-file-fixer
exclude: 'website/'
- id: check-toml
# - id: check-yaml
- id: check-json
- id: check-added-large-files
# - id: name-tests-test
- id: debug-statements

- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
# args:
# - --diff
# - --check

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
args:
# - --diff
# - --check
- --profile=black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [
'flake8-eradicate==1.4.0',
'flake8-bugbear==22.9.23',
'flake8-docstrings==1.6.0',
'flake8-print==5.0.0',
'pep8-naming==0.13.2',
]
args:
- "--config=setup.cfg"
- repo: https://github.com/PyCQA/pylint
rev: v2.17.2
hooks:
- id: pylint
language: system
files: ^(maxbot)/.*\.py$
args:
- --rcfile=setup.cfg
# run pylint across multiple cpu cores to speed it up-
# https://pylint.pycqa.org/en/latest/user_guide/run.html?#parallel-execution to know more
- --jobs=0

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
additional_dependencies: ['.[toml]']
args: [-c, pyproject.toml]

- repo: local
hooks:
- id: unittests
name: unittests
stages: ["push"]
entry: make test
language: system
always_run: True
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2023 Maxbot Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
72 changes: 72 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
-include .env

POETRY_VERSION_MAIN=$(shell poetry version -s 2>/dev/null)
POETRY_VERSION_DATE=$(shell date "+%Y%m%d%H%M%S")

ifeq ($(MIDVIX_ENV), dev)
PYPI_REPO=testpypi
POETRY_VERSION_NAME=a.dev
endif

ifeq ($(MIDVIX_ENV), test)
PYPI_REPO=testpypi
POETRY_VERSION_NAME=b.dev
endif

ifeq ($(MIDVIX_ENV), prod)
PYPI_REPO=pypi
POETRY_VERSION_NAME=b2
POETRY_VERSION_DATE=
endif

$(eval POETRY_VERSION_CUR=$(shell poetry version -s))
$(eval POETRY_VERSION_NEW=$(POETRY_VERSION_MAIN)$(POETRY_VERSION_NAME)$(POETRY_VERSION_DATE))

.PHONY: test

test:
pytest --cov=maxbot --cov-report html --cov-fail-under=95

stories:
python examples/stories.py examples/hello-world
python examples/stories.py examples/echo
python examples/stories.py examples/restaurant
python examples/stories.py examples/reservation-basic
python examples/stories.py examples/reservation
python examples/stories.py examples/digression-showcase
python examples/stories.py examples/rpc-showcase

clean:
rm -f dist/maxbot-*.*.*-py3-none-any.whl
rm -f dist/maxbot-*.*.*.tar.gz

version_bumb:
poetry version $(POETRY_VERSION_NEW)

version_revert:
poetry version $(POETRY_VERSION_CUR)

wheel:
poetry build --format wheel

tag:
git tag "v.$(POETRY_VERSION_NEW)"
git push origin "v.$(POETRY_VERSION_NEW)"

publish:
poetry publish -r $(PYPI_REPO)

build_wheel: clean version_bumb wheel tag

build_docs:
rm -rf website/build
cd website;npm install;npm run build;cd ..;

publish_docs:
rsync --delete -rltH --exclude='.git*' ./website/build/* $(WEB_SITE_SRV):$(WEB_SITE_PATH_PREFIX)-$(MIDVIX_ENV)/$(WEB_SITE_PROJECT)

dep_docs: build_docs publish_docs

dep_internal: build_wheel dep_docs version_revert

dep: build_wheel publish dep_docs version_revert
Loading

0 comments on commit a4c87d5

Please sign in to comment.