Compare commits

..

No commits in common. "c67b26760b1c7b4ef70bad9e0a1819de625728d5" and "c200c295e71bdd43db5f0bb10a34e3998da37e13" have entirely different histories.

7 changed files with 68 additions and 92 deletions

2
.gitignore vendored
View file

@ -12,7 +12,7 @@ __pycache__/
env/ env/
build/ build/
develop-eggs/ develop-eggs/
dist*/ dist/
downloads/ downloads/
eggs/ eggs/
.eggs/ .eggs/

View file

@ -1,59 +1,7 @@
[build-system] [build-system]
requires = ["setuptools>=61.2"] requires = ["setuptools","wheel"]
build-backend = "setuptools.build_meta" 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] [tool.mypy]
show_traceback = true show_traceback = true

View file

@ -1,6 +1,5 @@
import click import click
import platform import platform
import shutil
import subprocess import subprocess
import sys import sys
import time import time
@ -47,23 +46,21 @@ def cli_install():
@cli.command('lint') @cli.command('lint')
@click.argument('path', required = False, type = Path, default = REPO.joinpath('relay')) @click.argument('path', required = False, default = 'relay')
@click.option('--strict', '-s', is_flag = True, help = 'Enable strict mode for mypy') @click.option('--strict', '-s', is_flag = True, help = 'Enable strict mode for mypy')
@click.option('--watch', '-w', is_flag = True, @click.option('--watch', '-w', is_flag = True,
help = 'Automatically, re-run the linters on source change') help = 'Automatically, re-run the linters on source change')
def cli_lint(path: Path, strict: bool, watch: bool) -> None: def cli_lint(path: str, strict: bool, watch: bool) -> None:
path = path.expanduser().resolve() flake8 = [sys.executable, '-m', 'flake8', path]
mypy = [sys.executable, '-m', 'mypy', path]
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: if strict:
mypy.append('--strict') mypy.append('--strict')
if watch:
handle_run_watcher(mypy, flake8, wait = True)
return
click.echo('----- flake8 -----') click.echo('----- flake8 -----')
subprocess.run(flake8) subprocess.run(flake8)
@ -71,24 +68,6 @@ def cli_lint(path: Path, strict: bool, watch: bool) -> None:
subprocess.run(mypy) 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') @cli.command('build')
def cli_build(): def cli_build():
with TemporaryDirectory() as tmp: with TemporaryDirectory() as tmp:

View file

@ -2,10 +2,10 @@ activitypub-utils == 0.2.1
aiohttp >= 3.9.1 aiohttp >= 3.9.1
aiohttp-swagger[performance] == 1.0.16 aiohttp-swagger[performance] == 1.0.16
argon2-cffi == 23.1.0 argon2-cffi == 23.1.0
barkshark-sql == 0.1.2 barkshark-sql @ https://git.barkshark.xyz/barkshark/bsql/archive/0.1.2.tar.gz
click >= 8.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 hiredis == 2.3.2
jinja2-haml == 0.3.5
markdown == 3.5.2 markdown == 3.5.2
platformdirs == 4.2.0 platformdirs == 4.2.0
pyyaml >= 6.0 pyyaml >= 6.0

51
setup.cfg Normal file
View file

@ -0,0 +1,51 @@
[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

4
setup.py Normal file
View file

@ -0,0 +1,4 @@
import setuptools
if __name__ == "__main__":
setuptools.setup()

View file

@ -1,6 +0,0 @@
[flake8]
extend-ignore = E128,E251,E261,E303,W191
max-line-length = 100
indent-size = 4
per-file-ignores =
__init__.py: F401