Skip to content

Commit

Permalink
build: v0.8 release (#160)
Browse files Browse the repository at this point in the history
* feat(core): introduce Adapters API (#151)

* feat(docs): add mkdocs (#153)

* feat(adapter): add OpenAI adapter (#155)

* chore(unit): improve code coverage (#157)

* feat: update documentation (#158)

* feat(demo): add examples (#159)
  • Loading branch information
ajndkr authored Nov 29, 2023
1 parent daacb1b commit 5ff1064
Show file tree
Hide file tree
Showing 145 changed files with 7,055 additions and 4,655 deletions.
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[run]
omit = lanarky/testing/*
omit =
lanarky/clients.py
lanarky/adapters/*/__init__.py
1 change: 0 additions & 1 deletion .env.sample

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
poetry install
poetry install --all-extras
- name: Run unit tests
run: make tests
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docs

on:
push:
branches:
- main

permissions:
contents: write

env:
PYTHON_VERSION: 3.9

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Update Environment Variables
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- name: Setup Cache
uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Deploy GitHub Pages
run: |
pip install 'mkdocs-material[imaging]' mdx-include termynal 'mkdocstrings[python]'
mkdocs gh-deploy --force
26 changes: 0 additions & 26 deletions .readthedocs.yaml

This file was deleted.

66 changes: 0 additions & 66 deletions .vscode/launch.json

This file was deleted.

32 changes: 27 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,40 @@ conda activate lanarky

You can choose any other environment manager of your choice.

### Install dependencies:
### Install Poetry:

```bash
pip install poetry
poetry install
```

## CI/CD
### Install Lanarky:

`lanarky` uses `pre-commit` to run code checks and tests before every commit. To install the pre-commit hooks,
run the following commands:
```bash
poetry install --all-extras
```

## Pre-Commit

`lanarky` uses `pre-commit` to run code checks and tests before every commit.

To install the pre-commit hooks, run the following commands:

```bash
poetry run pre-commit install
```

To run the pre-commit hooks on all files, run the following command:

```bash
make pre-commit
```

## Bump Version

Lanarky uses Makefile to bump versions:

```bash
make bump
```

Note: The make recipe bumps version and auto-commits the changes.
27 changes: 17 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
.PHONY: help tests pre-commit
help: ## shows this help message
.PHONY: help tests coverage pre-commit
help: ## shows this help message
@echo "Usage:\n\tmake <target>"
@echo "\nAvailable targets:"
@awk 'BEGIN {FS = ":.*##"; } /^[$$()% a-zA-Z_-]+:.*?##/ \
{ printf "\t\033[36m%-30s\033[0m %s\n", $$1, $$2 } /^##@/ \
{ printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

tests: ## run unit tests with coverage
tests: ## run unit tests with coverage
poetry run pytest \
--cov=lanarky --cov-report=term-missing:skip-covered \
-p pytest_asyncio -v
find . -type d -name '__pycache__' -exec rm -r {} +

coverage: ## run unit tests with coverage
coverage: ## run unit tests with coverage
poetry run coveralls

pre-commit: ## run pre-commit hooks
pre-commit: ## run pre-commit hooks
poetry run pre-commit run --all-files

build-docs: clean-docs ## build documentation
poetry run sphinx-autobuild -b html --host 0.0.0.0 --port 8000 docs docs/_build/html

clean-docs: ## clean documentation
rm -rf docs/_build
bump: ## bump version
@read -p "Enter version bump (patch|minor|major): " arg; \
if [ "$$arg" != "patch" ] && [ "$$arg" != "minor" ] && [ "$$arg" != "major" ]; then \
echo "Usage: make bump (patch|minor|major)"; \
exit 1; \
fi; \
current_version=$$(poetry version -s); \
poetry version $$arg; \
new_version=$$(poetry version -s); \
git add pyproject.toml; \
git commit -m "bump(ver): $$current_version → $$new_version";
Loading

0 comments on commit 5ff1064

Please sign in to comment.