From 169581f69121ef66a326fd100656756aee1baed9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 9 Sep 2022 08:37:05 -0500 Subject: [PATCH] chore: initial commit --- .all-contributorsrc | 15 + .editorconfig | 21 + .flake8 | 3 + .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/1-bug_report.md | 14 + .github/ISSUE_TEMPLATE/2-feature-request.md | 14 + .github/labels.toml | 94 ++++ .github/workflows/ci.yml | 88 ++++ .github/workflows/hacktoberfest.yml | 17 + .github/workflows/issue-manager.yml | 32 ++ .github/workflows/labels.yml | 22 + .gitignore | 140 +++++ .gitpod.yml | 8 + .idea/dbus-fast.iml | 9 + .idea/watcherTasks.xml | 65 +++ .idea/workspace.xml | 32 ++ .pre-commit-config.yaml | 66 +++ .readthedocs.yml | 23 + CHANGELOG.md | 3 + CONTRIBUTING.md | 117 ++++ LICENSE | 22 + README.md | 59 +++ commitlint.config.js | 8 + docs/Makefile | 20 + docs/make.bat | 35 ++ docs/source/_static/.gitkeep | 0 docs/source/changelog.md | 3 + docs/source/conf.py | 56 ++ docs/source/contributing.md | 3 + docs/source/index.md | 21 + docs/source/installation.md | 7 + docs/source/usage.md | 9 + poetry.lock | 557 ++++++++++++++++++++ pyproject.toml | 94 ++++ renovate.json | 3 + setup.py | 9 + src/dbus_fast/__init__.py | 1 + src/dbus_fast/main.py | 2 + src/dbus_fast/py.typed | 0 tests/__init__.py | 0 tests/test_main.py | 5 + 41 files changed, 1698 insertions(+) create mode 100644 .all-contributorsrc create mode 100644 .editorconfig create mode 100644 .flake8 create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/1-bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/2-feature-request.md create mode 100644 .github/labels.toml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/hacktoberfest.yml create mode 100644 .github/workflows/issue-manager.yml create mode 100644 .github/workflows/labels.yml create mode 100644 .gitignore create mode 100644 .gitpod.yml create mode 100644 .idea/dbus-fast.iml create mode 100644 .idea/watcherTasks.xml create mode 100644 .idea/workspace.xml create mode 100644 .pre-commit-config.yaml create mode 100644 .readthedocs.yml create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 commitlint.config.js create mode 100644 docs/Makefile create mode 100644 docs/make.bat create mode 100644 docs/source/_static/.gitkeep create mode 100644 docs/source/changelog.md create mode 100644 docs/source/conf.py create mode 100644 docs/source/contributing.md create mode 100644 docs/source/index.md create mode 100644 docs/source/installation.md create mode 100644 docs/source/usage.md create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 renovate.json create mode 100644 setup.py create mode 100644 src/dbus_fast/__init__.py create mode 100644 src/dbus_fast/main.py create mode 100644 src/dbus_fast/py.typed create mode 100644 tests/__init__.py create mode 100644 tests/test_main.py diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..625c3ff --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,15 @@ +{ + "projectName": "dbus-fast", + "projectOwner": "bluetooth-devices", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 80, + "commit": true, + "commitConvention": "angular", + "contributors": [], + "contributorsPerLine": 7, + "skipCi": true +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d4a2c44 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..997e99b --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +exclude = docs +max-line-length = 88 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..b889b2f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: ["bluetooth-devices"] diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md new file mode 100644 index 0000000..4644945 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -0,0 +1,14 @@ +--- +name: Bug report +about: Create a report to help us improve +labels: bug +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.md b/.github/ISSUE_TEMPLATE/2-feature-request.md new file mode 100644 index 0000000..a4c01cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature-request.md @@ -0,0 +1,14 @@ +--- +name: Feature request +about: Suggest an idea for this project +labels: enhancement +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/labels.toml b/.github/labels.toml new file mode 100644 index 0000000..56865be --- /dev/null +++ b/.github/labels.toml @@ -0,0 +1,94 @@ +[breaking] +color = "ffcc00" +name = "breaking" +description = "Breaking change." + +[bug] +color = "d73a4a" +name = "bug" +description = "Something isn't working" + +[dependencies] +color = "0366d6" +name = "dependencies" +description = "Pull requests that update a dependency file" + +[github_actions] +color = "000000" +name = "github_actions" +description = "Update of github actions" + +[documentation] +color = "1bc4a5" +name = "documentation" +description = "Improvements or additions to documentation" + +[duplicate] +color = "cfd3d7" +name = "duplicate" +description = "This issue or pull request already exists" + +[enhancement] +color = "a2eeef" +name = "enhancement" +description = "New feature or request" + +["good first issue"] +color = "7057ff" +name = "good first issue" +description = "Good for newcomers" + +["help wanted"] +color = "008672" +name = "help wanted" +description = "Extra attention is needed" + +[invalid] +color = "e4e669" +name = "invalid" +description = "This doesn't seem right" + +[nochangelog] +color = "555555" +name = "nochangelog" +description = "Exclude pull requests from changelog" + +[question] +color = "d876e3" +name = "question" +description = "Further information is requested" + +[removed] +color = "e99695" +name = "removed" +description = "Removed piece of functionalities." + +[tests] +color = "bfd4f2" +name = "tests" +description = "CI, CD and testing related changes" + +[wontfix] +color = "ffffff" +name = "wontfix" +description = "This will not be worked on" + +[discussion] +color = "c2e0c6" +name = "discussion" +description = "Some discussion around the project" + +[hacktoberfest] +color = "ffa663" +name = "hacktoberfest" +description = "Good issues for Hacktoberfest" + +[answered] +color = "0ee2b6" +name = "answered" +description = "Automatically closes as answered after a delay" + +[waiting] +color = "5f7972" +name = "waiting" +description = "Automatically closes if no answer after a delay" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..dfc4ea0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,88 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: "3.9" + - uses: pre-commit/action@v2.0.3 + + # Make sure commit messages follow the conventional commits convention: + # https://www.conventionalcommits.org + commitlint: + name: Lint Commit Messages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v4.1.11 + + test: + strategy: + fail-fast: false + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + os: + - ubuntu-latest + - windows-latest + - macOS-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - uses: snok/install-poetry@v1 + - name: Install Dependencies + run: poetry install + - name: Test with Pytest + run: poetry run pytest --cov-report=xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + release: + runs-on: ubuntu-latest + environment: release + if: github.ref == 'refs/heads/main' + needs: + - test + - lint + - commitlint + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Run semantic release: + # - Update CHANGELOG.md + # - Update version in code + # - Create git tag + # - Create GitHub release + # - Publish to PyPI + - name: Python Semantic Release + uses: relekang/python-semantic-release@v7.27.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/hacktoberfest.yml b/.github/workflows/hacktoberfest.yml new file mode 100644 index 0000000..dbb4759 --- /dev/null +++ b/.github/workflows/hacktoberfest.yml @@ -0,0 +1,17 @@ +name: Hacktoberfest + +on: + schedule: + # Run every day in October + - cron: "0 0 * 10 *" + # Run on the 1st of November to revert + - cron: "0 13 1 11 *" + +jobs: + hacktoberfest: + runs-on: ubuntu-latest + + steps: + - uses: browniebroke/hacktoberfest-labeler-action@v2.2.0 + with: + github_token: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml new file mode 100644 index 0000000..e41c2fb --- /dev/null +++ b/.github/workflows/issue-manager.yml @@ -0,0 +1,32 @@ +name: Issue Manager + +on: + schedule: + - cron: "0 0 * * *" + issue_comment: + types: + - created + issues: + types: + - labeled + pull_request_target: + types: + - labeled + workflow_dispatch: + +jobs: + issue-manager: + runs-on: ubuntu-latest + steps: + - uses: tiangolo/issue-manager@0.4.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config: > + { + "answered": { + "message": "Assuming the original issue was solved, it will be automatically closed now." + }, + "waiting": { + "message": "Automatically closing. To re-open, please provide the additional information requested." + } + } diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 0000000..638716e --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,22 @@ +name: Sync Github labels + +on: + push: + branches: + - main + paths: + - ".github/**" + +jobs: + labels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: 3.8 + - name: Install labels + run: pip install labels + - name: Sync config with Github + run: labels -u ${{ github.repository_owner }} -t ${{ secrets.GITHUB_TOKEN }} sync -f .github/labels.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1c3b1bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,140 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..450add9 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +tasks: + - command: | + pip install poetry + PIP_USER=false poetry install + - command: | + pip install pre-commit + pre-commit install + PIP_USER=false pre-commit install-hooks diff --git a/.idea/dbus-fast.iml b/.idea/dbus-fast.iml new file mode 100644 index 0000000..a46d9bb --- /dev/null +++ b/.idea/dbus-fast.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 0000000..49d1cb6 --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..4b88d82 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c9923ee --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,66 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: "CHANGELOG.md" +default_stages: [commit] + +ci: + autofix_commit_msg: "chore(pre-commit.ci): auto fixes" + autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate" + +repos: + - repo: https://github.com/commitizen-tools/commitizen + rev: v2.32.4 + hooks: + - id: commitizen + stages: [commit-msg] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: debug-statements + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-toml + - id: check-xml + - id: check-yaml + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + - id: debug-statements + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 + hooks: + - id: prettier + args: ["--tab-width", "2"] + - repo: https://github.com/asottile/pyupgrade + rev: v2.37.3 + hooks: + - id: pyupgrade + args: [--py37-plus] + - repo: https://github.com/PyCQA/isort + rev: 5.10.1 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 22.8.0 + hooks: + - id: black + - repo: https://github.com/codespell-project/codespell + rev: v2.2.1 + hooks: + - id: codespell + - repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.931 + hooks: + - id: mypy + additional_dependencies: [] + - repo: https://github.com/PyCQA/bandit + rev: 1.7.4 + hooks: + - id: bandit + args: [-x, tests] diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..801e792 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,23 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "3.9" + +# Optionally declare the Python requirements required to build your docs +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d29d5af --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d3480ff --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,117 @@ +# Contributing + +Contributions are welcome, and they are greatly appreciated! Every little helps, and credit will always be given. + +You can contribute in many ways: + +## Types of Contributions + +### Report Bugs + +Report bugs to [our issue page][gh-issues]. If you are reporting a bug, please include: + +- Your operating system name and version. +- Any details about your local setup that might be helpful in troubleshooting. +- Detailed steps to reproduce the bug. + +### Fix Bugs + +Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. + +### Implement Features + +Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. + +### Write Documentation + +dbus-fast could always use more documentation, whether as part of the official dbus-fast docs, in docstrings, or even on the web in blog posts, articles, and such. + +### Submit Feedback + +The best way to send feedback [our issue page][gh-issues] on GitHub. If you are proposing a feature: + +- Explain in detail how it would work. +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that contributions are welcome 😊 + +## Get Started! + +Ready to contribute? Here's how to set yourself up for local development. + +1. Fork the repo on GitHub. + +2. Clone your fork locally: + + ```shell + $ git clone git@github.com:your_name_here/dbus-fast.git + ``` + +3. Install the project dependencies with [Poetry](https://python-poetry.org): + + ```shell + $ poetry install + ``` + +4. Create a branch for local development: + + ```shell + $ git checkout -b name-of-your-bugfix-or-feature + ``` + + Now you can make your changes locally. + +5. When you're done making changes, check that your changes pass our tests: + + ```shell + $ poetry run pytest + ``` + +6. Linting is done through [pre-commit](https://pre-commit.com). Provided you have the tool installed globally, you can run them all as one-off: + + ```shell + $ pre-commit run -a + ``` + + Or better, install the hooks once and have them run automatically each time you commit: + + ```shell + $ pre-commit install + ``` + +7. Commit your changes and push your branch to GitHub: + + ```shell + $ git add . + $ git commit -m "feat(something): your detailed description of your changes" + $ git push origin name-of-your-bugfix-or-feature + ``` + + Note: the commit message should follow [the conventional commits](https://www.conventionalcommits.org). We run [`commitlint` on CI](https://github.com/marketplace/actions/commit-linter) to validate it, and if you've installed pre-commit hooks at the previous step, the message will be checked at commit time. + +8. Submit a pull request through the GitHub website or using the GitHub CLI (if you have it installed): + + ```shell + $ gh pr create --fill + ``` + +## Pull Request Guidelines + +We like to have the pull request open as soon as possible, that's a great place to discuss any piece of work, even unfinished. You can use draft pull request if it's still a work in progress. Here are a few guidelines to follow: + +1. Include tests for feature or bug fixes. +2. Update the documentation for significant features. +3. Ensure tests are passing on CI. + +## Tips + +To run a subset of tests: + +```shell +$ pytest tests +``` + +## Making a new release + +The deployment should be automated and can be triggered from the Semantic Release workflow in GitHub. The next version will be based on [the commit logs](https://python-semantic-release.readthedocs.io/en/latest/commit-log-parsing.html#commit-log-parsing). This is done by [python-semantic-release](https://python-semantic-release.readthedocs.io/en/latest/index.html) via a GitHub action. + +[gh-issues]: https://github.com/bluetooth-devices/dbus-fast/issues diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6974ffc --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ + +MIT License + +Copyright (c) 2022 Bluetooth Devices Authors + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..047217f --- /dev/null +++ b/README.md @@ -0,0 +1,59 @@ +# dbus-fast + +

+ + CI Status + + + Documentation Status + + + Test coverage percentage + +

+

+ + Poetry + + + black + + + pre-commit + +

+

+ + PyPI Version + + Supported Python versions + License +

+ +A faster version of dbus-next + +## Installation + +Install this via pip (or your favourite package manager): + +`pip install dbus-fast` + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + +## Credits + +This package was created with +[Cookiecutter](https://github.com/audreyr/cookiecutter) and the +[browniebroke/cookiecutter-pypackage](https://github.com/browniebroke/cookiecutter-pypackage) +project template. diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..8b82768 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,8 @@ +module.exports = { + extends: ["@commitlint/config-conventional"], + rules: { + "header-max-length": [0, "always", Infinity], + "body-max-line-length": [0, "always", Infinity], + "footer-max-line-length": [0, "always", Infinity], + }, +}; diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..bed4efb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000..9534b01 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/source/_static/.gitkeep b/docs/source/_static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/source/changelog.md b/docs/source/changelog.md new file mode 100644 index 0000000..4d6e28c --- /dev/null +++ b/docs/source/changelog.md @@ -0,0 +1,3 @@ +```{include} ../../CHANGELOG.md + +``` diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..9421508 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,56 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = "dbus-fast" +copyright = "2020, Bluetooth Devices Authors" +author = "Bluetooth Devices Authors" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "myst_parser", +] + +# The suffix of source filenames. +source_suffix = [".rst", ".md"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] diff --git a/docs/source/contributing.md b/docs/source/contributing.md new file mode 100644 index 0000000..8ece9d8 --- /dev/null +++ b/docs/source/contributing.md @@ -0,0 +1,3 @@ +```{include} ../../CONTRIBUTING.md + +``` diff --git a/docs/source/index.md b/docs/source/index.md new file mode 100644 index 0000000..96c9e88 --- /dev/null +++ b/docs/source/index.md @@ -0,0 +1,21 @@ +# Welcome to dbus-fast documentation! + +```{toctree} +:caption: Installation & Usage +:maxdepth: 2 + +installation +usage +``` + +```{toctree} +:caption: Project Info +:maxdepth: 2 + +changelog +contributing +``` + +```{include} ../../README.md + +``` diff --git a/docs/source/installation.md b/docs/source/installation.md new file mode 100644 index 0000000..5998342 --- /dev/null +++ b/docs/source/installation.md @@ -0,0 +1,7 @@ +# Installation + +The package is published on [PyPI](https://pypi.org/project/deezer-python/) and can be installed with `pip` (or any equivalent): + +```bash +pip install dbus-fast +``` diff --git a/docs/source/usage.md b/docs/source/usage.md new file mode 100644 index 0000000..6be4e28 --- /dev/null +++ b/docs/source/usage.md @@ -0,0 +1,9 @@ +# Usage + +To use this package, import it: + +```python +import dbus_fast +``` + +TODO: Document usage diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..ffa6ff1 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,557 @@ +[[package]] +name = "alabaster" +version = "0.7.12" +description = "A configurable sidebar-enabled Sphinx theme" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "attrs" +version = "22.1.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +tests_no_zope = ["cloudpickle", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] +tests = ["cloudpickle", "zope.interface", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] +docs = ["sphinx-notfound-page", "zope.interface", "sphinx", "furo"] +dev = ["cloudpickle", "pre-commit", "sphinx-notfound-page", "sphinx", "furo", "zope.interface", "pytest-mypy-plugins", "mypy (>=0.900,!=0.940)", "pytest (>=4.3.0)", "pympler", "hypothesis", "coverage[toml] (>=5.0.2)"] + +[[package]] +name = "babel" +version = "2.10.3" +description = "Internationalization utilities" +category = "main" +optional = true +python-versions = ">=3.6" + +[package.dependencies] +pytz = ">=2015.7" + +[[package]] +name = "certifi" +version = "2022.6.15" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = true +python-versions = ">=3.6" + +[[package]] +name = "charset-normalizer" +version = "2.1.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = true +python-versions = ">=3.6.0" + +[package.extras] +unicode_backport = ["unicodedata2"] + +[[package]] +name = "colorama" +version = "0.4.5" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "coverage" +version = "6.4.4" +description = "Code coverage measurement for Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli"] + +[[package]] +name = "docutils" +version = "0.17.1" +description = "Docutils -- Python Documentation Utilities" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "idna" +version = "3.3" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = true +python-versions = ">=3.5" + +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "importlib-metadata" +version = "4.12.0" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] +perf = ["ipython"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "packaging", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)", "importlib-resources (>=1.3)"] + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "jinja2" +version = "3.1.2" +description = "A very fast and expressive template engine." +category = "main" +optional = true +python-versions = ">=3.7" + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "markdown-it-py" +version = "2.1.0" +description = "Python port of markdown-it. Markdown parsing, done right!" +category = "main" +optional = true +python-versions = ">=3.7" + +[package.dependencies] +mdurl = ">=0.1,<1.0" +typing_extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} + +[package.extras] +testing = ["pytest-regressions", "pytest-cov", "pytest", "coverage"] +rtd = ["sphinx-book-theme", "sphinx-design", "sphinx-copybutton", "sphinx", "pyyaml", "myst-parser", "attrs"] +profiling = ["gprof2dot"] +plugins = ["mdit-py-plugins"] +linkify = ["linkify-it-py (>=1.0,<2.0)"] +compare = ["panflute (>=2.1.3,<2.2.0)", "mistune (>=2.0.2,<2.1.0)", "mistletoe (>=0.8.1,<0.9.0)", "markdown (>=3.3.6,<3.4.0)", "commonmark (>=0.9.1,<0.10.0)"] +code_style = ["pre-commit (==2.6)"] +benchmarking = ["pytest-benchmark (>=3.2,<4.0)", "pytest", "psutil"] + +[[package]] +name = "markupsafe" +version = "2.1.1" +description = "Safely add untrusted strings to HTML/XML markup." +category = "main" +optional = true +python-versions = ">=3.7" + +[[package]] +name = "mdit-py-plugins" +version = "0.3.0" +description = "Collection of plugins for markdown-it-py" +category = "main" +optional = true +python-versions = "~=3.6" + +[package.dependencies] +markdown-it-py = ">=1.0.0,<3.0.0" + +[package.extras] +testing = ["pytest-regressions", "pytest-cov", "pytest (>=3.6,<4)", "coverage"] +rtd = ["sphinx-book-theme (>=0.1.0,<0.2.0)", "myst-parser (>=0.14.0,<0.15.0)"] +code_style = ["pre-commit (==2.6)"] + +[[package]] +name = "mdurl" +version = "0.1.2" +description = "Markdown URL utilities" +category = "main" +optional = true +python-versions = ">=3.7" + +[[package]] +name = "myst-parser" +version = "0.18.0" +description = "An extended commonmark compliant parser, with bridges to docutils & sphinx." +category = "main" +optional = true +python-versions = ">=3.7" + +[package.dependencies] +docutils = ">=0.15,<0.19" +jinja2 = "*" +markdown-it-py = ">=1.0.0,<3.0.0" +mdit-py-plugins = ">=0.3.0,<0.4.0" +pyyaml = "*" +sphinx = ">=4,<6" +typing-extensions = "*" + +[package.extras] +testing = ["sphinx-pytest", "pytest-param-files (>=0.3.4,<0.4.0)", "pytest-regressions", "pytest-cov", "pytest (>=6,<7)", "coverage", "beautifulsoup4"] +rtd = ["sphinxext-opengraph (>=0.6.3,<0.7.0)", "sphinxcontrib.mermaid (>=0.7.1,<0.8.0)", "sphinxext-rediraffe (>=0.2.7,<0.3.0)", "sphinx-design", "sphinx-book-theme", "ipython"] +linkify = ["linkify-it-py (>=1.0,<2.0)"] +code_style = ["pre-commit (>=2.12,<3.0)"] + +[[package]] +name = "packaging" +version = "21.3" +description = "Core utilities for Python packages" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" + +[[package]] +name = "pluggy" +version = "1.0.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +testing = ["pytest-benchmark", "pytest"] +dev = ["tox", "pre-commit"] + +[[package]] +name = "py" +version = "1.11.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "pygments" +version = "2.13.0" +description = "Pygments is a syntax highlighting package written in Python." +category = "main" +optional = true +python-versions = ">=3.6" + +[package.extras] +plugins = ["importlib-metadata"] + +[[package]] +name = "pyparsing" +version = "3.0.9" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "main" +optional = false +python-versions = ">=3.6.8" + +[package.extras] +diagrams = ["railroad-diagrams", "jinja2"] + +[[package]] +name = "pytest" +version = "7.1.3" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +tomli = ">=1.0.0" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] + +[[package]] +name = "pytest-cov" +version = "3.0.0" +description = "Pytest plugin for measuring coverage." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["virtualenv", "pytest-xdist", "six", "process-tests", "hunter", "fields"] + +[[package]] +name = "pytz" +version = "2022.2.1" +description = "World timezone definitions, modern and historical" +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "main" +optional = true +python-versions = ">=3.6" + +[[package]] +name = "requests" +version = "2.28.1" +description = "Python HTTP for Humans." +category = "main" +optional = true +python-versions = ">=3.7, <4" + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<3" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "main" +optional = true +python-versions = "*" + +[[package]] +name = "sphinx" +version = "5.1.1" +description = "Python documentation generator" +category = "main" +optional = true +python-versions = ">=3.6" + +[package.dependencies] +alabaster = ">=0.7,<0.8" +babel = ">=1.3" +colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.20" +imagesize = "*" +importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} +Jinja2 = ">=2.3" +packaging = "*" +Pygments = ">=2.0" +requests = ">=2.5.0" +snowballstemmer = ">=1.1" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.5" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=3.5.0)", "flake8-comprehensions", "flake8-bugbear", "isort", "mypy (>=0.971)", "sphinx-lint", "docutils-stubs", "types-typed-ast", "types-requests"] +test = ["pytest (>=4.6)", "html5lib", "cython", "typed-ast"] + +[[package]] +name = "sphinx-rtd-theme" +version = "1.0.0" +description = "Read the Docs theme for Sphinx" +category = "main" +optional = true +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" + +[package.dependencies] +docutils = "<0.18" +sphinx = ">=1.6" + +[package.extras] +dev = ["bump2version", "sphinxcontrib-httpdomain", "transifex-client"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.2" +description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.extras] +test = ["pytest"] +lint = ["docutils-stubs", "mypy", "flake8"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.2" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +category = "main" +optional = true +python-versions = ">=3.5" + +[package.extras] +test = ["pytest"] +lint = ["docutils-stubs", "mypy", "flake8"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.0" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +category = "main" +optional = true +python-versions = ">=3.6" + +[package.extras] +test = ["html5lib", "pytest"] +lint = ["docutils-stubs", "mypy", "flake8"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +category = "main" +optional = true +python-versions = ">=3.5" + +[package.extras] +test = ["mypy", "flake8", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.3" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +category = "main" +optional = true +python-versions = ">=3.5" + +[package.extras] +test = ["pytest"] +lint = ["docutils-stubs", "mypy", "flake8"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.5" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +category = "main" +optional = true +python-versions = ">=3.5" + +[package.extras] +test = ["pytest"] +lint = ["docutils-stubs", "mypy", "flake8"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "typing-extensions" +version = "4.3.0" +description = "Backported and Experimental Type Hints for Python 3.7+" +category = "main" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "urllib3" +version = "1.26.12" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = true +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4" + +[package.extras] +brotli = ["brotlicffi (>=0.8.0)", "brotli (>=1.0.9)", "brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "urllib3-secure-extra", "ipaddress"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + +[[package]] +name = "zipp" +version = "3.8.1" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] + +[extras] +docs = ["myst-parser", "Sphinx", "sphinx-rtd-theme"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.7" +content-hash = "6c5abe1f014019df280ea421d5d97d382c2bd65b33cef4ef14b4239c7f1eb1c4" + +[metadata.files] +alabaster = [] +attrs = [] +babel = [] +certifi = [] +charset-normalizer = [] +colorama = [] +coverage = [] +docutils = [] +idna = [] +imagesize = [] +importlib-metadata = [] +iniconfig = [] +jinja2 = [] +markdown-it-py = [] +markupsafe = [] +mdit-py-plugins = [] +mdurl = [] +myst-parser = [] +packaging = [] +pluggy = [] +py = [] +pygments = [] +pyparsing = [] +pytest = [] +pytest-cov = [] +pytz = [] +pyyaml = [] +requests = [] +snowballstemmer = [] +sphinx = [] +sphinx-rtd-theme = [] +sphinxcontrib-applehelp = [] +sphinxcontrib-devhelp = [] +sphinxcontrib-htmlhelp = [] +sphinxcontrib-jsmath = [] +sphinxcontrib-qthelp = [] +sphinxcontrib-serializinghtml = [] +tomli = [] +typing-extensions = [] +urllib3 = [] +zipp = [] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..281831f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,94 @@ +[tool.poetry] +name = "dbus-fast" +version = "1.0.0" +description = "A faster version of dbus-next" +authors = ["Bluetooth Devices Authors "] +license = "MIT" +readme = "README.md" +repository = "https://github.com/bluetooth-devices/dbus-fast" +documentation = "https://dbus-fast.readthedocs.io" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries", +] +packages = [ + { include = "dbus_fast", from = "src" }, +] + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/bluetooth-devices/dbus-fast/issues" +"Changelog" = "https://github.com/bluetooth-devices/dbus-fast/blob/main/CHANGELOG.md" + +[tool.poetry.dependencies] +python = "^3.7" + +# Documentation Dependencies +Sphinx = {version = "^5.0", optional = true} +sphinx-rtd-theme = {version = "^1.0", optional = true} +myst-parser = {version = "^0.18", optional = true} + +[tool.poetry.extras] +docs = [ + "myst-parser", + "sphinx", + "sphinx-rtd-theme", +] + +[tool.poetry.dev-dependencies] +pytest = "^7.0" +pytest-cov = "^3.0" + +[tool.semantic_release] +branch = "main" +version_toml = "pyproject.toml:tool.poetry.version" +version_variable = "src/dbus_fast/__init__.py:__version__" +build_command = "pip install poetry && poetry build" + +[tool.pytest.ini_options] +addopts = "-v -Wdefault --cov=dbus_fast --cov-report=term-missing:skip-covered" +pythonpath = ["src"] + +[tool.coverage.run] +branch = true + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "@overload", + "if TYPE_CHECKING", + "raise NotImplementedError", +] + +[tool.isort] +profile = "black" +known_first_party = ["dbus_fast", "tests"] + +[tool.mypy] +check_untyped_defs = true +disallow_any_generics = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +mypy_path = "src/" +no_implicit_optional = true +show_error_codes = true +warn_unreachable = true +warn_unused_ignores = true +exclude = [ + 'docs/.*', + 'setup.py', +] + +[[tool.mypy.overrides]] +module = "tests.*" +allow_untyped_defs = true + +[[tool.mypy.overrides]] +module = "docs.*" +ignore_errors = true + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..0200e15 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "extends": ["github>browniebroke/renovate-configs:python"] +} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..0324376 --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +# This is a shim to allow GitHub to detect the package, build is done with poetry +# Taken from https://github.com/Textualize/rich + +import setuptools + +if __name__ == "__main__": + setuptools.setup(name="dbus-fast") diff --git a/src/dbus_fast/__init__.py b/src/dbus_fast/__init__.py new file mode 100644 index 0000000..5becc17 --- /dev/null +++ b/src/dbus_fast/__init__.py @@ -0,0 +1 @@ +__version__ = "1.0.0" diff --git a/src/dbus_fast/main.py b/src/dbus_fast/main.py new file mode 100644 index 0000000..f2a4348 --- /dev/null +++ b/src/dbus_fast/main.py @@ -0,0 +1,2 @@ +def add(n1: int, n2: int) -> int: + return n1 + n2 diff --git a/src/dbus_fast/py.typed b/src/dbus_fast/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 0000000..ae0188e --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,5 @@ +from dbus_fast.main import add + + +def test_add(): + assert add(1, 1) == 2