Skip to content

Commit

Permalink
Modernize layout (#124)
Browse files Browse the repository at this point in the history
* Upgrading layout: creating pyproject.toml, moving vk to src dir, skipping non-working tests, configuring tox and other

* Fixing coverage missing

* Adding pre-commit hook

* Fix sphinx build

* Remove make files from docs

* Adding docs env to tox for docs building

* Update README.md

* Setup autorelease on PyPI

* Adding URLs to pyproject.toml
  • Loading branch information
YariKartoshe4ka committed Jun 2, 2022
1 parent 37f41c7 commit 10c7bc6
Show file tree
Hide file tree
Showing 29 changed files with 275 additions and 928 deletions.
14 changes: 0 additions & 14 deletions .editorconfig

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Check

on:
pull_request:
push:

schedule:
- cron: "0 12 * * *"

jobs:
test:
name: Run tests - Python ${{ matrix.py }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
py:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "pypy-3.7"
- "pypy-3.8"
steps:
- name: Setup Python for tox
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install tox
run: pip install tox
- name: Setup Python ${{ matrix.py }} for test
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
- name: Checkout code
uses: actions/checkout@v2
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: tox --skip-pkg-install
- name: Upload coverage
uses: codecov/codecov-action@v2

check:
name: Check - Tox ${{ matrix.tox_env }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox_env:
- fix
- docs
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python for tox
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install tox
run: pip install tox
- name: Setup test suite
run: tox -vv --notest -e ${{ matrix.tox_env }}
- name: Run test suite
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}

publish:
name: Publish on PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [ test, check ]
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: pip install build
- name: Checkout code
uses: actions/checkout@v2
- name: Build project
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
23 changes: 5 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,18 @@ __pycache__/
*.py[cod]

# Distribution / packaging
/dist/
/vk.egg-info/
build/
dist/
*.egg-info/

# pipenv
/.env
/Pipfile.lock
/venv/

# Unit test / coverage reports
/.coverage
/coverage.xml
/.pytest_cache/
/.tox/

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Rope
.ropeproject

# Sphinx documentation
/docs/_build/

# IDEs
/.idea/

# Vagrant
/.vagrant/
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-builtin-literals
- id: check-docstring-first
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-unused-arguments
- flake8-noqa
- pep8-naming
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

33 changes: 0 additions & 33 deletions Pipfile

This file was deleted.

42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
Python vk.com API wrapper
=========================
# vk | python vk.com API wrapper

[![PyPI](https://img.shields.io/pypi/pyversions/vk.svg)](https://pypi.org/project/vk/ "Latest version on PyPI")
[![Travis](https://travis-ci.com/voronind/vk.svg?branch=master)](https://travis-ci.com/voronind/vk "Travis CI")
[![Docs](https://readthedocs.org/projects/vk/badge/?version=stable)](https://vk.readthedocs.io/en/latest/ "Read the docs")
[![codecov](https://codecov.io/gh/voronind/vk/branch/master/graph/badge.svg)](https://codecov.io/gh/voronind/vk "Coverage")
[![Maintanance](https://img.shields.io/maintenance/yes/2022?style=flat-square)](https://github.com/voronind/vk/commits/master)
[![PyPI](https://img.shields.io/pypi/pyversions/vk?style=flat-square)](https://pypi.org/project/vk/)
[![GitHub CI](https://img.shields.io/github/workflow/status/voronind/vk/Check/master?style=flat-square)](https://github.com/voronind/vk/actions)
[![Codecov](https://img.shields.io/codecov/c/github/voronind/vk?style=flat-square)](https://codecov.io/gh/voronind/vk)
[![Docs](https://img.shields.io/readthedocs/vk?style=flat-square)](https://vk.readthedocs.io/en/latest/)

This is a vk.com (the largest Russian social network)
python API wrapper. The goal is to support all API methods (current and future)
that can be accessed from server.
This is a vk.com (the largest Russian social network) python API wrapper. <br>
The goal is to support all API methods (current and future) that can be accessed from server.

Quickstart
==========

Install
-------
## Quickstart

```console

### Install

```bash
pip install vk
```

Usage
-----

### Usage

```python
>>> import vk
>>> session = vk.Session()
>>> api = vk.API(session)
>>> api = vk.API(access_token='...')
>>> api.users.get(user_ids=1)
[{'first_name': 'Pavel', 'last_name': 'Durov', 'id': 1}]
```

See https://vk.com/dev/methods for detailed API guide.
See official VK [documentation](https://dev.vk.com/method) for detailed API guide.


More info
=========
## More info

Read full documentation https://vk.readthedocs.org
Read full documentation on [Read the Docs](https://vk.readthedocs.org)
51 changes: 0 additions & 51 deletions Vagrantfile

This file was deleted.

Loading

0 comments on commit 10c7bc6

Please sign in to comment.