mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-12 18:58:00 +00:00
Compare commits
7 commits
c200c295e7
...
c67b26760b
Author | SHA1 | Date | |
---|---|---|---|
c67b26760b | |||
3707d3f5f6 | |||
87d58c95e6 | |||
22bba6e85e | |||
12b9ee317a | |||
9708d526a9 | |||
673175b80b |
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -12,7 +12,7 @@ __pycache__/
|
|||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
dist*/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
|
|
|
@ -1,7 +1,59 @@
|
|||
[build-system]
|
||||
requires = ["setuptools","wheel"]
|
||||
build-backend = 'setuptools.build_meta'
|
||||
requires = ["setuptools>=61.2"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "ActivityRelay"
|
||||
description = "Generic LitePub relay (works with all LitePub consumers and Mastodon)"
|
||||
license = {text = "AGPLv3"}
|
||||
classifiers = [
|
||||
"Environment :: Console",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
]
|
||||
requires-python = ">=3.8"
|
||||
dynamic = ["version", "dependencies", "optional-dependencies"]
|
||||
|
||||
[project.readme]
|
||||
file = "README.md"
|
||||
content-type = "text/markdown; charset=UTF-8"
|
||||
|
||||
[project.urls]
|
||||
Documentation = "https://git.pleroma.social/pleroma/relay/-/blob/main/docs/index.md"
|
||||
Source = "https://git.pleroma.social/pleroma/relay"
|
||||
Tracker = "https://git.pleroma.social/pleroma/relay/-/issues"
|
||||
|
||||
[project.scripts]
|
||||
activityrelay = "relay.manage:main"
|
||||
|
||||
[tool.setuptools]
|
||||
zip-safe = false
|
||||
packages = [
|
||||
"relay",
|
||||
"relay.database",
|
||||
"relay.views",
|
||||
]
|
||||
include-package-data = true
|
||||
license-files = ["LICENSE"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
relay = [
|
||||
"data/*",
|
||||
"frontend/*",
|
||||
"frontend/page/*",
|
||||
"frontend/static/*"
|
||||
]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
version = {attr = "relay.__version__"}
|
||||
dependencies = {file = ["requirements.txt"]}
|
||||
|
||||
[tool.setuptools.dynamic.optional-dependencies]
|
||||
dev = {file = ["dev-requirements.txt"]}
|
||||
|
||||
[tool.mypy]
|
||||
show_traceback = true
|
||||
|
|
37
relay/dev.py
37
relay/dev.py
|
@ -1,5 +1,6 @@
|
|||
import click
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
@ -46,21 +47,23 @@ def cli_install():
|
|||
|
||||
|
||||
@cli.command('lint')
|
||||
@click.argument('path', required = False, default = 'relay')
|
||||
@click.argument('path', required = False, type = Path, default = REPO.joinpath('relay'))
|
||||
@click.option('--strict', '-s', is_flag = True, help = 'Enable strict mode for mypy')
|
||||
@click.option('--watch', '-w', is_flag = True,
|
||||
help = 'Automatically, re-run the linters on source change')
|
||||
def cli_lint(path: str, strict: bool, watch: bool) -> None:
|
||||
flake8 = [sys.executable, '-m', 'flake8', path]
|
||||
mypy = [sys.executable, '-m', 'mypy', path]
|
||||
def cli_lint(path: Path, strict: bool, watch: bool) -> None:
|
||||
path = path.expanduser().resolve()
|
||||
|
||||
if watch:
|
||||
handle_run_watcher([sys.executable, "-m", "relay.dev", "lint", str(path)], wait = True)
|
||||
return
|
||||
|
||||
flake8 = [sys.executable, '-m', 'flake8', str(path)]
|
||||
mypy = [sys.executable, '-m', 'mypy', str(path)]
|
||||
|
||||
if strict:
|
||||
mypy.append('--strict')
|
||||
|
||||
if watch:
|
||||
handle_run_watcher(mypy, flake8, wait = True)
|
||||
return
|
||||
|
||||
click.echo('----- flake8 -----')
|
||||
subprocess.run(flake8)
|
||||
|
||||
|
@ -68,6 +71,24 @@ def cli_lint(path: str, strict: bool, watch: bool) -> None:
|
|||
subprocess.run(mypy)
|
||||
|
||||
|
||||
@cli.command('clean')
|
||||
def cli_clean():
|
||||
dirs = {
|
||||
'dist',
|
||||
'build',
|
||||
'dist-pypi'
|
||||
}
|
||||
|
||||
for directory in dirs:
|
||||
shutil.rmtree(directory, ignore_errors = True)
|
||||
|
||||
for path in REPO.glob('*.egg-info'):
|
||||
shutil.rmtree(path)
|
||||
|
||||
for path in REPO.glob('*.spec'):
|
||||
path.unlink()
|
||||
|
||||
|
||||
@cli.command('build')
|
||||
def cli_build():
|
||||
with TemporaryDirectory() as tmp:
|
||||
|
|
|
@ -2,10 +2,10 @@ activitypub-utils == 0.2.1
|
|||
aiohttp >= 3.9.1
|
||||
aiohttp-swagger[performance] == 1.0.16
|
||||
argon2-cffi == 23.1.0
|
||||
barkshark-sql @ https://git.barkshark.xyz/barkshark/bsql/archive/0.1.2.tar.gz
|
||||
barkshark-sql == 0.1.2
|
||||
click >= 8.1.2
|
||||
hamlish-jinja @ https://git.barkshark.xyz/barkshark/hamlish-jinja/archive/0.3.5.tar.gz
|
||||
hiredis == 2.3.2
|
||||
jinja2-haml == 0.3.5
|
||||
markdown == 3.5.2
|
||||
platformdirs == 4.2.0
|
||||
pyyaml >= 6.0
|
||||
|
|
51
setup.cfg
51
setup.cfg
|
@ -1,51 +0,0 @@
|
|||
[metadata]
|
||||
name = relay
|
||||
version = attr: relay.__version__
|
||||
description = Generic LitePub relay (works with all LitePub consumers and Mastodon)
|
||||
long_description = file: README.md
|
||||
long_description_content_type = text/markdown; charset=UTF-8
|
||||
url = https://git.pleroma.social/pleroma/relay
|
||||
license = AGPLv3
|
||||
license_file = LICENSE
|
||||
classifiers =
|
||||
Environment :: Console
|
||||
License :: OSI Approved :: AGPLv3 License
|
||||
Programming Language :: Python :: 3.8
|
||||
Programming Language :: Python :: 3.9
|
||||
Programming Language :: Python :: 3.10
|
||||
Programming Language :: Python :: 3.11
|
||||
Programming Language :: Python :: 3.12
|
||||
project_urls =
|
||||
Source = https://git.pleroma.social/pleroma/relay
|
||||
Tracker = https://git.pleroma.social/pleroma/relay/-/issues
|
||||
|
||||
[options]
|
||||
zip_safe = False
|
||||
packages =
|
||||
relay
|
||||
relay.database
|
||||
relay.views
|
||||
include_package_data = true
|
||||
install_requires = file: requirements.txt
|
||||
python_requires = >=3.8
|
||||
|
||||
[options.extras_require]
|
||||
dev = file: dev-requirements.txt
|
||||
|
||||
[options.package_data]
|
||||
relay =
|
||||
data/*
|
||||
frontend/*
|
||||
frontend/page/*
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
activityrelay = relay.manage:main
|
||||
|
||||
|
||||
[flake8]
|
||||
extend-ignore = E128,E251,E261,E303,W191
|
||||
max-line-length = 100
|
||||
indent-size = 4
|
||||
per-file-ignores =
|
||||
__init__.py: F401
|
Loading…
Reference in a new issue