-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9522e8e
commit 35bbf0f
Showing
30 changed files
with
2,173 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[darglint] | ||
strictness = short |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[flake8] | ||
select = ANN,B,B9,BLK,C,D,DAR,E,F,I,S,W | ||
ignore = E203,E501,W503,ANN101,ANN102,DAR103 | ||
max-line-length = 80 | ||
max-complexity = 10 | ||
application-import-names = mcsrvstats,tests | ||
import-order-style = google | ||
docstring-convention = google | ||
per-file-ignores = tests/*:S101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
categories: | ||
- title: ":boom: Breaking Changes" | ||
label: "breaking" | ||
- title: ":package: Build System" | ||
label: "build" | ||
- title: ":construction_worker: Continuous Integration" | ||
label: "ci" | ||
- title: ":books: Documentation" | ||
label: "documentation" | ||
- title: ":rocket: Features" | ||
label: "enhancement" | ||
- title: ":beetle: Fixes" | ||
label: "bug" | ||
- title: ":racehorse: Performance" | ||
label: "performance" | ||
- title: ":hammer: Refactoring" | ||
label: "refactoring" | ||
- title: ":fire: Removals and Deprecations" | ||
label: "removal" | ||
- title: ":lipstick: Style" | ||
label: "style" | ||
|
||
template: | | ||
## What’s Changed | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Coverage | ||
on: push | ||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
architecture: x64 | ||
- run: pip install nox==2019.11.9 | ||
- run: pip install poetry==1.0.4 | ||
- run: nox --sessions tests-3.8 coverage | ||
env: | ||
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Release Drafter | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
draft_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
architecture: x64 | ||
- run: pip install nox==2019.11.9 | ||
- run: pip install poetry==1.0.5 | ||
- run: nox | ||
- run: poetry build | ||
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: TestPyPI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
test_pypi: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
architecture: x64 | ||
- run: pip install poetry==1.0.5 | ||
- run: >- | ||
poetry version patch && | ||
version=$(poetry version | awk '{print $2}') && | ||
poetry version $version.dev.$(date +%s) | ||
- run: poetry build | ||
- uses: pypa/gh-action-pypi-publish@v1.0.0a0 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Tests | ||
on: push | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8"] | ||
name: Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
- run: pip install nox==2019.11.9 | ||
- run: pip install poetry==1.0.4 | ||
- run: nox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black | ||
language: system | ||
types: [python] | ||
- id: flake8 | ||
name: flake8 | ||
entry: poetry run flake8 | ||
language: system | ||
types: [python] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
sphinx: | ||
configuration: docs/conf.py | ||
formats: all | ||
python: | ||
version: 3.7 | ||
install: | ||
- requirements: docs/requirements.txt | ||
- path: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Sphinx configuration.""" | ||
from datetime import datetime | ||
|
||
|
||
project = "mcsrvstats" | ||
author = "Leon Bowie" | ||
copyright = f"{datetime.now().year}, {author}" | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.napoleon", | ||
"sphinx_autodoc_typehints", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
The Ayncpixel Python Project | ||
============================== | ||
|
||
.. toctree:: | ||
:hidden: | ||
:maxdepth: 1 | ||
|
||
license | ||
reference | ||
|
||
TODO | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
To install the mcsrvstats Python project, | ||
run this command in your terminal: | ||
|
||
.. code-block:: console | ||
$ pip install mcsrvstats | ||
Usage | ||
----- | ||
|
||
Asyncpixel Python's usage looks like: | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
License | ||
======= | ||
|
||
.. include:: ../LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Reference | ||
========= | ||
|
||
.. contents:: | ||
:local: | ||
:backlinks: none | ||
|
||
|
||
asyncpixel | ||
-------------------------- | ||
|
||
.. automodule:: asyncpixel | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
sphinx==2.3.1 | ||
sphinx-autodoc-typehints==1.10.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
from .main import * | ||
"""Minecraft Server Stats Wrapper. | ||
~~~~~~~~~~~~~~~~~~~ | ||
A wrapper for a collection of popular minecraft server stats. | ||
:copyright: (c) 2020 Darkflame72 | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
|
||
__title__ = "mcsrvstats" | ||
__author__ = "Leon Bowie" | ||
__license__ = "MIT" | ||
__copyright__ = "Copyright 2020 Darkflame72" | ||
|
||
|
||
try: | ||
from importlib.metadata import version, PackageNotFoundError # type: ignore | ||
except ImportError: # pragma: no cover | ||
from importlib_metadata import version, PackageNotFoundError # type: ignore | ||
|
||
|
||
try: | ||
__version__ = version(__name__) | ||
except PackageNotFoundError: # pragma: no cover | ||
__version__ = "unknown" | ||
|
||
|
||
from collections import namedtuple | ||
|
||
|
||
VersionInfo = namedtuple("VersionInfo", "major minor micro releaselevel serial") | ||
|
||
version_info = VersionInfo(major=0, minor=1, micro=1, releaselevel="alpha", serial=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Exceptions for asyncpixel.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""All exceptions for asyncpixel.""" | ||
|
||
|
||
class ApiError(Exception): | ||
"""Raised when a error occurs on the api side""" | ||
|
||
def __init__(self, error: str, source: str = "unknown source") -> None: | ||
"""Error raised when api is not succesful. | ||
Args: | ||
error (str): Error message | ||
source (str, optional): Source of the error. Defaults to "unknown source". | ||
""" | ||
self.message = f"The {source}API had {error}" | ||
super().__init__(self.message) | ||
|
||
def __str__(self) -> str: | ||
"""Return error in readable format. | ||
Returns: | ||
str: string version of error | ||
""" | ||
return self.message |
Oops, something went wrong.