kopia lustrzana https://github.com/halcy/Mastodon.py
Porównaj commity
5 Commity
3d5b94f07f
...
2d9fcff4e0
Autor | SHA1 | Data |
---|---|---|
Lorenz Diener | 2d9fcff4e0 | |
codl | b08a15e9d9 | |
codl | 88e838c7f0 | |
codl | 246ebc7299 | |
codl | fc3a873062 |
|
@ -7,7 +7,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -20,7 +20,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -33,7 +33,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Install codecov"
|
||||
command: "pip install codecov"
|
||||
|
@ -52,7 +52,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -65,7 +65,7 @@ jobs:
|
|||
- checkout
|
||||
- run:
|
||||
name: "Install test deps"
|
||||
command: "pip install .[test]"
|
||||
command: "pip install .[test,webpush,blurhash]"
|
||||
- run:
|
||||
name: "Run tests"
|
||||
command: "python setup.py pytest --addopts '--junitxml=tests/result.xml'"
|
||||
|
@ -79,4 +79,3 @@ workflows:
|
|||
- run-tests-38-cov
|
||||
- run-tests-39
|
||||
- run-tests-310
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend= "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "Mastodon.py"
|
||||
version = "1.8.1"
|
||||
description = "Python wrapper for the Mastodon API"
|
||||
readme = "README.rst"
|
||||
authors = [
|
||||
{ name = "Lorenz Diener", email = "lorenzd+mastodonpypypi@gmail.com" },
|
||||
]
|
||||
license = {text = "MIT"}
|
||||
keywords = ["mastodon", "api", "microblogging"]
|
||||
classifiers = [
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Intended Audience :: Developers',
|
||||
'Topic :: Communications',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 3',
|
||||
]
|
||||
dependencies = [
|
||||
'requests>=2.4.2',
|
||||
'python-dateutil',
|
||||
'six',
|
||||
'python-magic-bin ; platform_system=="Windows"',
|
||||
'python-magic ; platform_system!="Windows"',
|
||||
'decorator>=4.0.0',
|
||||
'blurhash>=1.1.4',
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
webpush = [
|
||||
'http_ece>=1.0.5',
|
||||
'cryptography>=1.6.0',
|
||||
]
|
||||
blurhash = [
|
||||
'blurhash>=1.1.4',
|
||||
]
|
||||
test = [
|
||||
'pytest',
|
||||
'pytest-runner',
|
||||
'pytest-cov',
|
||||
'vcrpy',
|
||||
'pytest-vcr',
|
||||
'pytest-mock',
|
||||
'requests-mock',
|
||||
'pytz',
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Repository="https://github.com/halcy/Mastodon.py"
|
||||
Documentation="https://mastodonpy.readthedocs.io/"
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--cov=mastodon"
|
13
setup.cfg
13
setup.cfg
|
@ -1,13 +0,0 @@
|
|||
[bdist_wheel]
|
||||
universal=1
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = docs
|
||||
build-dir = docs/build
|
||||
all_files = 1
|
||||
|
||||
[aliases]
|
||||
test=pytest
|
||||
|
||||
[tool:pytest]
|
||||
addopts = --cov=mastodon
|
61
setup.py
61
setup.py
|
@ -1,62 +1,3 @@
|
|||
from pathlib import Path
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
test_deps = [
|
||||
'pytest',
|
||||
'pytest-runner',
|
||||
'pytest-cov',
|
||||
'vcrpy',
|
||||
'pytest-vcr',
|
||||
'pytest-mock',
|
||||
'requests-mock',
|
||||
'pytz'
|
||||
]
|
||||
|
||||
webpush_deps = [
|
||||
'http_ece>=1.0.5',
|
||||
'cryptography>=1.6.0',
|
||||
]
|
||||
|
||||
blurhash_deps = [
|
||||
'blurhash>=1.1.4',
|
||||
]
|
||||
|
||||
extras = {
|
||||
"test": test_deps + webpush_deps + blurhash_deps,
|
||||
"webpush": webpush_deps,
|
||||
"blurhash": blurhash_deps,
|
||||
}
|
||||
|
||||
this_directory = Path(__file__).parent
|
||||
long_description = (this_directory / "README.rst").read_text()
|
||||
|
||||
setup(name='Mastodon.py',
|
||||
version='1.8.1',
|
||||
description='Python wrapper for the Mastodon API',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/x-rst',
|
||||
packages=['mastodon'],
|
||||
install_requires=[
|
||||
'requests>=2.4.2',
|
||||
'python-dateutil',
|
||||
'six',
|
||||
'python-magic-bin ; platform_system=="Windows"', # pragma: no cover
|
||||
'python-magic ; platform_system!="Windows"',
|
||||
'decorator>=4.0.0',
|
||||
] + blurhash_deps,
|
||||
tests_require=test_deps,
|
||||
extras_require=extras,
|
||||
url='https://github.com/halcy/Mastodon.py',
|
||||
author='Lorenz Diener',
|
||||
author_email='lorenzd+mastodonpypypi@gmail.com',
|
||||
license='MIT',
|
||||
keywords='mastodon api microblogging',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Intended Audience :: Developers',
|
||||
'Topic :: Communications',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 3',
|
||||
])
|
||||
setup()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
To run this test suite, install the testing dependencies:
|
||||
|
||||
pip install -e .[test]
|
||||
pip install -e .[test,webpush,blurhash]
|
||||
|
||||
Then, run `pytest`.
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
import pytest
|
||||
|
||||
import mastodon.compat
|
||||
if not mastodon.compat.IMPL_HAS_BLURHASH:
|
||||
pytest.skip("blurhash dependencies missing, skipping blurhash tests", allow_module_level=True)
|
||||
|
||||
def test_blurhash_decode(api):
|
||||
fake_media_dict = {
|
||||
'width': 320,
|
||||
|
|
|
@ -2,6 +2,10 @@ import pytest
|
|||
import time
|
||||
from mastodon.Mastodon import MastodonNotFoundError
|
||||
|
||||
import mastodon.compat
|
||||
if not mastodon.compat.IMPL_HAS_CRYPTO or not mastodon.compat.IMPL_HAS_ECE:
|
||||
pytest.skip("webpush dependencies missing, skipping webpush tests", allow_module_level=True)
|
||||
|
||||
def test_decrypt(api):
|
||||
priv = {
|
||||
'auth': b'\xe7y\x0fp\xb9\x92\xe0\xa0\xc5\xd5~Qr\xd7\xaa\x16',
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -4,5 +4,5 @@ skipsdist = true
|
|||
|
||||
|
||||
[testenv]
|
||||
deps = .[test]
|
||||
deps = .[test,webpush,blurhash]
|
||||
commands = python setup.py test
|
||||
|
|
Ładowanie…
Reference in New Issue