Compare commits

...

5 commits

Author SHA1 Message Date
Izalia Mae 8fb966f02c Merge branch 'dev' into 'main'
version 0.3.1

See merge request pleroma/relay!58
2024-04-01 17:10:02 +00:00
Izalia Mae 22bba6e85e use jinja2-haml from pypi
jinja2-haml is the renamed hamlish-jinja fork at https://git.barkshark.xyz/barkshark/hamlish-jinja
2024-04-01 13:09:54 -04:00
Izalia Mae 12b9ee317a simplify dev lint command with watch flag 2024-04-01 13:05:32 -04:00
Izalia Mae 9708d526a9 use correct license name 2024-04-01 13:04:41 -04:00
Izalia Mae 673175b80b add clean dev command 2024-04-01 07:18:10 -04:00
3 changed files with 31 additions and 10 deletions

View file

@ -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:

View file

@ -4,8 +4,8 @@ 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
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

View file

@ -9,7 +9,7 @@ license = AGPLv3
license_file = LICENSE
classifiers =
Environment :: Console
License :: OSI Approved :: AGPLv3 License
License :: OSI Approved :: GNU Affero General Public License v3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10