Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.7.0 #333

Merged
merged 21 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .coveragerc

This file was deleted.

3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.DS_Store*
*.egg-info/
dist/
venv/
build/
docs/source/apiref
docs/source/_misc
Expand All @@ -22,9 +21,9 @@ GlobalUserTableAccessor*
memory_debugging*
opening_database*
_globals.py
venv*
.vscode
.coverage
.coverage.*
.pytest_cache
htmlcov
tutorials/context_storages/dbs
Expand Down
1 change: 1 addition & 0 deletions .env_file
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TG_BOT_TOKEN=token
MYSQL_USERNAME=root
MYSQL_PASSWORD=pass
MYSQL_ROOT_PASSWORD=pass
Expand Down
1 change: 1 addition & 0 deletions .github/process_github_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def post_comment_on_pr(comment: str, pr_number: int):
Here's a release checklist:

- [ ] Update package version
- [ ] Update `poetry.lock`
- [ ] Change PR merge option
- [ ] Test modules without automated testing:
- [ ] Requiring telegram `api_id` and `api_hash`
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/build_and_publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,18 @@ jobs:
- uses: actions/checkout@v4

- name: set up python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: Build images
run: |
make docker_up

- uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '3.1.6'

- name: install dependencies
- name: setup poetry and install dependencies
run: |
make venv
python -m pip install --upgrade pip poetry
python -m poetry install --with tutorials,docs --all-extras --no-ansi --no-interaction

- name: build documentation
env:
Expand All @@ -46,7 +43,7 @@ jobs:
TG_API_HASH: ${{ secrets.TG_API_HASH }}
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
run: |
make doc
python -m poetry run poe docs

- name: remove jekyll theming
run: touch docs/build/.nojekyll
Expand All @@ -62,7 +59,7 @@ jobs:

- name: save artifact
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ format('github-pages-for-branch-{0}', env.BRANCH_NAME) }}
path: docs/build/
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/build_and_upload_release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: build_and_upload_release

on:
push:
tags:
- '*'
release:
types:
- published
pull_request:
branches:
- dev
- master

jobs:
build:
Expand All @@ -14,24 +18,26 @@ jobs:
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5

- name: install latest pip, setuptools, twine + wheel
- name: setup poetry
run: |
python -m pip install --upgrade pip setuptools twine wheel
python -m pip install --upgrade pip poetry

- name: build wheels
- name: build wheels and test uploading to pypi
if: startsWith(github.ref, 'refs/tags/v') != true
run: |
python setup.py bdist_wheel
python setup.py sdist
python -m poetry --build publish --dry-run

- name: upload to pypi via twine
- name: build wheels and upload to pypi
if: startsWith(github.ref, 'refs/tags/v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload --verbose -u '__token__' dist/*
python -m poetry --build publish

- name: upload binaries into release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
- uses: actions/checkout@v4

- name: set up python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9

- name: install dependencies
- name: setup poetry and install dependencies
run: |
make venv
python -m pip install --upgrade pip poetry
python -m poetry install --with lint --no-ansi --no-interaction

- name: run codestyle
run: |
make lint
python -m poetry run poe lint
2 changes: 1 addition & 1 deletion .github/workflows/event_handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: set up python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build images
run: |
make docker_up

- name: set up python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: build & install package
run: |
python -m pip install build
python -m build
find . -name "*.whl" -exec python -m pip install {}[test_full] ';'

- name: clean environment
- name: setup poetry and install dependencies
run: |
export backup_files=( tests tutorials utils .env_file makefile .coveragerc pytest.ini docs )
mkdir /tmp/backup
for i in "${backup_files[@]}" ; do mv "$i" /tmp/backup ; done
rm -rf ..?* .[!.]* *
for i in "${backup_files[@]}" ; do mv "/tmp/backup/$i" . ; done
rm -rf /tmp/backup
touch venv # disable venv target
python -m pip install --upgrade pip poetry
python -m poetry install --with test,tutorials --all-extras --no-ansi --no-interaction

- name: run tests
env:
Expand All @@ -57,4 +42,4 @@ jobs:
TG_API_HASH: ${{ secrets.TG_API_HASH }}
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
run: |
make test TEST_ALLOW_SKIP=telegram
python -m poetry run poe test_all
36 changes: 9 additions & 27 deletions .github/workflows/test_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build images
if: matrix.os == 'ubuntu-latest'
run: |
make docker_up

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[test_full]
shell: bash
python -m pip install --upgrade pip poetry
python -m poetry install --with test,tutorials --all-extras --no-ansi --no-interaction

- name: run pytest
env:
Expand All @@ -50,32 +44,22 @@ jobs:
TG_API_HASH: ${{ secrets.TG_API_HASH }}
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
source <(cat .env_file | sed 's/=/=/' | sed 's/^/export /')
pytest --tb=long -vv --cache-clear --no-cov --allow-skip=telegram tests/
else
pytest -m "not docker" --tb=long -vv --cache-clear --no-cov --allow-skip=telegram,docker tests/
fi
shell: bash
python -m poetry run poe test_no_cov

test_no_deps:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4

- name: Build images
run: |
make docker_up

- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[tests]
shell: bash
python -m pip install --upgrade pip poetry
python -m poetry install --with test --no-ansi --no-interaction

- name: run pytest
env:
Expand All @@ -84,6 +68,4 @@ jobs:
TG_API_HASH: ${{ secrets.TG_API_HASH }}
TG_BOT_USERNAME: ${{ secrets.TG_BOT_USERNAME }}
run: |
source <(cat .env_file | sed 's/=/=/' | sed 's/^/export /')
pytest --tb=long -vv --cache-clear --no-cov --allow-skip=all tests/
shell: bash
python -m poetry run poe test_no_deps
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.DS_Store*
*.egg-info/
dist/
venv/
build/
docs/source/apiref
docs/source/_misc
Expand All @@ -22,9 +21,9 @@ GlobalUserTableAccessor*
memory_debugging*
opening_database*
_globals.py
venv*
.vscode
.coverage
.coverage.*
.pytest_cache
htmlcov
tutorials/context_storages/dbs
Expand Down
Loading
Loading