mirror of
https://github.com/saveweb/biliarchiver.git
synced 2024-09-19 11:05:28 -07:00
chore: build system
This commit is contained in:
parent
36127765e4
commit
7bd3a4581d
3
.github/workflows/python-package.yaml
vendored
3
.github/workflows/python-package.yaml
vendored
@ -31,6 +31,9 @@ jobs:
|
||||
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
poetry install
|
||||
pip install -e .
|
||||
- name: build
|
||||
run: |
|
||||
python build.py
|
||||
- name: Lint with ruff
|
||||
uses: chartboost/ruff-action@v1
|
||||
with:
|
||||
|
@ -2,6 +2,7 @@ import gettext
|
||||
import locale
|
||||
|
||||
default_lang, default_enc = locale.getdefaultlocale()
|
||||
default_lang = default_lang or "en"
|
||||
|
||||
languages = ["en"] if not default_lang.lower().startswith("zh") else ["zh_CN"]
|
||||
|
||||
|
8
build.py
Executable file
8
build.py
Executable file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
import subprocess
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Building i18n...")
|
||||
subprocess.run(["msgfmt", "biliarchiver/locales/en/LC_MESSAGES/biliarchiver.po", "-o", "biliarchiver/locales/en/LC_MESSAGES/biliarchiver.mo"])
|
||||
print("Building with poetry...")
|
||||
subprocess.run(["poetry", "build"])
|
@ -5,6 +5,7 @@ description = ""
|
||||
authors = ["yzqzss <yzqzss@yandex.com>"]
|
||||
readme = "README.md"
|
||||
packages = [{ include = "biliarchiver" }]
|
||||
include = ["biliarchiver/locales/**/*.mo"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.9"
|
||||
@ -35,22 +36,7 @@ fixable = ["ALL"]
|
||||
unfixable = []
|
||||
|
||||
# Exclude a variety of commonly ignored directories.
|
||||
exclude = [
|
||||
".direnv",
|
||||
".git",
|
||||
".git-rewrite",
|
||||
".pants.d",
|
||||
".pytype",
|
||||
".ruff_cache",
|
||||
".js",
|
||||
".venv",
|
||||
"__pypackages__",
|
||||
"_build",
|
||||
"build",
|
||||
"dist",
|
||||
"node_modules",
|
||||
"venv",
|
||||
]
|
||||
exclude = []
|
||||
per-file-ignores = {}
|
||||
|
||||
# Same as Black.
|
||||
|
Loading…
Reference in New Issue
Block a user